gov.nist.antd.merlin.protocol.discovery
Class OptNeighbour

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--gov.nist.antd.merlin.util.AbstractAddDropConfigurator
              |
              +--gov.nist.antd.merlin.util.AutoConfigCtrl
                    |
                    +--gov.nist.antd.merlin.protocol.discovery.OptNeighbour
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable, DMLDump

public class OptNeighbour
extends AutoConfigCtrl

This class implements a neighbour discovery.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil

Field Summary
 java.util.Vector messages
          The vector that contains the message forwarded.
static java.lang.String SESSION_NAME
          The name (oxcswitch) of this protocolsession in the network.
 NeighbourTable table
          The neighbor table
 
Fields inherited from class gov.nist.antd.merlin.util.AbstractAddDropConfigurator
addLambdaIDs, addLambdas, dropLambdaIDs, dropLambdas
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
OptNeighbour()
          Default constructor.
 
Method Summary
 void addIDRESP(OpticalFrameHeader message)
          Add an entry in the neighbours table.
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configuration
 void forwardIDRESP(OpticalFrameHeader message)
          Forward an IDRESP to all neighbours.
 void init()
          Initialization routine, called by the ProtocolGraph after instantiation.
 boolean isInVector(NeighbourHeader message)
          check if the message is in the vector of messages
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Push method to send and receive messages.
 void sendIDRESP(OpticalFrameHeader message)
          Send an IDRESP to all neighbours.
 void sendIDSIG()
          Neighbour discovery after the init or after a node is recovered.
 
Methods inherited from class gov.nist.antd.merlin.util.AutoConfigCtrl
 
Methods inherited from class gov.nist.antd.merlin.util.AbstractAddDropConfigurator
configAddDrop, getAddLambdaIDs, getAddLambdas, getDropLambdaIDs, getDropLambdas, setAddLambdas, setDropLambdas, toDML
 
Methods inherited from class SSF.OS.ProtocolSession
close, closed, debugIdentifier, inGraph, open, opened, pushAfterDelay, pushAfterDelayFailed, setGraph, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_NAME

public static final java.lang.String SESSION_NAME
The name (oxcswitch) of this protocolsession in the network.

See Also:
Constant Field Values

table

public NeighbourTable table
The neighbor table


messages

public java.util.Vector messages
The vector that contains the message forwarded.

Constructor Detail

OptNeighbour

public OptNeighbour()
Default constructor.

Method Detail

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configuration

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class AutoConfigCtrl
Parameters:
cfg - The DML configuration
Throws:
if - a configuration error occurs
com.renesys.raceway.DML.configException - if a configuration error occured

init

public void init()
          throws ProtocolException
Initialization routine, called by the ProtocolGraph after instantiation. The order of initialization of a set of protocols is unspecified, so other methods (like open()) may be called before init(). Resources (like connection tables) that may be needed by open() should therefore be created in the ProtocolSession constructor.

Overrides:
init in class AutoConfigCtrl
Throws:
ProtocolException - if an error occured

push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
Push method to send and receive messages.

Specified by:
push in class AutoConfigCtrl
Parameters:
message - The message received.
fromSession - The protocol session which sent the message.
Returns:
True if the message is pushed. False if it is dropped.
Throws:
ProtocolException - If a protocol session exception occurs.

sendIDSIG

public void sendIDSIG()
Neighbour discovery after the init or after a node is recovered. Send an IDSIG through the fibers.


sendIDRESP

public void sendIDRESP(OpticalFrameHeader message)
Send an IDRESP to all neighbours.

Parameters:
message - The IDSIG received

addIDRESP

public void addIDRESP(OpticalFrameHeader message)
Add an entry in the neighbours table.

Parameters:
message - The IDRESP received

forwardIDRESP

public void forwardIDRESP(OpticalFrameHeader message)
Forward an IDRESP to all neighbours.

Parameters:
message - The IDSIG received

isInVector

public boolean isInVector(NeighbourHeader message)
check if the message is in the vector of messages

Parameters:
message - The message to test if already treated.
Returns:
True if message already treated.