public class TEventEntry extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TEventEntry.TLogLevel
defines the type of log entry to send
|
static interface |
TEventEntry.TOnBuffer
Override dispatch to implement a buffer event handler
|
static interface |
TEventEntry.TOnChangeFederation
Override dispatch to implement a federation change handler
|
static interface |
TEventEntry.TOnChangeObject
Override dispatch to implement a change object event handler
|
static interface |
TEventEntry.TOnChangeObjectData
Override dispatch to implement a change object data event handler
|
static interface |
TEventEntry.TOnChildEvent
Override dispatch to implement a handler for hub child event creation events
|
static interface |
TEventEntry.TOnFocus
Override dispatch to implement a focus event handler
|
static interface |
TEventEntry.TOnNormalEvent
Override dispatch to implement a normal event handler
|
static interface |
TEventEntry.TOnOtherEvent
Override dispatch to implement a event handler for non-standard events
|
static interface |
TEventEntry.TOnStreamCreate
Override dispatch to implement a handler of received streams, creating the local stream
|
static interface |
TEventEntry.TOnStreamEnd
Override dispatch to implement a handler of received streams, action on end of stream
|
static interface |
TEventEntry.TOnSubAndPubEvent |
static interface |
TEventEntry.TOnTimerCmd
Override dispatch to implement a timer command handler for commands reset/start/stop
|
static interface |
TEventEntry.TOnTimerTick
Override dispatch to implement a timer tick handler
|
Modifier and Type | Field and Description |
---|---|
static int |
ACTION_CHANGE
signal an object change: an existing object has changed
|
static int |
ACTION_DELETE
signal an object change: an object is deleted
|
static int |
ACTION_NEW
signal an object change: a new object is created
|
static int |
EK_BUFFER
event kind: buffer event
|
static int |
EK_CHANGE_OBJECT_DATA_EVENT
event kind: change object including changed data
|
static int |
EK_CHANGE_OBJECT_EVENT
event kind: change object
|
static int |
EK_CHILD_EVENT_ADD
event kind: a child event was created
|
static int |
EK_CHILD_EVENT_REMOVE
event kind: a child event was removed
|
static int |
EK_LOG_WRITELN
event kind: send a line to the log
|
static int |
EK_NORMAL_EVENT
event kind: normal event
|
static int |
EK_STREAM_BODY
event kind: body of a stream
|
static int |
EK_STREAM_HEADER
event kind: header of a stream
|
static int |
EK_STREAM_TAIL
event kind: end of a stream
|
static int |
EK_TIMER_ACKNOWLEDGE
event kind: acknowledge timer tick
|
static int |
EK_TIMER_ACKNOWLEDGE_LIST_ADD
event kind: add client to the acknowledge list of a timer
|
static int |
EK_TIMER_ACKNOWLEDGE_LIST_REMOVE
event kind: remove client from the acknowledge list of a timer
|
static int |
EK_TIMER_CANCEL
event kind: cancel/remove a running timer
|
static int |
EK_TIMER_PREPARE
event kind: reset a timer
|
static int |
EK_TIMER_SET_SPEED
event kind: set the relative speed of the timer
|
static int |
EK_TIMER_START
event kind: start or continue a timer
|
static int |
EK_TIMER_STATUS_REQUEST
event kind: request status update of a timer
|
static int |
EK_TIMER_STOP
event kind: stop a running timer
|
static int |
EK_TIMER_TICK
event kind: timer tick
|
(package private) String |
feventName |
(package private) TEventEntry |
fparent |
(package private) static int |
IC_ALL_VARIABLES |
(package private) static int |
IC_CREATE_TIMER |
(package private) static int |
IC_END_OF_SESSION |
(package private) static int |
IC_EVENT |
(package private) static int |
IC_EVENT_NAMES |
(package private) static int |
IC_HUB_FOUND |
(package private) static int |
IC_HUB_LOCATE |
(package private) static int |
IC_INVALID_COMMAND |
(package private) static int |
IC_PUBLISH |
(package private) static int |
IC_REQUEST_EVENT_NAMES |
(package private) static int |
IC_SET_CLIENT_INFO |
(package private) static int |
IC_SET_EVENT_ID_TRANSLATION |
(package private) static int |
IC_SET_STATE |
(package private) static int |
IC_SET_THROTTLE |
(package private) static int |
IC_SET_VARIABLE |
(package private) static int |
IC_SET_VARIABLE_PREFIXED |
(package private) static int |
IC_SUBSCRIBE |
(package private) static int |
IC_UNIQUE_CLIENT_ID |
(package private) static int |
IC_UNPUBLISH |
(package private) static int |
IC_UNSUBSCRIBE |
int |
ID
The local ID related to this event
|
TEventEntry.TOnBuffer |
onBuffer
Handler to be called on receive of a buffer event
|
TEventEntry.TOnChangeFederation |
onChangeFederation
Handler to be called on receive of a federation change event
|
TEventEntry.TOnChangeObject |
onChangeObject
Handler to be called on receive of a change object event
|
TEventEntry.TOnChangeObjectData |
onChangeObjectData
Handler to be called on receive of a change object with data event
|
TEventEntry.TOnChildEvent |
onChildEvent
Handler to be called on receive of a child add/remove event
|
TEventEntry.TOnFocus |
onFocus
Handler to be called on receive of a focus event
|
TEventEntry.TOnNormalEvent |
onNormalEvent
Handler to be called on receive of a normal event
|
TEventEntry.TOnOtherEvent |
onOtherEvent
Handler to be called on receive of an unhandled event
|
TEventEntry.TOnStreamCreate |
onStreamCreate
Handler to be called on receive of a stream header event
|
TEventEntry.TOnStreamEnd |
onStreamEnd
Handler to be called on receive of a stream tail event
|
TEventEntry.TOnSubAndPubEvent |
onSubAndPub |
TEventEntry.TOnTimerCmd |
onTimerCmd
Handler to be called on receive of a timer command reset/start/stop
|
TEventEntry.TOnTimerTick |
onTimerTick
Handler to be called on receive of a timer tick event
|
static int |
TRC_INFINITE
no limit on the number of timer events to send
|
Constructor and Description |
---|
TEventEntry(TConnection aConnection,
int aID,
String aEventName) |
Modifier and Type | Method and Description |
---|---|
void |
copyHandlersFrom(TEventEntry aEventEntry) |
String |
getEventName()
Returns the fully qualified name of this event
|
String |
getShortEventName() |
(package private) void |
handleEvent(TByteBuffer aPayload) |
(package private) void |
handleSubAndPub(int aCommand) |
(package private) boolean |
isEmpty() |
boolean |
isPublished()
Returns true if this event is published
|
boolean |
isSubscribed()
Returns true if this event is subscribed
|
int |
logWriteLn(String aLine,
TEventEntry.TLogLevel aLevel)
Send a line to the central framework log
|
(package private) void |
publish() |
boolean |
publishers() |
int |
signalBuffer(int aBufferID,
byte[] aBuffer)
Send a buffer event to the framework
|
int |
signalBuffer(int aBufferID,
byte[] aBuffer,
int aEventFlags)
Send a buffer event to the framework
|
int |
signalChangeObject(int aAction,
int aObjectID,
String aAttribute)
Send a change object event to the framework
|
int |
signalEvent(int aEventKind,
byte[] aEventPayload)
Send an event to the framework
|
int |
signalStream(String aStreamName,
InputStream aStream)
Send a stream to the framework
|
(package private) void |
subscribe() |
boolean |
subscribers() |
int |
timerAcknowledge(String aTimerName,
String aClientName,
int aProposedTimeStep)
Acknowledge a timer tick.
All clients on the timer acknowledge list must send an acknowledge on each timer tick for the timer to advance. |
int |
timerAcknowledgeAdd(String aTimerName,
String aClientName)
Add a client name to the acknowledge list of a timer.
All entries in this list must send an acknowledge on each timer tick for the timer to advance. |
int |
timerAcknowledgeRemove(String aTimerName,
String aClientName)
Remove a client name from the acknowledge list of a timer.
All entries in this list must send an acknowledge on each timer tick for the timer to advance. |
int |
timerCancel(String aTimerName)
Cancel a running timer; the timer is destroyed.
|
int |
timerCreate(String aTimerName,
long aStartTimeUTCorRelFT,
int aResolutionms,
double aSpeedFactor)
Create a timer on the connected HUB
|
int |
timerCreate(String aTimerName,
long aStartTimeUTCorRelFT,
int aResolutionms,
double aSpeedFactor,
int aRepeatCount)
Create a timer on the connected HUB
|
int |
timerPrepare(String aTimerName)
Prepare a timer; the timer is stopped and reset to an initial state
|
int |
timerSetSpeed(String aTimerName,
double aSpeedFactor)
Set the relative running speed of the timer
|
int |
timerStart(String aTimerName)
Start or continue the timer
|
int |
timerStop(String aTimerName)
Stop or pause the timer
|
(package private) void |
unPublish(boolean aChangeLocalState) |
(package private) void |
unSubscribe(boolean aChangeLocalState) |
static final int IC_INVALID_COMMAND
static final int IC_END_OF_SESSION
static final int IC_UNIQUE_CLIENT_ID
static final int IC_EVENT
static final int IC_SET_CLIENT_INFO
static final int IC_SET_VARIABLE
static final int IC_ALL_VARIABLES
static final int IC_SET_STATE
static final int IC_SET_THROTTLE
static final int IC_SET_VARIABLE_PREFIXED
static final int IC_REQUEST_EVENT_NAMES
static final int IC_EVENT_NAMES
static final int IC_SUBSCRIBE
static final int IC_UNSUBSCRIBE
static final int IC_PUBLISH
static final int IC_UNPUBLISH
static final int IC_SET_EVENT_ID_TRANSLATION
static final int IC_CREATE_TIMER
static final int IC_HUB_LOCATE
static final int IC_HUB_FOUND
public static final int EK_CHANGE_OBJECT_EVENT
public static final int EK_STREAM_HEADER
public static final int EK_STREAM_BODY
public static final int EK_STREAM_TAIL
public static final int EK_BUFFER
public static final int EK_NORMAL_EVENT
public static final int EK_CHANGE_OBJECT_DATA_EVENT
public static final int EK_CHILD_EVENT_ADD
public static final int EK_CHILD_EVENT_REMOVE
public static final int EK_LOG_WRITELN
public static final int EK_TIMER_CANCEL
public static final int EK_TIMER_PREPARE
public static final int EK_TIMER_START
public static final int EK_TIMER_STOP
public static final int EK_TIMER_ACKNOWLEDGE_LIST_ADD
public static final int EK_TIMER_ACKNOWLEDGE_LIST_REMOVE
public static final int EK_TIMER_SET_SPEED
public static final int EK_TIMER_TICK
public static final int EK_TIMER_ACKNOWLEDGE
public static final int EK_TIMER_STATUS_REQUEST
public static final int TRC_INFINITE
String feventName
TEventEntry fparent
public final int ID
public TEventEntry.TOnChangeObject onChangeObject
public TEventEntry.TOnFocus onFocus
public TEventEntry.TOnNormalEvent onNormalEvent
public TEventEntry.TOnBuffer onBuffer
public TEventEntry.TOnStreamCreate onStreamCreate
public TEventEntry.TOnStreamEnd onStreamEnd
public TEventEntry.TOnChangeFederation onChangeFederation
public TEventEntry.TOnTimerTick onTimerTick
public TEventEntry.TOnTimerCmd onTimerCmd
public TEventEntry.TOnChildEvent onChildEvent
public TEventEntry.TOnChangeObjectData onChangeObjectData
public TEventEntry.TOnSubAndPubEvent onSubAndPub
public TEventEntry.TOnOtherEvent onOtherEvent
public static final int ACTION_NEW
public static final int ACTION_DELETE
public static final int ACTION_CHANGE
TEventEntry(TConnection aConnection, int aID, String aEventName)
void subscribe()
void publish()
boolean isEmpty()
public boolean subscribers()
public boolean publishers()
void unSubscribe(boolean aChangeLocalState)
void unPublish(boolean aChangeLocalState)
void handleEvent(TByteBuffer aPayload)
void handleSubAndPub(int aCommand)
public String getEventName()
public String getShortEventName()
public boolean isPublished()
public boolean isSubscribed()
public void copyHandlersFrom(TEventEntry aEventEntry)
public int signalEvent(int aEventKind, byte[] aEventPayload)
aEventKind
- aEventPayload
- public int signalBuffer(int aBufferID, byte[] aBuffer)
aBufferID
- self chosen ID to separate streams of buffer eventsaBuffer
- public int signalBuffer(int aBufferID, byte[] aBuffer, int aEventFlags)
aBufferID
- self chosen ID to separate streams of buffer eventsaBuffer
- aEventFlags
- flags for special processing within the hub; not fully implemented, use 0public int signalStream(String aStreamName, InputStream aStream)
aStreamName
- aStream
- public int signalChangeObject(int aAction, int aObjectID, String aAttribute)
aAction
- see ACTION_* constantsaObjectID
- ID of the object that has changedaAttribute
- optional name of the attribute that has changedpublic int timerCreate(String aTimerName, long aStartTimeUTCorRelFT, int aResolutionms, double aSpeedFactor)
aTimerName
- unique name of the timer within this eventaStartTimeUTCorRelFT
- 0 means nowaResolutionms
- the resolution of a timer tick (step) in millisecondsaSpeedFactor
- 1 means same speed as real time, 0 means the timer runs in simulation timepublic int timerCreate(String aTimerName, long aStartTimeUTCorRelFT, int aResolutionms, double aSpeedFactor, int aRepeatCount)
aTimerName
- unique name of the timer within this eventaStartTimeUTCorRelFT
- 0 means nowaResolutionms
- the resolution of a timer tick (step) in millisecondsaSpeedFactor
- 1 means same speed as real time, 0 means the timer runs in simulation timeaRepeatCount
- number of timer the timer must send a timer tick (TRC_INFINITE for infinite)public int timerCancel(String aTimerName)
aTimerName
- public int timerPrepare(String aTimerName)
aTimerName
- public int timerStart(String aTimerName)
aTimerName
- public int timerStop(String aTimerName)
aTimerName
- public int timerSetSpeed(String aTimerName, double aSpeedFactor)
aTimerName
- aSpeedFactor
- 1 means the timer is running in real time, 0 means the timer runs in simulation timepublic int timerAcknowledgeAdd(String aTimerName, String aClientName)
aTimerName
- aClientName
- public int timerAcknowledgeRemove(String aTimerName, String aClientName)
aTimerName
- aClientName
- public int timerAcknowledge(String aTimerName, String aClientName, int aProposedTimeStep)
aTimerName
- aClientName
- aProposedTimeStep
- clients can specify the next step that they wish. The overall lowest next step is used if the timer is not running in real timepublic int logWriteLn(String aLine, TEventEntry.TLogLevel aLevel)
aLine
- text to enter into the logaLevel
- severity of the entry to log. See TLogLevel for values.Copyright © 2014–2016 Delft University of Technology. All rights reserved.