dojox.cometd
Interface Bayeux

All Known Implementing Classes:
AbstractBayeux, ContinuationBayeux

public interface Bayeux

Bayeux Interface. This interface represents the server side API for the Bayeux messaging protocol. Bayeux implementations must be thread safe and multiple threads may simultaneously call Bayeux methods.


Field Summary
static String ADVICE_FIELD
           
static String CHANNEL_FIELD
           
static String CLIENT_FIELD
           
static String DATA_FIELD
           
static String DOJOX_COMETD_BAYEUX
          ServletContext attribute name used to obtain the Bayeux object
static String ERROR_FIELD
           
static String EXT_FIELD
           
static String ID_FIELD
           
static String META
           
static String META_CLIENT
           
static String META_CONNECT
           
static String META_DISCONNECT
           
static String META_HANDSHAKE
           
static String META_PING
           
static String META_RECONNECT
           
static String META_SLASH
           
static String META_STATUS
           
static String META_SUBSCRIBE
           
static String META_UNSUBSCRIBE
           
static String SERVICE
           
static String SERVICE_SLASH
           
static String SUBSCRIPTION_FIELD
           
static String SUCCESSFUL_FIELD
           
static String TIMESTAMP_FIELD
           
static String TRANSPORT_FIELD
           
 
Method Summary
 void addFilter(String channels, DataFilter filter)
           
 void deliver(Client fromClient, Client toClient, String toChannel, Map<String,Object> message)
          Deliver a message to a client.
 Channel getChannel(String channelId, boolean create)
           
 Client getClient(String client_id)
           
 SecurityPolicy getSecurityPolicy()
           
 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 setSecurityPolicy(SecurityPolicy securityPolicy)
           
 void subscribe(String toChannel, Client subscriber)
          Subscribe to a channel.
 void unsubscribe(String toChannel, Client subscriber)
          Unsubscribe to a channel
 

Field Detail

META

static final String META
See Also:
Constant Field Values

META_SLASH

static final String META_SLASH
See Also:
Constant Field Values

META_CONNECT

static final String META_CONNECT
See Also:
Constant Field Values

META_CLIENT

static final String META_CLIENT
See Also:
Constant Field Values

META_DISCONNECT

static final String META_DISCONNECT
See Also:
Constant Field Values

META_HANDSHAKE

static final String META_HANDSHAKE
See Also:
Constant Field Values

META_PING

static final String META_PING
See Also:
Constant Field Values

META_RECONNECT

static final String META_RECONNECT
See Also:
Constant Field Values

META_STATUS

static final String META_STATUS
See Also:
Constant Field Values

META_SUBSCRIBE

static final String META_SUBSCRIBE
See Also:
Constant Field Values

META_UNSUBSCRIBE

static final String META_UNSUBSCRIBE
See Also:
Constant Field Values

CLIENT_FIELD

static final String CLIENT_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

SERVICE

static final String SERVICE
See Also:
Constant Field Values

SERVICE_SLASH

static final String SERVICE_SLASH
See Also:
Constant Field Values

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.

deliver

void deliver(Client fromClient,
             Client toClient,
             String toChannel,
             Map<String,Object> message)
Deliver a message to a client.


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)

getSecurityPolicy

SecurityPolicy getSecurityPolicy()

setSecurityPolicy

void setSecurityPolicy(SecurityPolicy securityPolicy)


Copyright © 2007 Mort Bay Consulting. All Rights Reserved.