public class SubscriptionManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addSubscription(Item item)
Subscribe to the given item.
|
static SubscriptionManager |
getInstance(Server server)
Returns the subscription manager instance for the given server.
|
Server |
getServer()
Returns the server of this connection.
|
java.util.Set<java.lang.String> |
getSubscriptions(Item item)
Returns all user UIDs subscribed to the given item.
|
void |
getUserSubscriptions(ItemCollection itemCollection)
Replaces the content of the given collection with the items the current user is subscribed to.
|
void |
getUserSubscriptions(MultiItemCollection multiItemCollection)
Replaces the content of the given collection with the items the current user is subscribed to.
|
boolean |
hasSubscription(Item item)
Returns whether the current user has a subscription for the given item.
|
void |
removeSubscription(Item item)
Unsubscribe from the given item.
|
void |
setSessionSubscriptionsDisabled(boolean disableSubscription)
Enables or disables subscription notifications for this session.
|
boolean |
supportsSubscriptions(Item item)
Returns whether the current item supports subscriptions.
|
public static SubscriptionManager getInstance(Server server)
server
- server to get the subscription manager forpublic Server getServer()
public void addSubscription(Item item) throws CumulusException
item
- the item to subscribe for change notificationsCumulusException
- in case of an errorpublic void removeSubscription(Item item) throws CumulusException
item
- the item to unsubscribe fromCumulusException
- in case of an errorpublic boolean hasSubscription(Item item) throws CumulusException
item
- the item to unsubscribe fromtrue
if the current user has a subscription for the given item, false
otherwiseCumulusException
- in case of an errorpublic boolean supportsSubscriptions(Item item) throws CumulusException
item
- the item to checktrue
if the current item supports subscriptions, false
otherwiseCumulusException
- in case of an errorpublic java.util.Set<java.lang.String> getSubscriptions(Item item) throws CumulusException
item
- the item to get the list of subscriptions for.CumulusException
- in case of an errorpublic void getUserSubscriptions(ItemCollection itemCollection) throws CumulusException
itemCollection
- collection to contain all subscribed itemsCumulusException
- in case of an errorpublic void getUserSubscriptions(MultiItemCollection multiItemCollection) throws CumulusException
multiItemCollection
- collection to contain all subscribed itemsCumulusException
- in case of an errorpublic void setSessionSubscriptionsDisabled(boolean disableSubscription) throws PermissionDeniedException
Cumulus admin
.disableSubscription
- true
to disable subscription notifications, false
to re-enable themPermissionDeniedException
- if the current user is not the Cumulus admin
www.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.