org.mortbay.cometd
Class Channel

java.lang.Object
  extended by org.mortbay.cometd.Channel

public class Channel
extends Object

A Bayuex Channel

Author:
gregw

Method Summary
 void addDataFilter(DataFilter filter)
           
 void addSubscriber(Client client)
           
 String getId()
           
 String getToken(Client client, boolean subscribe, boolean send, boolean oneTime)
           
 void publish(Object data, Client from)
          Publish data to a the channel.
 void removeDataFilter(DataFilter filter)
           
 void removeSubscriber(Client client)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

addSubscriber

public void addSubscriber(Client client)
Parameters:
client -

addDataFilter

public void addDataFilter(DataFilter filter)
Parameters:
filter -

removeDataFilter

public void removeDataFilter(DataFilter filter)
Parameters:
filter -

getId

public String getId()
Returns:

removeSubscriber

public void removeSubscriber(Client client)
Parameters:
client -

publish

public void publish(Object data,
                    Client from)
Publish data to a the channel.

Parameters:
data - The data object - The data object is filtered by the channel filters and then any client specific filters. It is then set as the "data" field of a Bayuex message map before being passed to the Client.deliver(java.util.Map) method. If not converted by the filters, the data will be converted in deliver to JSON by the JSON.toString(Object) method.
from - The client sending the data or null for anonymous delivery.

getToken

public String getToken(Client client,
                       boolean subscribe,
                       boolean send,
                       boolean oneTime)
Parameters:
client - The client for which this token will be valid
subscribe - True if this token may be used for subscriptions
send - True if this token may be used for send
oneTime - True if this token may only be used in one request batch.
Returns:
A new token that can be used for subcriptions and or sending.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007 Mort Bay Consulting. All Rights Reserved.