gov.nist.antd.merlin.generator.event
Class TopologyManipulator

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--gov.nist.antd.merlin.generator.event.TopologyManipulator
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable, DMLDump

public class TopologyManipulator
extends ProtocolSession
implements DMLDump

This protocolSession is used to manipulate the topolgy of a node or the attached links.

 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
static byte CONVERTER
          Constante to change the convertion capability.
static byte DELAY
          Constante to change the delay of an optical link
static byte DISTANCE
          Constante to change the distance of an optical link
static byte FAILURE
          Constante to change the failure attribute in OXCEdgeRouter, OXC, link fiber or lambda.
 EventGenerator generator
          The EventGenerator attached to this Manipulator
static byte NO_ACTION
          Constante for doing nothing
static byte NO_CONVERTERS
          Constante to change the number of converters.
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
TopologyManipulator()
          Default constructor
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure this ProtocolSession.
 boolean createEvent(EventParameter event)
          Create an event according to the parameter.
 void execute(EventParameter event)
          Execute the action associated to the given event
 EventGenerator getGenerator()
          Return the EventGenerator.
 void init()
          Initialise the event generator
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          This ProtocolSession is unable to send or receive messages.
 void setGenerator(EventGenerator generator)
          Set the EventGenerator.
 java.lang.String toDML()
          This method generates the DML representation of this class.
 
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

NO_ACTION

public static final byte NO_ACTION
Constante for doing nothing

See Also:
Constant Field Values

FAILURE

public static final byte FAILURE
Constante to change the failure attribute in OXCEdgeRouter, OXC, link fiber or lambda.

See Also:
Constant Field Values

CONVERTER

public static final byte CONVERTER
Constante to change the convertion capability. Only for OXCEdgeRouter and OXC.

See Also:
Constant Field Values

NO_CONVERTERS

public static final byte NO_CONVERTERS
Constante to change the number of converters. Only for OXCEdgeRouter and OXC.

See Also:
Constant Field Values

DISTANCE

public static final byte DISTANCE
Constante to change the distance of an optical link

See Also:
Constant Field Values

DELAY

public static final byte DELAY
Constante to change the delay of an optical link

See Also:
Constant Field Values

generator

public EventGenerator generator
The EventGenerator attached to this Manipulator

Constructor Detail

TopologyManipulator

public TopologyManipulator()
Default constructor

Method Detail

config

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

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

init

public void init()
          throws ProtocolException
Initialise the event generator

Overrides:
init in class ProtocolSession
Throws:
ProtocolException - when a protocol error occured in the generator

push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
This ProtocolSession is unable to send or receive messages.

Specified by:
push in class ProtocolSession
Parameters:
message - The message received.
fromSession - The ProtocolSession that pushed the message.
Returns:
true if the message is sent (here never).
Throws:
ProtocolException - when a protocol error occured

createEvent

public boolean createEvent(EventParameter event)
Create an event according to the parameter. Check if the parameters are correct.

Parameters:
event - The parameter for the event
Returns:
True if the event is created

execute

public void execute(EventParameter event)
Execute the action associated to the given event

Parameters:
event - The event to execute

setGenerator

public void setGenerator(EventGenerator generator)
Set the EventGenerator.

Parameters:
generator - The EventGenerator.

getGenerator

public EventGenerator getGenerator()
Return the EventGenerator.

Returns:
The EventGenerator.

toDML

public java.lang.String toDML()
This method generates the DML representation of this class.

Specified by:
toDML in interface DMLDump
Returns:
The DML configuration as String