gov.nist.antd.ssf.event
Class EventMessage

java.lang.Object
  |
  +--gov.nist.antd.ssf.event.EventMessage
Direct Known Subclasses:
AlarmMessage, ErrorMessage, InfoMessage

public abstract class EventMessage
extends java.lang.Object

This class indicates the type of message passed between components. This class must be subclassed before it can be instantiated.
The class contains two internal attributes,
1. Object data : The data contains the message of the event. The message can be an instance of Lambda, Fiber, Link, ONIC, or somethink else the receiver is able to process.
2. long delay : The delay from the moment on the delay was set to the moment the message will be processed. After the message was processed the delay has to be resetted to zero or a new delay for the next processing entity must be set. The delay has to be implemented by the processing entity.

 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 data
          The data the message contains.
private  long delay
          The Delay in seconds.
private  java.lang.Object origin
          The originator of the message.
 
Constructor Summary
protected EventMessage(java.lang.Object origin, java.lang.Object data)
          Creates an instance of the EventMessage.
 
Method Summary
 java.lang.Object getData()
          Returns the data stored in this message.
 long getDelay()
          Returns the delay in simulation ticks.
 double getDelaySeconds()
          Returns the delay in seconds.
 java.lang.Object getOrigin()
          Returns the origin / creator stored in this message.
protected  void setData(java.lang.Object newData)
          Method to set the data.
 void setDelay(long newDelay)
          Set the delay in simulation ticks.
 void setDelaySeconds(double newDelay)
          Set the delay in seconds.
protected  void setOrigin(java.lang.Object newOrigin)
          Method to set the origin / creator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

origin

private java.lang.Object origin
The originator of the message.


data

private java.lang.Object data
The data the message contains.


delay

private long delay
The Delay in seconds.

Constructor Detail

EventMessage

protected EventMessage(java.lang.Object origin,
                       java.lang.Object data)
                throws java.lang.NullPointerException
Creates an instance of the EventMessage. The originator

Parameters:
origin - The creater / originator of the message.
data - The data of this event message.
Throws:
java.lang.NullPointerException - if the origin is null.
Method Detail

setOrigin

protected void setOrigin(java.lang.Object newOrigin)
                  throws java.lang.NullPointerException
Method to set the origin / creator.

Throws:
java.lang.NullPointerException - if the origin is null.

getOrigin

public java.lang.Object getOrigin()
Returns the origin / creator stored in this message.

Returns:
The origin / creator.

setData

protected void setData(java.lang.Object newData)
                throws java.lang.NullPointerException
Method to set the data.

Parameters:
newData - the data of this message.
Throws:
java.lang.NullPointerException - if the data object is null

getData

public java.lang.Object getData()
Returns the data stored in this message.

Returns:
The data Object.

setDelaySeconds

public void setDelaySeconds(double newDelay)
Set the delay in seconds. Internally the delay will be stored in simulation ticks. the ticks will be calculated by SSF.Net.Net.seconds (double)

Parameters:
newDelay - The delay in seconds.
Since:
1.1

getDelaySeconds

public double getDelaySeconds()
Returns the delay in seconds.

Returns:
The delay in seconds.
Since:
1.1

setDelay

public void setDelay(long newDelay)
Set the delay in simulation ticks.

Parameters:
newDelay - The delay in simulation ticks.
Since:
1.1

getDelay

public long getDelay()
Returns the delay in simulation ticks.

Returns:
The delay in Simulation ticks.
Since:
1.1