dojox.cometd
Interface Bayeux

All Known Implementing Classes:
AbstractBayeux

public interface Bayeux

Bayeux Interface. This interface represents the server side API for the Bayeux messaging protocol.


Field Summary
static String DOJOX_COMETD_BAYEUX
          ServletContext attribute name used to obtain the Bayeux object
 
Method Summary
 void addFilter(String channels, DataFilter filter)
           
 Channel getChannel(String channelId, boolean create)
           
 Client getClient(String client_id)
           
 boolean hasChannel(String channel)
           
 Client newClient(String idprefix, Listener listener)
           
 void publish(Client fromClient, String toChannel, Object data, String msgId)
          Deliver data to a channel.
 void removeFilter(String channels, DataFilter filter)
           
 void subscribe(String toChannel, Client subscriber)
          Subscribe to a channel.
 void unsubscribe(String toChannel, Client subscriber)
          Unsubscribe to a channel
 

Field Detail

DOJOX_COMETD_BAYEUX

static final String DOJOX_COMETD_BAYEUX
ServletContext attribute name used to obtain the Bayeux object

See Also:
Constant Field Values
Method Detail

newClient

Client newClient(String idprefix,
                 Listener listener)
Parameters:
idprefix -
listener -
Returns:

getClient

Client getClient(String client_id)
Parameters:
client_id -
Returns:

getChannel

Channel getChannel(String channelId,
                   boolean create)

publish

void publish(Client fromClient,
             String toChannel,
             Object data,
             String msgId)
Deliver data to a channel.

Parameters:
fromClient - The client sending the data
data - The data itself which must be an Object that can be encoded with JSON.
toChannel - The Channel ID to which the data is targetted
msgId - optional message ID or null for automatic generation of a message ID.

subscribe

void subscribe(String toChannel,
               Client subscriber)
Subscribe to a channel. Equivalent to getChannel(toChannel).subscribe(subscriber).

Parameters:
toChannel -
subscriber -
createChannel. - Create the channel if it does not exist

unsubscribe

void unsubscribe(String toChannel,
                 Client subscriber)
Unsubscribe to a channel

Parameters:
toChannel -
subscriber -

hasChannel

boolean hasChannel(String channel)

addFilter

void addFilter(String channels,
               DataFilter filter)

removeFilter

void removeFilter(String channels,
                  DataFilter filter)


Copyright © 2007 Mort Bay Consulting. All Rights Reserved.