Package org.cometd.bayeux
Interface Message
-
- All Superinterfaces:
java.util.Map<java.lang.String,java.lang.Object>
- All Known Subinterfaces:
Message.Mutable,ServerMessage,ServerMessage.Mutable
- All Known Implementing Classes:
HashMapMessage,ServerMessageImpl
public interface Message extends java.util.Map<java.lang.String,java.lang.Object>The Bayeux protocol exchange information by means of messages.
This interface represents the API of a Bayeux message, and consists mainly of convenience methods to access the known fields of the message map.
This interface comes in both an immutable and
mutableversions. Mutability may be deeply enforced by an implementation, so that it is not correct to cast a passed Message, to a Message.Mutable, even if the implementation allows this.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMessage.MutableThe mutable version of aMessage
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringADVICE_FIELDstatic java.lang.StringCHANNEL_FIELDstatic java.lang.StringCLIENT_ID_FIELDstatic java.lang.StringCONNECTION_TYPE_FIELDstatic java.lang.StringDATA_FIELDstatic java.lang.StringERROR_FIELDstatic java.lang.StringEXT_FIELDstatic java.lang.StringID_FIELDstatic java.lang.StringINTERVAL_FIELDstatic java.lang.StringMAX_INTERVAL_FIELDstatic java.lang.StringMIN_VERSION_FIELDstatic java.lang.StringRECONNECT_FIELDstatic java.lang.StringRECONNECT_HANDSHAKE_VALUEstatic java.lang.StringRECONNECT_NONE_VALUEstatic java.lang.StringRECONNECT_RETRY_VALUEstatic java.lang.StringSUBSCRIPTION_FIELDstatic java.lang.StringSUCCESSFUL_FIELDstatic java.lang.StringSUPPORTED_CONNECTION_TYPES_FIELDstatic java.lang.StringTIMEOUT_FIELDstatic java.lang.StringTIMESTAMP_FIELDstatic java.lang.StringTRANSPORT_FIELDstatic java.lang.StringVERSION_FIELD
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>getAdvice()Convenience method to retrieve theADVICE_FIELDjava.lang.StringgetChannel()Convenience method to retrieve theCHANNEL_FIELD.ChannelIdgetChannelId()Convenience method to retrieve theCHANNEL_FIELD.java.lang.StringgetClientId()Convenience method to retrieve theCLIENT_ID_FIELDjava.lang.ObjectgetData()Convenience method to retrieve theDATA_FIELDjava.util.Map<java.lang.String,java.lang.Object>getDataAsMap()java.util.Map<java.lang.String,java.lang.Object>getExt()Convenience method to retrieve theEXT_FIELDjava.lang.StringgetId()Convenience method to retrieve theID_FIELDbooleanisMeta()A messages that has a meta channel is dubbed a "meta message".booleanisPublishReply()Publish message replies contain the "successful" fieldbooleanisSuccessful()Convenience method to retrieve theSUCCESSFUL_FIELD
-
-
-
Field Detail
-
CLIENT_ID_FIELD
static final java.lang.String CLIENT_ID_FIELD
- See Also:
- Constant Field Values
-
DATA_FIELD
static final java.lang.String DATA_FIELD
- See Also:
- Constant Field Values
-
CHANNEL_FIELD
static final java.lang.String CHANNEL_FIELD
- See Also:
- Constant Field Values
-
ID_FIELD
static final java.lang.String ID_FIELD
- See Also:
- Constant Field Values
-
ERROR_FIELD
static final java.lang.String ERROR_FIELD
- See Also:
- Constant Field Values
-
TIMESTAMP_FIELD
static final java.lang.String TIMESTAMP_FIELD
- See Also:
- Constant Field Values
-
TRANSPORT_FIELD
static final java.lang.String TRANSPORT_FIELD
- See Also:
- Constant Field Values
-
ADVICE_FIELD
static final java.lang.String ADVICE_FIELD
- See Also:
- Constant Field Values
-
SUCCESSFUL_FIELD
static final java.lang.String SUCCESSFUL_FIELD
- See Also:
- Constant Field Values
-
SUBSCRIPTION_FIELD
static final java.lang.String SUBSCRIPTION_FIELD
- See Also:
- Constant Field Values
-
EXT_FIELD
static final java.lang.String EXT_FIELD
- See Also:
- Constant Field Values
-
CONNECTION_TYPE_FIELD
static final java.lang.String CONNECTION_TYPE_FIELD
- See Also:
- Constant Field Values
-
VERSION_FIELD
static final java.lang.String VERSION_FIELD
- See Also:
- Constant Field Values
-
MIN_VERSION_FIELD
static final java.lang.String MIN_VERSION_FIELD
- See Also:
- Constant Field Values
-
SUPPORTED_CONNECTION_TYPES_FIELD
static final java.lang.String SUPPORTED_CONNECTION_TYPES_FIELD
- See Also:
- Constant Field Values
-
RECONNECT_FIELD
static final java.lang.String RECONNECT_FIELD
- See Also:
- Constant Field Values
-
INTERVAL_FIELD
static final java.lang.String INTERVAL_FIELD
- See Also:
- Constant Field Values
-
MAX_INTERVAL_FIELD
static final java.lang.String MAX_INTERVAL_FIELD
- See Also:
- Constant Field Values
-
TIMEOUT_FIELD
static final java.lang.String TIMEOUT_FIELD
- See Also:
- Constant Field Values
-
RECONNECT_RETRY_VALUE
static final java.lang.String RECONNECT_RETRY_VALUE
- See Also:
- Constant Field Values
-
RECONNECT_HANDSHAKE_VALUE
static final java.lang.String RECONNECT_HANDSHAKE_VALUE
- See Also:
- Constant Field Values
-
RECONNECT_NONE_VALUE
static final java.lang.String RECONNECT_NONE_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAdvice
java.util.Map<java.lang.String,java.lang.Object> getAdvice()
Convenience method to retrieve theADVICE_FIELD- Returns:
- the advice of the message
-
getChannel
java.lang.String getChannel()
Convenience method to retrieve theCHANNEL_FIELD. Bayeux message always have a non null channel.- Returns:
- the channel of the message
-
getChannelId
ChannelId getChannelId()
Convenience method to retrieve theCHANNEL_FIELD. Bayeux message always have a non null channel.- Returns:
- the channel of the message
-
getClientId
java.lang.String getClientId()
Convenience method to retrieve theCLIENT_ID_FIELD- Returns:
- the client id of the message
-
getData
java.lang.Object getData()
Convenience method to retrieve theDATA_FIELD- Returns:
- the data of the message
- See Also:
getDataAsMap()
-
isMeta
boolean isMeta()
A messages that has a meta channel is dubbed a "meta message".- Returns:
- whether the channel's message is a meta channel
-
isPublishReply
boolean isPublishReply()
Publish message replies contain the "successful" field- Returns:
- whether this message is a publish reply (as opposed to a published message)
-
isSuccessful
boolean isSuccessful()
Convenience method to retrieve theSUCCESSFUL_FIELD- Returns:
- whether the message is successful
-
getDataAsMap
java.util.Map<java.lang.String,java.lang.Object> getDataAsMap()
- Returns:
- the data of the message as a map
- See Also:
getData()
-
getExt
java.util.Map<java.lang.String,java.lang.Object> getExt()
Convenience method to retrieve theEXT_FIELD- Returns:
- the ext of the message
-
getId
java.lang.String getId()
Convenience method to retrieve theID_FIELD- Returns:
- the id of the message
-
-