org.cometd
Interface Channel


public interface Channel

A Bayeux Channel.

A Channel represents a routing path for messages to Clients. Clients may subscribe to a channel and will be delivered all messages published to the channel.


Method Summary
 void addDataFilter(DataFilter filter)
           
 void addListener(ChannelListener listener)
           
 java.util.Collection<DataFilter> getDataFilters()
           
 java.lang.String getId()
           
 int getSubscriberCount()
           
 java.util.Collection<Client> getSubscribers()
           
 boolean isPersistent()
          Is the channel persistent.
 void publish(Client fromClient, java.lang.Object data, java.lang.String msgId)
          Publish a message.
 boolean remove()
           
 DataFilter removeDataFilter(DataFilter filter)
           
 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

java.lang.String getId()

publish

void publish(Client fromClient,
             java.lang.Object data,
             java.lang.String msgId)
Publish a message.

Parameters:
fromClient - From client or null
data - The message data
msgId - The message ID or null

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

java.util.Collection<Client> getSubscribers()

getSubscriberCount

int getSubscriberCount()

addDataFilter

void addDataFilter(DataFilter filter)

removeDataFilter

DataFilter removeDataFilter(DataFilter filter)

getDataFilters

java.util.Collection<DataFilter> getDataFilters()

addListener

void addListener(ChannelListener listener)


Copyright © 2010 Dojo Foundation. All Rights Reserved.