public class Subscriptions extends Object
An AtmosphereResource can subscribes to many destination. The STOMP protocol allow to
subscribe many times to the same destination. This class can provide subscriptions to a destination or the destination
for a subscription ID.
| Constructor and Description |
|---|
Subscriptions()
Builds a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSubscription(String id,
String destination)
Adds a subscription to the set of subscriptions.
|
Set<String> |
getAllDestinations()
Gets all the destinations this client has subscribed to.
|
String |
getDestinationForId(String id)
Gets the destination for the given subscription ID.
|
static Subscriptions |
getFromSession(org.atmosphere.cpr.AtmosphereResourceSession session)
Gets a
Subscriptions object from the given session. |
List<String> |
getSubscriptionsForDestination(String destination)
Gets the subscriptions for the given destination.
|
void |
removeSubscription(String id)
Removes the subscription identified by the given ID.
|
public static Subscriptions getFromSession(org.atmosphere.cpr.AtmosphereResourceSession session)
Gets a Subscriptions object from the given session. If no subscription is bound to the session, a new one
is created and then returned.
session - the sessionpublic Set<String> getAllDestinations()
Gets all the destinations this client has subscribed to.
public void addSubscription(String id, String destination)
Adds a subscription to the set of subscriptions.
id - the subscription IDdestination - the subscribed destinationpublic List<String> getSubscriptionsForDestination(String destination)
Gets the subscriptions for the given destination.
destination - the destinationpublic String getDestinationForId(String id)
Gets the destination for the given subscription ID.
id - the IDpublic void removeSubscription(String id)
Removes the subscription identified by the given ID.
id - the IdCopyright © 2014. All Rights Reserved.