MicroTAPAS.mobility
Class MicroPingClient

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--MicroTAPAS.mobility.MicroPingClient
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class MicroPingClient
extends java.lang.Thread
implements java.io.Serializable

This class sends ping requests at certain intervals. This class operates in one of two modes:
1) MobilityManager: Pings all nodes that are 'connected' to this MM,
2) MobilityAgent: Pings its own Director node. The interval between pings is determined dynamically, where loss of connetcion will cut the current interval in half, and a online connection of more than 10*initial interval will increase the current interval by the initial interval.

See Also:
Serialized Form

Field Summary
private  AddressMonitor am
           
private  long currentInterval
          Current interval between pings.
private static boolean DEBUG
          Determines whether debug info to be sent to debug-server
private  long intervalMax
          Max interval between pings.
private  long intervalMin
          Min interval between pings.
private  boolean isActive
          Indicates whether this client is active or not.
private  boolean isMMNode
          Whether this node is a MM node.
private  MobilitySupportActor parent
          Reference to the parent MicroConnectionManager.
private  int pingPort
          Socket port to send requests to.
private  java.lang.String selfNode
          Variable that holds the current IP address of this node.
private  java.net.Socket socket
          Client socket used in pinging pingServer(s).
private  long startInterval
          Initial interval between pings.
private  long startTime
          Start time of this client.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MicroPingClient(MobilitySupportActor pParent)
          Constructor
 
Method Summary
 void destroy()
          Destroy method
 boolean hasTerminalMoved()
          Compares the old stored IP to the current IP to determine if a terminal has moved from one domain to another.
 void pingLoop()
          Main procedure in this thread
 void run()
          Run method that starts this thread
 Item status()
          Status report of MicroPingClient in Item hierarchy of information elements.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, 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

DEBUG

private static final boolean DEBUG
Determines whether debug info to be sent to debug-server

See Also:
Constant Field Values

pingPort

private int pingPort
Socket port to send requests to.


startInterval

private long startInterval
Initial interval between pings.


currentInterval

private long currentInterval
Current interval between pings.


intervalMax

private long intervalMax
Max interval between pings.


intervalMin

private long intervalMin
Min interval between pings.


startTime

private long startTime
Start time of this client.


parent

private MobilitySupportActor parent
Reference to the parent MicroConnectionManager.


am

private AddressMonitor am

isMMNode

private boolean isMMNode
Whether this node is a MM node.


socket

private java.net.Socket socket
Client socket used in pinging pingServer(s).


isActive

private boolean isActive
Indicates whether this client is active or not.


selfNode

private java.lang.String selfNode
Variable that holds the current IP address of this node.

Constructor Detail

MicroPingClient

public MicroPingClient(MobilitySupportActor pParent)
Constructor

Method Detail

run

public void run()
Run method that starts this thread

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

destroy

public void destroy()
Destroy method

Overrides:
destroy in class java.lang.Thread

pingLoop

public void pingLoop()
              throws java.lang.Exception
Main procedure in this thread

java.lang.Exception

hasTerminalMoved

public boolean hasTerminalMoved()
Compares the old stored IP to the current IP to determine if a terminal has moved from one domain to another.

Returns:
A boolean indicating whether the terminal has moved.

status

public Item status()
Status report of MicroPingClient in Item hierarchy of information elements.

Returns:
Hierarchy of Item information elements


The Telematics Architecture for Plug-and-Play Systems (TAPAS) is a research project undertaken by the Norwegian University of Science and Technology's Telematics department which aims at developing an architecture for network-based service systems with a) flexibility and adaptability, b) robustness and survivability, and c) QoS awareness and resource control.

More information can be found at the project's homepage at http://tapas.item.ntnu.no and the project manager, Professor Finn Arve Aagesen, can be reached at finn.arve.aagesen@item.ntnu.no.