gov.nist.antd.merlin.protocol.signaling
Class DynRecovery.OXCHashTable

java.lang.Object
  |
  +--gov.nist.antd.merlin.protocol.signaling.DynRecovery.OXCHashTable
Enclosing class:
DynRecovery

protected class DynRecovery.OXCHashTable
extends java.lang.Object


Field Summary
private  java.util.Hashtable answeredOXCs
          The table of OXC that have (or not) answered to the SET_PATH message by an OXC_DONE message.
 
Constructor Summary
DynRecovery.OXCHashTable()
          OXCHashTable default constructor
 
Method Summary
private  boolean allOXCs_answered(DynRecoveryHeader dynRecoveryHeader)
          allOXCs_answered for a backup route (given by the DynRecoveryHeader), check if all OXCshave send their OXC_DONE message.
private  boolean emptyOXCsHashT(DynRecoveryHeader dynRecoveryHeader)
          emptyOXCsHashT
private  int getIndex(java.util.Vector v, int value)
          getIndex this method is used by markAnsweredOXCs to retrieve the index of an OXC in one entry of the answeredOXCs hashtables the vector v given has argument is the value stored in the hashtable
private  java.lang.Integer getRouteEntry(int key)
          getIntKey method used by allOXCs_answered to retrieve a key in the answeredOXCS hashtable
private  void initOXCsHashT(DynRecoveryHeader dynRecoveryHeader)
          initOXCsHashT adds a new entry in the answeredOXCs hashtable the key is the route ID the value is the vector of OXCswitches IDs along the route
private  void markAnsweredOXCs(DynRecoveryHeader dynRecoveryHeader)
          markAnsweredOXCs replace the OXC ID by -1 in the corresponding route stored in anweredOXCs
private  boolean noOXCsHashT(DynRecoveryHeader dynRecoveryHeader)
          noOXCsHashT
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

answeredOXCs

private java.util.Hashtable answeredOXCs
The table of OXC that have (or not) answered to the SET_PATH message by an OXC_DONE message. each entry in the hashtable is route ID (new Integer (routeID)) each value in the hashtable is a Vector or Integers representing OXCs IDs

Constructor Detail

DynRecovery.OXCHashTable

public DynRecovery.OXCHashTable()
OXCHashTable default constructor

Method Detail

getRouteEntry

private java.lang.Integer getRouteEntry(int key)
getIntKey method used by allOXCs_answered to retrieve a key in the answeredOXCS hashtable

Parameters:
key - the routeID you are looking for in the answeredOXCs Hashtable
Returns:
the instance of the Integer whose integer value equals key.

allOXCs_answered

private boolean allOXCs_answered(DynRecoveryHeader dynRecoveryHeader)
allOXCs_answered for a backup route (given by the DynRecoveryHeader), check if all OXCshave send their OXC_DONE message. This method is only called in source node for the given route.

Parameters:
dynRecoveryHeader - used to retrive the routeID
Returns:
true if all OXCs on the backup route have answered to the source node

initOXCsHashT

private void initOXCsHashT(DynRecoveryHeader dynRecoveryHeader)
initOXCsHashT adds a new entry in the answeredOXCs hashtable the key is the route ID the value is the vector of OXCswitches IDs along the route

Parameters:
dynRecoveryHeader - used to retrieve the routeID, and make a new entry in answeredOXCs

getIndex

private int getIndex(java.util.Vector v,
                     int value)
getIndex this method is used by markAnsweredOXCs to retrieve the index of an OXC in one entry of the answeredOXCs hashtables the vector v given has argument is the value stored in the hashtable

Parameters:
v - a vector of Integers
value - the integer value you are looking for in v
Returns:
the index of the element of value "value" in the int vector v (-1 if not found)

markAnsweredOXCs

private void markAnsweredOXCs(DynRecoveryHeader dynRecoveryHeader)
markAnsweredOXCs replace the OXC ID by -1 in the corresponding route stored in anweredOXCs

Parameters:
dynRecoveryHeader - used to retrive the routeID and the OXC ID to mark it in answeredOXCs

emptyOXCsHashT

private boolean emptyOXCsHashT(DynRecoveryHeader dynRecoveryHeader)
emptyOXCsHashT

Parameters:
dynRecoveryHeader - used to retrive routeID
Returns:
true if the hashtable entry corresponding to this route does NOT cotain any node else return false.

noOXCsHashT

private boolean noOXCsHashT(DynRecoveryHeader dynRecoveryHeader)
noOXCsHashT

Parameters:
dynRecoveryHeader - used to retrive routeID
Returns:
true if the hashtable entry corresponding to this route does NOT exist yet else return false.