public interface Channel
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.Modifier and Type | Method and Description |
---|---|
void |
addFilter(DataFilter filter)
Adds a data filter to this channel.
|
String |
getId()
Returns the id for this channel.
|
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
|
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.List<Client> getSubscribers()
void addFilter(DataFilter filter)
filter
- FilterDataFilter removeFilter(DataFilter filter)
filter
- FilterCopyright © 2017 JBoss by Red Hat. All rights reserved.