gov.nist.antd.ssf.event.script
Class ScriptEvent

java.lang.Object
  |
  +--gov.nist.antd.ssf.event.script.ScriptEvent
All Implemented Interfaces:
DMLDump
Direct Known Subclasses:
DefaultFiberEvent, DefaultLambdaEvent, DefaultLinkEvent, DefaultNodeEvent, DefaultONICEvent

public abstract class ScriptEvent
extends java.lang.Object
implements DMLDump

This abstract class is used as model for event that can be scripted from the DML file.

 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
private  java.lang.Object actionValue
          Object that contains the value for modification
private  java.lang.Object info
          The object related to this event OXCEdgeRouter, OXC, ID, vector...
private  EventManager manager
          The event manager that create this object
static byte NOACTION
          constant value to specify that no action are specified.
private  long time
          The time when the event must occur
private  Timer timer
          The timer associated to this event
private  byte type
          Define the type of action to do.
 
Constructor Summary
ScriptEvent()
          Default constructor
 
Method Summary
 void cancel()
          Cancel this event
 void config(EventManager manager, Glass net, com.renesys.raceway.DML.Configuration cfg)
          Configure the event from de DML file
abstract  void execute()
          Method called when the event is fired
 java.lang.Object getActionValue()
          Get the action value
 EventManager getEventManager()
          Get the event manager
 java.lang.Object getInfo()
          Get the object manipulated by the event
 long getTime()
          Get the launch time for the event
 byte getType()
          Get the action type
 void init()
          Create and initialise the timer
 void setActionValue(java.lang.Object value)
          Define the action value
protected  void setEventManager(EventManager manager)
          Defines the event manager
 void setInfo(java.lang.Object obj)
          Set the object manipulated by the event
 void setTime(long time)
          Set the launch time for the event
protected  void setType(byte type)
          Define the action type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nist.antd.optical.dml.DMLDump
toDML
 

Field Detail

NOACTION

public static final byte NOACTION
constant value to specify that no action are specified.

See Also:
Constant Field Values

time

private long time
The time when the event must occur


info

private java.lang.Object info
The object related to this event OXCEdgeRouter, OXC, ID, vector...


manager

private EventManager manager
The event manager that create this object


type

private byte type
Define the type of action to do. Default = no action


actionValue

private java.lang.Object actionValue
Object that contains the value for modification


timer

private Timer timer
The timer associated to this event

Constructor Detail

ScriptEvent

public ScriptEvent()
Default constructor

Method Detail

config

public void config(EventManager manager,
                   Glass net,
                   com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configure the event from de DML file

Parameters:
manager - The manager of this event.
net - The OpNet that contains the topology
cfg - The DML configuration
Throws:
com.renesys.raceway.DML.configException - if a configuration error occurs

init

public void init()
Create and initialise the timer


cancel

public void cancel()
Cancel this event


setTime

public void setTime(long time)
             throws com.renesys.raceway.DML.configException
Set the launch time for the event

Parameters:
time - The starting time of the event
Throws:
com.renesys.raceway.DML.configException - if value < 0

getTime

public long getTime()
Get the launch time for the event

Returns:
The starting time of the event

setInfo

public void setInfo(java.lang.Object obj)
Set the object manipulated by the event

Parameters:
obj - The object manipulated by the event

getInfo

public java.lang.Object getInfo()
Get the object manipulated by the event

Returns:
the object manipulated by the event

setType

protected void setType(byte type)
Define the action type

Parameters:
type - The action type.

getType

public byte getType()
Get the action type

Returns:
The action type.

setActionValue

public void setActionValue(java.lang.Object value)
Define the action value

Parameters:
value - The value to set by the action.

getActionValue

public java.lang.Object getActionValue()
Get the action value

Returns:
The action value.

setEventManager

protected void setEventManager(EventManager manager)
Defines the event manager

Parameters:
manager - The event manager.

getEventManager

public EventManager getEventManager()
Get the event manager

Returns:
The event manager.

execute

public abstract void execute()
Method called when the event is fired