## dojox.cometd
Interface Channel

All Known Implementing Classes:
  AbstractBayeux.ServiceChannel, ChannelImpl

    public interface Channel

A Bayeux Channel.

Method Summary
`void` `addDataFilter(DataFilter filter)`
`Collection<DataFilter>` `getDataFilters()`
`String` `getId()`
`Collection<Client>` `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()`
`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

    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

    Collection<Client> getSubscribers()

### addDataFilter

    void addDataFilter(DataFilter filter)

### removeDataFilter

    DataFilter removeDataFilter(DataFilter filter)

### getDataFilters

    Collection<DataFilter> getDataFilters()

Copyright © 2008 Mort Bay Consulting. All Rights Reserved.