|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Channel
A Bayeux Channel represents a channel used to receive messages from and to publish messages to.
In order to publish messages to or receive messages from, one must subscribe to the channel.
This is easily done by invoking the subscribe
method.
A channel is created by calling the Bayeux.getChannel(channelId,true)
method.
A channel can be created either server side by invoking the getChannel, or client side
by using the /meta/subscribe message without a wildcard.
Method Summary | |
---|---|
void |
addFilter(DataFilter filter)
Adds a data filter to this channel. |
java.lang.String |
getId()
Returns the id for this channel. |
java.util.List<Client> |
getSubscribers()
returns a non modifiable list of all the subscribers to this channel. |
boolean |
isPersistent()
Non persistent channels are removed when the last subscription is removed. |
void |
publish(Message msg)
Publishes a message to all the subscribers of this channel. |
void |
publish(Message[] msgs)
Publishes more than one message to all the subscribers of this channel. |
DataFilter |
removeFilter(DataFilter filter)
Removes a filter from this channel. |
void |
setPersistent(boolean persistent)
|
void |
subscribe(Client subscriber)
Subscribes a client to a channel. |
Client |
unsubscribe(Client subscriber)
Unsubscribes a client from a channel |
Method Detail |
---|
java.lang.String getId()
void publish(Message msg)
from
is contained within the message, by calling
msg.getClient()
data
- - the message to be published, can not be null.void publish(Message[] msgs)
from
is contained within the message, by calling
msg[x].getClient()
data
- - the message to be published, can not be null.boolean isPersistent()
void setPersistent(boolean persistent)
persistent
- true if the Channel will persist without any subscription.isPersistent
void subscribe(Client subscriber)
subscriber
- - the client to be subscribed. If the client
already is subscribed, this call will not create a duplicate subscription.Client unsubscribe(Client subscriber)
subscriber
- - the client to be subscribed.
java.util.List<Client> getSubscribers()
void addFilter(DataFilter filter)
filter
- FilterDataFilter removeFilter(DataFilter filter)
filter
- Filter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |