MicroTAPAS.mobility
Class MobilityRegistryManager

java.lang.Object
  |
  +--MicroTAPAS.mobility.MobilityRegistryManager
All Implemented Interfaces:
java.io.Serializable

public class MobilityRegistryManager
extends java.lang.Object
implements java.io.Serializable

Manages and operates node registries for a Mobility entity. The class contains four registers:
Node registry (nReg)
Assigned address registry (aReg)
Forward address registry (fReg)
Actor routing table (actReg)

The implementation includes methods to access and set information in the various registries.

See Also:
Node, Serialized Form

Field Summary
private static java.util.Hashtable actReg
          Hashtable to contain the routing table for actors.
private static java.util.Hashtable aReg
          Hashtables that contains the assigned address registry.
private static boolean DEBUG
          Determines whether debug info to be sent to debug-server.
private static java.util.Hashtable fReg
          Hashtables that contains the forward address registry.
private  java.lang.String nodeID
          Unique node ID
private static java.util.Hashtable nReg
          Hashtables that contains the node registry.
 MobilityManager1 parent
          Reference to parent object.
 
Constructor Summary
MobilityRegistryManager(MobilityManager1 pParent, java.lang.String id)
          Constructor
 
Method Summary
 RequestResult actorDiscovery(RequestPars rp)
          This method discovers an actor in the registry.
 RequestResult actorMove(GAI oldGAI, GAI newGAI)
          Method to delete an actor entry in the actor registry when an actor has moved to a different node.
 RequestResult actorRegister(RequestPars rp)
          Registers an actor with the actor's node registry.
 RequestResult actorRegisterCancel(RequestPars rp)
          Removes an actor from the registry.
 RequestResult actorRegisterMove(RequestPars pRP)
          Method to delete an actor entry in the actor registry when an actor has moved to a different node.
 Item actRegStatus()
          Returns the status of the registry as an Item hierarchy of elements.
 RequestResult addLocalAssigned(java.lang.String ips, boolean doUpdate)
          Method to add new IP(s) to local domain (this MM's domain).
 RequestResult addNode(Node node, java.util.Vector ips, boolean doUpdate)
          Method to add a node to the registries.
private  RequestResult addressUpdate(RequestPars rp, java.util.Hashtable reg)
          Performs a update on a address registry by comparing addresses received from foreign MM by locally registered ones and add those that are missing locally.
 Item aRegStatus()
          Returns the status of the registry as an Item hierarchy of elements.
private  java.util.Vector assignedIPCheck(java.util.Vector v)
          Method to check whether an assigned ip is already registered, both locally and all registered MM's.
private  RequestResult assignedUpdate(RequestPars rp)
          Updates the local assigned address registry, and returns a Hashtable containing those addresses the sender did not have in its request.
private  void clearForward(java.lang.String sNode)
          Removes ALL forward references for a certain node (when node is shut down).
private  RequestResult forwardUpdate(RequestPars rp)
          Updates the local forward address registry, and returns a Hashtable containing those addresses the sender did not have in its request.
 Item fRegStatus()
          Returns the status of the registry as an Item hierarchy of elements.
 java.util.Vector getAllDirectors()
          Method to find all the Directors who are registered at this node.
 java.util.Vector getAllNodes()
          Method to return a vector of Nodes that can be pinged (not itself).
private  java.util.Vector getAssignedIPs()
          Method to fetch all the assigned IP's registered at this node
private  java.lang.String getAssignedNodeID(java.lang.String sNode)
          Locates an assigned node's node-ID based on it's node address.
 GAI getDirectorGAI(java.lang.String sNode)
          Method to find the Director of a particular node
private  java.lang.String getForwardNodeID(java.lang.String sNode)
          Locates a forward node's node-ID based on it's node address.
 java.util.Vector getLocalIPs()
          Method to find all locally assigned IP's.
private  java.lang.String getMMNode(java.lang.String id)
          Finds the id of the current managing node of a moved node.
 java.util.Vector getMMNodes()
          Method to return a vector of MM nodes.
private  java.util.Hashtable getMMNodesID()
          Method to return a Hashtable of MM nodes[id, mmGAI].
 Node getNode(java.lang.String id)
          Method to safely get a node from the node registry.
 java.util.Vector getPingNodes()
          Method to return a vector of Nodes that can be pinged (not itself).
 Item listActors()
          Returns all registered actors as an Item hierarchy of elements.
 RequestResult mmDiscovery(RequestPars rp)
          Discovers a MobilityManager (searches only local registry).
 RequestResult mobilitySync(RequestPars rp)
          Method to handle mobility synchronization:
-ASSIGNED_UPDATE handles the update of the assigned address registry.
 RequestResult nodeDiscovery(RequestPars rp)
          Handles incomming NodeDiscovery requests from foreign MM's.
 boolean nodeValidate(GAI mobGAI)
          Checks if a node is previously registered.
 Item nRegStatus()
          Returns the status of the registry as an Item hierarchy of elements.
private  RequestResult performActorUpdate(RequestPars pRP)
          Relays a request to all the registered MM's in the network.
private  java.util.Hashtable performAddressUpdate(java.lang.String syncType, java.util.Hashtable reg)
          Performs update on an address registry by sending requests to all registered MM nodes.
private  void performAssignedUpdate()
          Performs an assigned address update to all registered nodes.
private  void performForwardUpdate()
          Performs an forward address update to all registered nodes.
private  void printHT(java.lang.String heading, java.util.Hashtable ht)
          Method to print the contents of a Hashtable consisting of :Vector(string)
 RequestResult removeLocalIP(java.lang.String ip)
          Method to remove an assigned local IP from the registry.
 RequestResult removeNode(Node node, boolean doUpdate)
          Method to remove a node from the relevnat registries.
 void setConnected(boolean isConnected, Node pNode)
          Updates the connection status of a particular node.
 Item status()
          Status report of MobilitySupportActor in Item hierarchy of information elements.
 boolean terminalMove(java.lang.String oldNode, java.lang.String newNode, Node node)
          The indicated node has changed location, and relevnat registries must be updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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

parent

public MobilityManager1 parent
Reference to parent object.


aReg

private static java.util.Hashtable aReg
Hashtables that contains the assigned address registry.


fReg

private static java.util.Hashtable fReg
Hashtables that contains the forward address registry.


nReg

private static java.util.Hashtable nReg
Hashtables that contains the node registry.


actReg

private static java.util.Hashtable actReg
Hashtable to contain the routing table for actors.


nodeID

private java.lang.String nodeID
Unique node ID

Constructor Detail

MobilityRegistryManager

public MobilityRegistryManager(MobilityManager1 pParent,
                               java.lang.String id)
Constructor

Method Detail

addNode

public RequestResult addNode(Node node,
                             java.util.Vector ips,
                             boolean doUpdate)
Method to add a node to the registries. It will update both the mobility registry [:] and the address registries; forwardRegistry [: vector(ip's)] and assignedRegistry [[: vector(ip's)]].

