org.cometd.server
Class ServerMessageImpl

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by org.cometd.server.ServerMessageImpl
All Implemented Interfaces:
Map<String,Object>, Message, ServerMessage, org.eclipse.jetty.util.ajax.JSON.Generator

public class ServerMessageImpl
extends AbstractMap<String,Object>
implements ServerMessage, org.eclipse.jetty.util.ajax.JSON.Generator


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface org.cometd.bayeux.server.ServerMessage
ServerMessage.Mutable
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from interface org.cometd.bayeux.Message
ADVICE_FIELD, CHANNEL_FIELD, CLIENT_ID_FIELD, CONNECTION_TYPE_FIELD, DATA_FIELD, ERROR_FIELD, EXT_FIELD, ID_FIELD, INTERVAL_FIELD, MIN_VERSION_FIELD, RECONNECT_FIELD, RECONNECT_HANDSHAKE_VALUE, RECONNECT_NONE_VALUE, RECONNECT_RETRY_VALUE, SUBSCRIPTION_FIELD, SUCCESSFUL_FIELD, SUPPORTED_CONNECTION_TYPES_FIELD, TIMESTAMP_FIELD, TRANSPORT_FIELD, VERSION_FIELD
 
Constructor Summary
ServerMessageImpl()
           
 
Method Summary
static void addConvertor(Class forClass, org.eclipse.jetty.util.ajax.JSON.Convertor convertor)
          Add a JSON convertor.
static void addConvertorFor(String name, org.eclipse.jetty.util.ajax.JSON.Convertor convertor)
          Add a JSON convertor.
 void addJSON(Appendable buffer)
           
 ServerMessage.Mutable asMutable()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<String,Object>> entrySet()
           
 Object get(Object key)
           
 Map<String,Object> getAdvice()
           
 ServerMessage getAssociated()
           
 String getChannel()
           
 String getClientId()
           
 Object getData()
           
 Map<String,Object> getDataAsMap()
           
 Map<String,Object> getExt()
           
 String getId()
           
 String getJSON()
           
 boolean isLazy()
          Lazy messages are queued but do not wake up waiting clients.
 boolean isMeta()
           
 boolean isSuccessful()
           
static ServerMessage.Mutable parseMessage(String s)
           
static ServerMessage.Mutable[] parseMessages(Reader reader, boolean jsonDebug)
           
static ServerMessage.Mutable[] parseMessages(String s)
           
 void setAssociated(ServerMessage associated)
           
 void setData(Object data)
           
 void setLazy(boolean lazy)
          Lazy messages are queued but do not wake up waiting clients.
 int size()
           
 String toString()
           
 
Methods inherited from class java.util.AbstractMap
clear, clone, equals, hashCode, isEmpty, keySet, put, putAll, remove, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, equals, hashCode, isEmpty, keySet, put, putAll, remove, values
 

Constructor Detail

ServerMessageImpl

public ServerMessageImpl()
Method Detail

asMutable

public ServerMessage.Mutable asMutable()
Specified by:
asMutable in interface ServerMessage

addJSON

public void addJSON(Appendable buffer)
Specified by:
addJSON in interface org.eclipse.jetty.util.ajax.JSON.Generator

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<String,Object>
Overrides:
containsKey in class AbstractMap<String,Object>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<String,Object>
Overrides:
containsValue in class AbstractMap<String,Object>

entrySet

public Set<Map.Entry<String,Object>> entrySet()
Specified by:
entrySet in interface Map<String,Object>
Specified by:
entrySet in class AbstractMap<String,Object>

get

public Object get(Object key)
Specified by:
get in interface Map<String,Object>
Overrides:
get in class AbstractMap<String,Object>

getAdvice

public Map<String,Object> getAdvice()
Specified by:
getAdvice in interface Message

getAssociated

public ServerMessage getAssociated()
Specified by:
getAssociated in interface ServerMessage

getChannel

public String getChannel()
Specified by:
getChannel in interface Message

getClientId

public String getClientId()
Specified by:
getClientId in interface Message

getData

public Object getData()
Specified by:
getData in interface Message

getDataAsMap

public Map<String,Object> getDataAsMap()
Specified by:
getDataAsMap in interface Message

getExt

public Map<String,Object> getExt()
Specified by:
getExt in interface Message

getId

public String getId()
Specified by:
getId in interface Message

getJSON

public String getJSON()
Specified by:
getJSON in interface Message

isLazy

public boolean isLazy()
Lazy messages are queued but do not wake up waiting clients.

Specified by:
isLazy in interface ServerMessage
Returns:
true if message is lazy

isMeta

public boolean isMeta()
Specified by:
isMeta in interface Message

isSuccessful

public boolean isSuccessful()
Specified by:
isSuccessful in interface Message

setAssociated

public void setAssociated(ServerMessage associated)

setData

public void setData(Object data)

setLazy

public void setLazy(boolean lazy)
Lazy messages are queued but do not wake up waiting clients.

Parameters:
lazy - true if message is lazy

size

public int size()
Specified by:
size in interface Map<String,Object>
Overrides:
size in class AbstractMap<String,Object>

toString

public String toString()
Overrides:
toString in class AbstractMap<String,Object>

addConvertor

public static void addConvertor(Class forClass,
                                org.eclipse.jetty.util.ajax.JSON.Convertor convertor)
Add a JSON convertor. Add a JSON convertor to the JSON instance used to convert message fields.

See Also:
JSON.addConvertor(Class, org.eclipse.jetty.util.ajax.JSON.Convertor)

addConvertorFor

public static void addConvertorFor(String name,
                                   org.eclipse.jetty.util.ajax.JSON.Convertor convertor)
Add a JSON convertor. Add a JSON convertor to the JSON instance used to convert message fields.

See Also:
JSON.addConvertorFor(String, org.eclipse.jetty.util.ajax.JSON.Convertor)

parseMessages

public static ServerMessage.Mutable[] parseMessages(Reader reader,
                                                    boolean jsonDebug)
                                             throws ParseException,
                                                    IOException
Throws:
ParseException
IOException

parseMessages

public static ServerMessage.Mutable[] parseMessages(String s)
                                             throws ParseException
Throws:
ParseException

parseMessage

public static ServerMessage.Mutable parseMessage(String s)
                                          throws IOException
Throws:
IOException


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