org.apache.cometd.bayeux
Interface Message

All Superinterfaces:
java.util.Map<java.lang.String,java.lang.Object>
All Known Implementing Classes:
MessageImpl

public interface Message
extends java.util.Map<java.lang.String,java.lang.Object>

A Bayeux Message
A Bayeux message is a Map of String/Object key value pairs representing the data in the message. The message contains information about the channel it was published through and who the sender was

Author:
Greg Wilkins, Filip Hanik

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 Channel getChannel()
          Returns a reference to the channel that this message was published throuhg
 Client getClient()
          Returns a reference to the client that sent this message
 long getCreationTime()
          returns the timestamp in milliseconds(System.currentTimeMillis()) of when this message was created.
 java.lang.String getId()
          Returns the unique id of this message
 long getTTL()
          Returns the time to live (in milliseconds) for this message
 void setTTL(long ttl)
          Sets the time to live in milliseconds.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

getClient

Client getClient()
Returns a reference to the client that sent this message

Returns:
Client - may be null

getChannel

Channel getChannel()
Returns a reference to the channel that this message was published throuhg

Returns:
Channel - may be null

getId

java.lang.String getId()
Returns the unique id of this message

Returns:
String

setTTL

void setTTL(long ttl)
Sets the time to live in milliseconds. If the message hasn't been delivered when the time passed after the creation time is longer than the TTL the message will expire and removed from any delivery queues.

Parameters:
ttl - long

getTTL

long getTTL()
Returns the time to live (in milliseconds) for this message

Returns:
long

getCreationTime

long getCreationTime()
returns the timestamp in milliseconds(System.currentTimeMillis()) of when this message was created.

Returns:
long


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.