Parameters:
node - The node to be added/updated.
ips - The node's initially assigned IP's
Returns:
Success indicator.

removeNode

public RequestResult removeNode(Node node,
                                boolean doUpdate)
Method to remove a node from the relevnat registries. This will typically happen if a TAPAS node is shut down.

Parameters:
node - The node to be removed.
Returns:
Success indicator.

terminalMove

public boolean terminalMove(java.lang.String oldNode,
                            java.lang.String newNode,
                            Node node)
The indicated node has changed location, and relevnat registries must be updated.

Parameters:
oldNode - The old node.
newNode - The new node.
node - The updated node object for moved node.
Returns:
Success indicator

setConnected

public void setConnected(boolean isConnected,
                         Node pNode)
Updates the connection status of a particular node. If the connection status is set to false, a forward address of '0.0.0.0' is added to the end of the forward vector for that node.

Parameters:
isConnected - Determines if the node is connected or not
pNode - The node in question. If pNode = null, the status of the local node is updated, else that node will be updated.

mobilitySync

public RequestResult mobilitySync(RequestPars rp)
Method to handle mobility synchronization:
-ASSIGNED_UPDATE handles the update of the assigned address registry.
-FORWARD_UPDATE handles the update of the forward address registry.
-ACTOR_UPDATE handles the update of actor routing table.

