public class Message extends Object implements EventType<String>
Message
event has the following properties:
eventSymbol
- symbol of this event;
attachment
- attachment.
Message
.Constructor and Description |
---|
Message()
Creates new message with default values.
|
Message(String eventSymbol)
Creates new message with the specified event symbol.
|
Message(String eventSymbol,
Object attachment)
Creates new message with the specified event symbol and attachment.
|
Modifier and Type | Method and Description |
---|---|
Object |
getAttachment()
Returns attachment.
|
Object |
getAttachment(ClassLoader cl)
Returns attachment.
|
String |
getEventSymbol()
Returns symbol for this event.
|
long |
getEventTime()
Returns time when event was created or zero when time is not available.
|
void |
setAttachment(Object attachment)
Changes attachment.
|
void |
setEventSymbol(String eventSymbol)
Changes symbol for this event.
|
void |
setEventTime(long eventTime)
Changes event creation time.
|
String |
toString()
Returns string representation of this message event.
|
public Message()
public Message(String eventSymbol)
eventSymbol
- event symbol.public String getEventSymbol()
getEventSymbol
in interface EventType<String>
public void setEventSymbol(String eventSymbol)
setEventSymbol
in interface EventType<String>
eventSymbol
- event symbol.public long getEventTime()
This event time is available only when the corresponding DXEndpoint
is created
with DXENDPOINT_EVENT_TIME_PROPERTY
and
the data source has embedded event times. This is typically true only for data events
that are read from historical tape files and from OnDemandService
.
Events that are coming from a network connections do not have an embedded event time information and
this method will return zero for them, meaning that event was received just now.
getEventTime
in interface EventType<String>
public void setEventTime(long eventTime)
setEventTime
in interface EventType<String>
eventTime
- the difference, measured in milliseconds,
between the event creation time and midnight, January 1, 1970 UTC.public Object getAttachment()
RuntimeException
- if object cannot be deserialized from its serial formpublic Object getAttachment(ClassLoader cl)
cl
- the ClassLoader that will be used to load classes; null
for defaultRuntimeException
- if object cannot be deserialized from its serial formpublic void setAttachment(Object attachment)
attachment
- attachment.Copyright © 2002–2023 Devexperts LLC. All rights reserved.