dojox.cometd
Interface Channel

All Known Implementing Classes:
ChannelImpl

public interface Channel

A Bayeux Channel.


Method Summary
 String getId()
           
 int getSubscribers()
           
 boolean isPersistent()
          Is the channel persistent.
 void publish(Client fromClient, Object data, String msgId)
          Publish a message This is equivalent to Bayeux.publish(fromClient,channel.getId(),data,msgId).
 boolean remove()
           
 void setPersistent(boolean persistent)
           
 void subscribe(Client subscriber)
          Subscribe to a channel.
 void unsubscribe(Client subscriber)
          Unsubscribe to a channel
 

Method Detail

remove

boolean remove()
Returns:
true if the Channel has been removed, false if it was not possible to remove the channel

getId

String getId()

publish

void publish(Client fromClient,
             Object data,
             String msgId)
Publish a message This is equivalent to Bayeux.publish(fromClient,channel.getId(),data,msgId).


isPersistent

boolean isPersistent()
Is the channel persistent. Non persistent channels are removed when the last subscription is removed

Returns:
true if the Channel will persist without any subscription.

setPersistent

void setPersistent(boolean persistent)
Parameters:
persistent - true if the Channel will persist without any subscription.

subscribe

void subscribe(Client subscriber)
Subscribe to a channel. Equivalent to bayeux.subscribe(channel.getId(),subscriber,false);

Parameters:
toChannel -
subscriber -

unsubscribe

void unsubscribe(Client subscriber)
Unsubscribe to a channel

Parameters:
toChannel -
subscriber -

getSubscribers

int getSubscribers()
Returns:
the number of subscribers for this channel.


Copyright © 2007 Mort Bay Consulting. All Rights Reserved.