gov.nist.antd.optical.event.monitor
Class TEventObject

java.lang.Object
  |
  +--gov.nist.antd.optical.event.monitor.TEventObject
All Implemented Interfaces:
java.io.Serializable

public class TEventObject
extends java.lang.Object
implements java.io.Serializable

This class represents the event handler of the SSF optical framework.

 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
See Also:
Serialized Form

Field Summary
static short ALL
          ALL event value 0xFF.
static short CHANGE
          CHANGE event value 0x02.
static short CONFIG
          CONFIG event value 0x10.
static short CREATE
          CREATE event value 0x01.
static short DELETE
          DELETE event value 0x04.
static short ERROR
          ERROR event value 0x08.
static short FAILURE
          CONFIG event value 0x20.
private  ProtocolGraph graph
          The protocolgraph that controls the timer event.
private  long id
          The id of the event.
private  java.lang.Object message
          The message of the event (transient).
static short NONE
          NONE event value 0x00.
private  java.lang.Object source
          The source of the event (transient).
private  long timeStamp
          the timestamp of the event in milli seconds.
private  short type
          The type of event.
static short USER
          USER event value 0x80.
 
Constructor Summary
TEventObject(long id, short type, long timeStamp, java.lang.Object source, java.lang.Object message)
          Creates an event object with timestamp.
TEventObject(long id, short type, java.lang.Object source, java.lang.Object message)
          Creates an event object without timestamp.
TEventObject(ProtocolGraph graph, long id, short type, long timeStamp, java.lang.Object source, java.lang.Object message)
          Creates an event object with timestamp and protocol graph.
 
Method Summary
 java.lang.String dump()
          Creates the dump string of the event.
 ProtocolGraph getGraph()
          Returns the graph where the timer has to be installed on or null.
 long getId()
          Returns the events id.
 java.lang.Object getMessage()
          Returns the message.
 java.lang.Object getSource()
          Returns the source.
 long getTimeStamp()
          Returns the timestamp of the event.
 short getType()
          Returns the type.
protected  void setGraph(ProtocolGraph newGraph)
          Set the graph where the timer will be installed on.
protected  void setId(long newID)
          Set the ID of the event.
protected  void setMessage(java.lang.Object theMessage)
          Set the events message.
protected  void setSource(java.lang.Object theSource)
          Set the source of the event.
protected  void setTimeStamp(long theTimestamp)
          Set the timestamp of the event.
protected  void setType(short theType)
          Set the type of the message.
 java.lang.String toString()
          Creates the information string of the event.
static java.lang.String typeString(short type)
          Translates the type into a text string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final short NONE
NONE event value 0x00.

See Also:
Constant Field Values

CREATE

public static final short CREATE
CREATE event value 0x01.

See Also:
Constant Field Values

CHANGE

public static final short CHANGE
CHANGE event value 0x02.

See Also:
Constant Field Values

DELETE

public static final short DELETE
DELETE event value 0x04.

See Also:
Constant Field Values

ERROR

public static final short ERROR
ERROR event value 0x08.

See Also:
Constant Field Values

FAILURE

public static final short FAILURE
CONFIG event value 0x20.

See Also:
Constant Field Values

CONFIG

public static final short CONFIG
CONFIG event value 0x10.

See Also:
Constant Field Values

USER

public static final short USER
USER event value 0x80.

See Also:
Constant Field Values

ALL

public static final short ALL
ALL event value 0xFF.

See Also:
Constant Field Values

id

private long id
The id of the event.


type

private short type
The type of event. Concatenation possible.


timeStamp

private long timeStamp
the timestamp of the event in milli seconds.


source

private transient java.lang.Object source
The source of the event (transient). Normally the originator.


message

private transient java.lang.Object message
The message of the event (transient). For example the changed component.


graph

private transient ProtocolGraph graph
The protocolgraph that controls the timer event.

Constructor Detail

TEventObject

public TEventObject(long id,
                    short type,
                    java.lang.Object source,
                    java.lang.Object message)
Creates an event object without timestamp.

Parameters:
id - the ID of the event.
type - the type of the event.
source - the source of the event.
message - the events message.

TEventObject

public TEventObject(long id,
                    short type,
                    long timeStamp,
                    java.lang.Object source,
                    java.lang.Object message)
Creates an event object with timestamp.

Parameters:
id - the ID of the event.
type - the type of the event.
timeStamp - the timeStamp of the message.
source - the source of the event.
message - the events message.

TEventObject

public TEventObject(ProtocolGraph graph,
                    long id,
                    short type,
                    long timeStamp,
                    java.lang.Object source,
                    java.lang.Object message)
Creates an event object with timestamp and protocol graph.

Parameters:
graph - the ProtocolGraph the event will be processed on.
id - the ID of the event.
type - the type of the event.
timeStamp - the timeStamp of the message.
source - the source of the event.
message - the events message.
Since:
1.2
Method Detail

setGraph

protected void setGraph(ProtocolGraph newGraph)
Set the graph where the timer will be installed on.

Parameters:
newGraph - The ProtocolGraph of this event or null.
Since:
1.2

setType

protected void setType(short theType)
Set the type of the message.

Parameters:
theType - the type of the message.

setSource

protected void setSource(java.lang.Object theSource)
Set the source of the event.

Parameters:
theSource - The Object that generates the event.

setMessage

protected void setMessage(java.lang.Object theMessage)
Set the events message.

Parameters:
theMessage - The message of the event.

setTimeStamp

protected void setTimeStamp(long theTimestamp)
Set the timestamp of the event.

Parameters:
theTimestamp - the time in milliseconds.

setId

protected void setId(long newID)
Set the ID of the event.

Parameters:
newID - the id of the event.

getGraph

public ProtocolGraph getGraph()
Returns the graph where the timer has to be installed on or null.

Returns:
Return the graph of the event or null.
Since:
1.2

getSource

public java.lang.Object getSource()
Returns the source.

Returns:
Return the source of the event.

getTimeStamp

public long getTimeStamp()
Returns the timestamp of the event.

Returns:
Return the timestamp of the event.

getMessage

public java.lang.Object getMessage()
Returns the message.

Returns:
Return the message of the event.

getId

public long getId()
Returns the events id.

Returns:
Return the id of the event.

getType

public short getType()
Returns the type.

Returns:
Return the type of the event.

dump

public java.lang.String dump()
Creates the dump string of the event.

Returns:
The dump string.

toString

public java.lang.String toString()
Creates the information string of the event.

Overrides:
toString in class java.lang.Object
Returns:
The information string.

typeString

public static final java.lang.String typeString(short type)
Translates the type into a text string.

Parameters:
type - The type that has to be translated. The possible types are defined in this class.
Returns:
the String that represents the type. If the type i sunknown the will be "UNKNOWN" too.