Parameters:
rp - TAPAS-style request parameter.
Returns:
TAPAS-style result.

getMMNodes

public java.util.Vector getMMNodes()
Method to return a vector of MM nodes.

Returns:
A vector containing the MM nodes.

nodeValidate

public boolean nodeValidate(GAI mobGAI)
Checks if a node is previously registered.

Parameters:
mobGAI - The GAI of the entity to be checked
Returns:
Success indicator

getLocalIPs

public java.util.Vector getLocalIPs()
Method to find all locally assigned IP's.

Returns:
A vector containing all the registered local assigned IP's

addLocalAssigned

public RequestResult addLocalAssigned(java.lang.String ips,
                                      boolean doUpdate)
Method to add new IP(s) to local domain (this MM's domain). The IP's can be in a comma-seperated string like 10.0.0.1,10.0.0.10,10.0.0.15

Parameters:
ips - Comma-seperated string of IP addresses.
Returns:
TAPAS style result

removeLocalIP

public RequestResult removeLocalIP(java.lang.String ip)
Method to remove an assigned local IP from the registry.

Parameters:
ip - The address to be removed.
Returns:
TAPAS-style result.

actorDiscovery

public RequestResult actorDiscovery(RequestPars rp)
This method discovers an actor in the registry. First it searches for the actor's node, then the actor itself.

Parameters:
rp - TAPAS-style request.
Returns:
TAPAS-style result.

mmDiscovery

public RequestResult mmDiscovery(RequestPars rp)
Discovers a MobilityManager (searches only local registry).

Parameters:
rp - TAPAS-style request parameter
Returns:
TAPAS-style result

getNode

public Node getNode(java.lang.String id)
Method to safely get a node from the node registry. If the node can not be found locally, a request is sent to the managing MM of that node.

Parameters:
id - The id/key of the node.
Returns:
The node.

nodeDiscovery

public RequestResult nodeDiscovery(RequestPars rp)
Handles incomming NodeDiscovery requests from foreign MM's.

Parameters:
rp - TAPAS-style request.
Returns:
TAPAS-style result.

getPingNodes

public java.util.Vector getPingNodes()
Method to return a vector of Nodes that can be pinged (not itself).

Returns:
A vector containing the nodes that can be pinged.

getAllNodes

public java.util.Vector getAllNodes()
Method to return a vector of Nodes that can be pinged (not itself).

Returns:
A vector containing the nodes that can be pinged.

getDirectorGAI

public GAI getDirectorGAI(java.lang.String sNode)
Method to find the Director of a particular node

Parameters:
sNode - The node address of the terminal
Returns:
The GAI of the Director of the given terminal

getAllDirectors

public java.util.Vector getAllDirectors()
Method to find all the Directors who are registered at this node.

Returns:
Vector containing the String representation of all director GAI.

actorRegister

public RequestResult actorRegister(RequestPars rp)
Registers an actor with the actor's node registry. This mehtod will also create/update an entry into the actor routing table.

Parameters:
rp - TAPAS-style request.
Returns:
TAPAS-style result.

actorRegisterCancel

public RequestResult actorRegisterCancel(RequestPars rp)
Removes an actor from the registry. This mehtod is called when an actor is plugged out as a result of actorPlugOut, actorMove or actorChangeBehaviour commands.

Parameters:
rp - TAPAS-style request.
Returns:
TAPAS-style result.

actorMove

public RequestResult actorMove(GAI oldGAI,
                               GAI newGAI)
Method to delete an actor entry in the actor registry when an actor has moved to a different node.

Parameters:
oldGAI - The old GAI of the actor.
newGAI - The new GAI of the actor.
Returns:
Success indicator

actorRegisterMove

public RequestResult actorRegisterMove(RequestPars pRP)
Method to delete an actor entry in the actor registry when an actor has moved to a different node.

Parameters:
pRP - TAPAS-style request parameters.
Returns:
TAPAS-style request result.

status

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

Returns:
Hierarchy of Item information elements

listActors

public Item listActors()
Returns all registered actors as an Item hierarchy of elements.

Returns:
Item of registered actors.

nRegStatus

public Item nRegStatus()
Returns the status of the registry as an Item hierarchy of elements.

Returns:
Item of registered actors.

fRegStatus

public Item fRegStatus()
Returns the status of the registry as an Item hierarchy of elements.

Returns:
Item of registered actors.

aRegStatus

public Item aRegStatus()
Returns the status of the registry as an Item hierarchy of elements.

Returns:
Item of registered actors.

actRegStatus

public Item actRegStatus()
Returns the status of the registry as an Item hierarchy of elements.

Returns:
Item of registered actors.

assignedUpdate

private RequestResult assignedUpdate(RequestPars rp)
Updates the local assigned address registry, and returns a Hashtable containing those addresses the sender did not have in its request.

Parameters:
rp - TAPAS-style request parameter
Returns:
TAPAS-style result

forwardUpdate

private RequestResult forwardUpdate(RequestPars rp)
Updates the local forward address registry, and returns a Hashtable containing those addresses the sender did not have in its request.

Parameters:
rp - TAPAS-style request parameter
Returns:
TAPAS-style result

performAssignedUpdate

private void performAssignedUpdate()
Performs an assigned address update to all registered nodes.


performForwardUpdate

private void performForwardUpdate()
Performs an forward address update to all registered nodes.


performAddressUpdate

private java.util.Hashtable performAddressUpdate(java.lang.String syncType,
                                                 java.util.Hashtable reg)
Performs update on an address registry by sending requests to all registered MM nodes.

Parameters:
syncType - The type of synchronization: ASSIGNED_UPDATE or FORWARD_UPDATE.
reg - The registry to be updated.
Returns:
The updated address registry.

performActorUpdate

private RequestResult performActorUpdate(RequestPars pRP)
Relays a request to all the registered MM's in the network.


addressUpdate

private RequestResult addressUpdate(RequestPars rp,
                                    java.util.Hashtable reg)
Performs a update on a address registry by comparing addresses received from foreign MM by locally registered ones and add those that are missing locally.

Parameters:
rp - TAPAS-syle request parameters.
reg - The address registry to perform update on.
Returns:
TAPAS-style request result.

assignedIPCheck

private java.util.Vector assignedIPCheck(java.util.Vector v)
                                  throws java.lang.Exception
Method to check whether an assigned ip is already registered, both locally and all registered MM's.

Parameters:
v - Vector containing all ip's to be checked.
Returns:
A vector containing those ip's that caused a conflict.
java.lang.Exception

getAssignedIPs

private java.util.Vector getAssignedIPs()
Method to fetch all the assigned IP's registered at this node

Returns:
A vector containig the registered IP's

clearForward

private void clearForward(java.lang.String sNode)
Removes ALL forward references for a certain node (when node is shut down).

Parameters:
sNode - The node-reference to be removed.

getAssignedNodeID

private java.lang.String getAssignedNodeID(java.lang.String sNode)
Locates an assigned node's node-ID based on it's node address.

Parameters:
sNode - The node's address.
Returns:
The node's ID.

getForwardNodeID

private java.lang.String getForwardNodeID(java.lang.String sNode)
Locates a forward node's node-ID based on it's node address.

Parameters:
sNode - The node's address.
Returns:
The node's ID.

printHT

private void printHT(java.lang.String heading,
                     java.util.Hashtable ht)
Method to print the contents of a Hashtable consisting of :Vector(string)

Parameters:
heading - The heading of the print out
ht - The hashtable to be printed

getMMNodesID

private java.util.Hashtable getMMNodesID()
                                  throws java.lang.Exception
Method to return a Hashtable of MM nodes[id, mmGAI].

Returns:
A Hashtable containing the MM nodes.
java.lang.Exception

getMMNode

private java.lang.String getMMNode(java.lang.String id)
Finds the id of the current managing node of a moved node.

Returns:
The id of the current managing node of the moved node.


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.