org.cometd.bayeux
Interface Message

All Superinterfaces:
Map<String,Object>
All Known Subinterfaces:
Message.Mutable, ServerMessage, ServerMessage.Mutable

public interface Message
extends Map<String,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 mutable versions.
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.

Version:
$Revision: 1483 $ $Date: 2009-03-04 14:56:47 +0100 (Wed, 04 Mar 2009) $

Nested Class Summary
static interface Message.Mutable
          The mutable version of a Message
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static String ADVICE_FIELD
           
static String CHANNEL_FIELD
           
static String CLIENT_ID_FIELD
           
static String CONNECTION_TYPE_FIELD
           
static String DATA_FIELD
           
static String ERROR_FIELD
           
static String EXT_FIELD
           
static String ID_FIELD
           
static String INTERVAL_FIELD
           
static String MIN_VERSION_FIELD
           
static String RECONNECT_FIELD
           
static String RECONNECT_HANDSHAKE_VALUE
           
static String RECONNECT_NONE_VALUE
           
static String RECONNECT_RETRY_VALUE
           
static String SUBSCRIPTION_FIELD
           
static String SUCCESSFUL_FIELD
           
static String SUPPORTED_CONNECTION_TYPES_FIELD
           
static String TIMESTAMP_FIELD
           
static String TRANSPORT_FIELD
           
static String VERSION_FIELD
           
 
Method Summary
 Map<String,Object> getAdvice()
          Convenience method to retrieve the ADVICE_FIELD
 String getChannel()
          Convenience method to retrieve the CHANNEL_FIELD.
 ChannelId getChannelId()
          Convenience method to retrieve the CHANNEL_FIELD.
 String getClientId()
          Convenience method to retrieve the CLIENT_ID_FIELD
 Object getData()
          Convenience method to retrieve the DATA_FIELD
 Map<String,Object> getDataAsMap()
           
 Map<String,Object> getExt()
          Convenience method to retrieve the EXT_FIELD
 String getId()
          Convenience method to retrieve the ID_FIELD
 String getJSON()
           
 boolean isMeta()
          A messages that has a meta channel is dubbed a "meta message".
 boolean isSuccessful()
          Convenience method to retrieve the SUCCESSFUL_FIELD
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Field Detail

CLIENT_ID_FIELD

static final String CLIENT_ID_FIELD
See Also:
Constant Field Values

DATA_FIELD

static final String DATA_FIELD
See Also:
Constant Field Values

CHANNEL_FIELD

static final String CHANNEL_FIELD
See Also:
Constant Field Values

ID_FIELD

static final String ID_FIELD
See Also:
Constant Field Values

ERROR_FIELD

static final String ERROR_FIELD
See Also:
Constant Field Values

TIMESTAMP_FIELD

static final String TIMESTAMP_FIELD
See Also:
Constant Field Values

TRANSPORT_FIELD

static final String TRANSPORT_FIELD
See Also:
Constant Field Values

ADVICE_FIELD

static final String ADVICE_FIELD
See Also:
Constant Field Values

SUCCESSFUL_FIELD

static final String SUCCESSFUL_FIELD
See Also:
Constant Field Values

SUBSCRIPTION_FIELD

static final String SUBSCRIPTION_FIELD
See Also:
Constant Field Values

EXT_FIELD

static final String EXT_FIELD
See Also:
Constant Field Values

CONNECTION_TYPE_FIELD

static final String CONNECTION_TYPE_FIELD
See Also:
Constant Field Values

VERSION_FIELD

static final String VERSION_FIELD
See Also:
Constant Field Values

MIN_VERSION_FIELD

static final String MIN_VERSION_FIELD
See Also:
Constant Field Values

SUPPORTED_CONNECTION_TYPES_FIELD

static final String SUPPORTED_CONNECTION_TYPES_FIELD
See Also:
Constant Field Values

RECONNECT_FIELD

static final String RECONNECT_FIELD
See Also:
Constant Field Values

INTERVAL_FIELD

static final String INTERVAL_FIELD
See Also:
Constant Field Values

RECONNECT_RETRY_VALUE

static final String RECONNECT_RETRY_VALUE
See Also:
Constant Field Values

RECONNECT_HANDSHAKE_VALUE

static final String RECONNECT_HANDSHAKE_VALUE
See Also:
Constant Field Values

RECONNECT_NONE_VALUE

static final String RECONNECT_NONE_VALUE
See Also:
Constant Field Values
Method Detail

getAdvice

Map<String,Object> getAdvice()
Convenience method to retrieve the ADVICE_FIELD

Returns:
the advice of the message

getChannel

String getChannel()
Convenience method to retrieve the CHANNEL_FIELD. Bayeux message always have a non null channel.

Returns:
the channel of the message

getChannelId

ChannelId getChannelId()
Convenience method to retrieve the CHANNEL_FIELD. Bayeux message always have a non null channel.

Returns:
the channel of the message

getClientId

String getClientId()
Convenience method to retrieve the CLIENT_ID_FIELD

Returns:
the client id of the message

getData

Object getData()
Convenience method to retrieve the DATA_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

isSuccessful

boolean isSuccessful()
Convenience method to retrieve the SUCCESSFUL_FIELD

Returns:
whether the message is successful

getDataAsMap

Map<String,Object> getDataAsMap()
Returns:
the data of the message as a map
See Also:
getData()

getExt

Map<String,Object> getExt()
Convenience method to retrieve the EXT_FIELD

Returns:
the ext of the message

getId

String getId()
Convenience method to retrieve the ID_FIELD

Returns:
the id of the message

getJSON

String getJSON()
Returns:
this message as a JSON string


Copyright © 2008-2010 Dojo Foundation. All Rights Reserved.