backend
Class pingThread

java.lang.Object
  extended byjava.lang.Thread
      extended bybackend.pingThread
All Implemented Interfaces:
Runnable

public class pingThread
extends Thread

Each instance of this class represents 1 ping call. The class is called from the backend. Since this class is threaded it can be called more then once for more then 1 ip and each ping call can be run at the same time.


Field Summary
static BlackBoard BBMethods
          Stores the interface of the blackboard
static int LINUX
           
static int SUN_OS
           
static int WINDOWS
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
pingThread()
          Used when doing a singleton ping call
pingThread(LanNode node)
          Main constructor of the pingThread class.
 
Method Summary
static boolean pinger(String ip)
          This is where the ping call happens and where all the parsing of the output takes place.
 void run()
          First execution point of the thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WINDOWS

public static final int WINDOWS
See Also:
Constant Field Values

LINUX

public static final int LINUX
See Also:
Constant Field Values

SUN_OS

public static final int SUN_OS
See Also:
Constant Field Values

BBMethods

public static BlackBoard BBMethods
Stores the interface of the blackboard

Constructor Detail

pingThread

public pingThread(LanNode node)
Main constructor of the pingThread class. It accepts a lanNode and then reterives its ipaddress and stores a copy of it in the tempNode variable and if everything is ok it starts the ping thread.

Parameters:
node - Expects a lanNode from the blackboard. Once the ping call is finished it will update the ping status of the node

pingThread

public pingThread()
Used when doing a singleton ping call

Method Detail

run

public void run()
First execution point of the thread. It calls a seperate function pinger which returns true if the ping was successful and false otherwise


pinger

public static boolean pinger(String ip)
This is where the ping call happens and where all the parsing of the output takes place. The function always assumes false until the output stream shows a valid reply.

Parameters:
ip - String containing a ip address to ping
Returns:
A boolean indicating whether the ping was successful (true) and false otherwise