|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object eu.semaine.jms.message.SEMAINEMessage
public class SEMAINEMessage
A representation of a message as used in SEMAINE code. It is a higher-level access method for JMS messages, providing interpretations of information accessible in the message headers. This base class provides access to the Message body only as plain text (for text messages). Subclasses should:
Field Summary | |
---|---|
static java.lang.String |
CONTENT_CREATION_TIME
The name of the property used for the content's creation time, if given. |
static java.lang.String |
CONTENT_ID
The name of the property used for the content's unique identifier, if any. |
static java.lang.String |
CONTENT_TYPE
The name of the property used for the content's type, if any. |
static java.lang.String |
CONTENT_TYPE_LISTENERVOCALISATION
A possible value of the CONTENT_TYPE property, representing a listener vocalisation. |
static java.lang.String |
CONTENT_TYPE_UTTERANCE
A possible value of the CONTENT_TYPE property, representing a speaker utterance. |
static java.lang.String |
CONTENT_TYPE_VISUALONLY
A possible value of the CONTENT_TYPE property, representing a visual-only agent behaviour. |
static java.lang.String |
DATATYPE
The name of the property used for the type of data being sent. |
static java.lang.String |
EVENT
The name of the property used for the type of event being sent (for event-based messages). |
protected Message |
message
|
static java.lang.String |
PERIOD
The name of the property used for the period length, in milliseconds (for periodic messages). |
static java.lang.String |
SOURCE
The name of the property used for the component that sent the data. |
static java.lang.String |
USERTIME
The name of the property used for time in "user" time that the message refers to. |
Constructor Summary | |
---|---|
SEMAINEMessage(Message message)
Create a SEMAINE specific abstraction from the given message. |
Method Summary | |
---|---|
long |
getContentCreationTime()
Get the time when the content was originally created. |
java.lang.String |
getContentID()
Get the unique ID of the content in the message, if any. |
java.lang.String |
getContentType()
Get the type of the content in the message, if any. |
java.lang.String |
getDatatype()
Get the name of the data type received. |
IOBase.Event |
getEventType()
For event-based messages, determine the event type. |
Message |
getMessage()
Provide access to the low-level message encapsulated in this object. |
int |
getPeriod()
For periodic messages, determine the period length. |
java.lang.String |
getSource()
Get the name of the source component that sent the data. |
java.lang.String |
getText()
For text messages, provide access to the text sent. |
java.lang.String |
getTopicName()
Get the name of the topic to which this message had been sent. |
long |
getUsertime()
Get the user time that the message refers to, in milliseconds since 1970. |
boolean |
isBytesMessage()
Determine whether the message is a bytes message. |
boolean |
isEventBased()
Determine whether the message is event-based. |
boolean |
isPeriodic()
Determine whether the message is periodic. |
boolean |
isTextMessage()
Determine whether the message is a text message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String USERTIME
public static final java.lang.String DATATYPE
public static final java.lang.String SOURCE
public static final java.lang.String EVENT
public static final java.lang.String PERIOD
public static final java.lang.String CONTENT_ID
public static final java.lang.String CONTENT_CREATION_TIME
public static final java.lang.String CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE_UTTERANCE
public static final java.lang.String CONTENT_TYPE_LISTENERVOCALISATION
public static final java.lang.String CONTENT_TYPE_VISUALONLY
protected Message message
Constructor Detail |
---|
public SEMAINEMessage(Message message) throws MessageFormatException
message
- a message containing SEMAINE-specific properties.
java.lang.NullPointerException
- if message is null.
MessageFormatException
- if the message does not have the proper formatMethod Detail |
---|
public long getUsertime() throws JMSException
JMSException
- if the JMS provider fails to get the property value due to some internal error.
MessageFormatException
- if the message property exists but has the wrong type.public java.lang.String getDatatype() throws JMSException
JMSException
- if the JMS provider fails to get the property value due to some internal error.public java.lang.String getSource() throws JMSException
JMSException
- if the JMS provider fails to get the property value due to some internal error.public boolean isPeriodic() throws JMSException
period
property.
true
if message is periodic,
false
if message is event-based.
JMSException
- if the JMS provider fails to get the property value due to some internal error.public boolean isEventBased() throws JMSException
event
property.
true
if message is event-based,
false
if message is periodic.
JMSException
- if the JMS provider fails to get the property value due to some internal error.public IOBase.Event getEventType() throws JMSException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, MessageFormatException
JMSException
- if the JMS provider fails to get the property value due to some internal error.
MessageFormatException
- if the message contains an event
property, but the value is not known.
java.lang.IllegalStateException
- if the message is not event-based.
java.lang.IllegalArgumentException
public int getPeriod() throws JMSException, java.lang.IllegalStateException
JMSException
- if the JMS provider fails to get the property value due to some internal error.
java.lang.IllegalStateException
- if the message is not periodic.public java.lang.String getContentID() throws JMSException
JMSException
public long getContentCreationTime() throws JMSException
JMSException
public java.lang.String getContentType() throws JMSException
JMSException
- if the JMS provider fails to get the property value due to some internal error.public boolean isTextMessage()
public boolean isBytesMessage()
public java.lang.String getText() throws JMSException
JMSException
- if the JMS provider fails to get the property value due to some internal error.
java.lang.IllegalStateException
- if the message is not a text message.public java.lang.String getTopicName() throws JMSException
JMSException
public Message getMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |