Interface SubscriptionNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on adds/changes
to Subscriptions . This session is intended for consumers needing
to synchronize their state with this service without the use of polling.
Notifications are cancelled when this session is closed.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeSubscriptionNotification(Id notificationId) Acknowledge a subscription notification.booleanTests if this user can register forSubscriptionnotifications.Gets thePublisherassociated with this session.Gets thePublisherIdassociated with this session.voidregisterForChangedSubscription(Id subscriptionId) Registers for notification of an updated subscription.voidRegisters for notification of updated subscriptions.voidregisterForChangedSubscriptionsByGenusType(Type subscriptionGenusType) Registers for notification of updated subscriptions of the given genus type.voidregisterForChangedSubscriptionsForDispatch(Id dispatchId) Register for notifications of changed subscriptions for the given dispatchId.voidregisterForChangedSubscriptionsForSubscriber(Id resourceId) Register for notifications of changed subscriptions for the given resourceId.voidregisterForDeletedSubscription(Id subscriptionId) Registers for notification of a deleted subscription.voidRegisters for notification of deleted subscriptions.voidregisterForDeletedSubscriptionsByGenusType(Type subscriptionGenusType) Registers for notification of deleted subscriptions of the given genus type.voidregisterForDeletedSubscriptionsForDispatch(Id dispatchId) Register for notifications of changed subscriptions for the given dispatchId.voidregisterForDeletedSubscriptionsForSubscriber(Id resourceId) Register for notifications of changed subscriptions for the given subscriberId.voidRegister for notifications of new subscriptions.voidregisterForNewSubscriptionsByGenusType(Type subscriptionGenusType) Register for notifications of new subscriptions of the given genus type.voidregisterForNewSubscriptionsForDispatch(Id dispatchId) Register for notifications of new subscriptions for the given referenceId.voidregisterForNewSubscriptionsForSubscriber(Id resourceId) Register for notifications of new subscriptions for the given resourceId.voidReliable notifications are desired.voidUnreliable notifications are desired.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getPublisherId
Id getPublisherId()Gets thePublisherIdassociated with this session.- Returns:
- the
Publisher Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getPublisher
Gets thePublisherassociated with this session.- Returns:
- the publisher
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForSubscriptionNotifications
boolean canRegisterForSubscriptionNotifications()Tests if this user can register forSubscriptionnotifications. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer notification operations.- Returns:
falseif notification methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useFederatedPublisherView
void useFederatedPublisherView()Federates the view for methods in this session. A federated view will include entries in publishers which are children of this publisher in the publisher hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedPublisherView
void useIsolatedPublisherView()Isolates the view for methods in this session. An isolated view restricts retrievals to this publisher only.- Compliance:
mandatory- This method is must be implemented.
-
reliableSubscriptionNotifications
void reliableSubscriptionNotifications()Reliable notifications are desired. In reliable mode, notifications are to be acknowledged usingacknowledgeSubscriptionNotification().- Compliance:
mandatory- This method is must be implemented.
-
unreliableSubscriptionNotifications
void unreliableSubscriptionNotifications()Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.- Compliance:
mandatory- This method is must be implemented.
-
acknowledgeSubscriptionNotification
void acknowledgeSubscriptionNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a subscription notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewSubscriptions
Register for notifications of new subscriptions.SubscriptionReceiver.newSubscriptions()is invoked when a newSubscriptionis created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewSubscriptionsByGenusType
void registerForNewSubscriptionsByGenusType(Type subscriptionGenusType) throws OperationFailedException, PermissionDeniedException Register for notifications of new subscriptions of the given genus type.SubscriptionReceiver.newSubscriptions()is invoked when a newSubscriptionis created.- Parameters:
subscriptionGenusType- a subscription genus type- Throws:
NullArgumentException-subscriptionGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewSubscriptionsForSubscriber
void registerForNewSubscriptionsForSubscriber(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of new subscriptions for the given resourceId.SubscriptionReceiver.newSubscriptions()is invoked when a newSubscriptionis created.- Parameters:
resourceId- theIdof the reference to monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewSubscriptionsForDispatch
void registerForNewSubscriptionsForDispatch(Id dispatchId) throws OperationFailedException, PermissionDeniedException Register for notifications of new subscriptions for the given referenceId.SubscriptionReceiver.newSubscriptions()is invoked when a newSubscriptionis created.- Parameters:
dispatchId- theIdof the dispatch to monitor- Throws:
NullArgumentException-dispatchIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedSubscriptions
Registers for notification of updated subscriptions.SubscriptionReceiver.changedSubscriptions()is invoked when a subscription is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedSubscriptionsByGenusType
void registerForChangedSubscriptionsByGenusType(Type subscriptionGenusType) throws OperationFailedException, PermissionDeniedException Registers for notification of updated subscriptions of the given genus type.SubscriptionReceiver.changedSubscriptions()is invoked when a subscription is changed.- Parameters:
subscriptionGenusType- a subscription genus type- Throws:
NullArgumentException-subscriptionGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedSubscriptionsForSubscriber
void registerForChangedSubscriptionsForSubscriber(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of changed subscriptions for the given resourceId.SubscriptionReceiver.changedSubscriptions()is invoked when aSubscriptionfor the resource is changed.- Parameters:
resourceId- theIdof the resource to monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedSubscriptionsForDispatch
void registerForChangedSubscriptionsForDispatch(Id dispatchId) throws OperationFailedException, PermissionDeniedException Register for notifications of changed subscriptions for the given dispatchId.SubscriptionReceiver.changedSubscription()is invoked when aSubscriptionfor the dispatch is changed.- Parameters:
dispatchId- theIdof the dispatch to monitor- Throws:
NullArgumentException-dispatchIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedSubscription
void registerForChangedSubscription(Id subscriptionId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated subscription.SubscriptionReceiver.changedSubscriptions()is invoked when the specified subscription is changed.- Parameters:
subscriptionId- theIdof theSubscriptionto monitor- Throws:
NullArgumentException-subscriptionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedSubscriptions
Registers for notification of deleted subscriptions.SubscriptionReceiver.deletedSubscriptions()is invoked when a subscription is deleted.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedSubscriptionsByGenusType
void registerForDeletedSubscriptionsByGenusType(Type subscriptionGenusType) throws OperationFailedException, PermissionDeniedException Registers for notification of deleted subscriptions of the given genus type.SubscriptionReceiver.deletedSubscriptions()is invoked when a subscription is deleted.- Parameters:
subscriptionGenusType- a subscription genus type- Throws:
NullArgumentException-subscriptionGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedSubscriptionsForSubscriber
void registerForDeletedSubscriptionsForSubscriber(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of changed subscriptions for the given subscriberId.SubscriptionReceiver.deletedSubscriptions()is invoked when aSubscriptionfor the resource is deleted.- Parameters:
resourceId- theIdof the resource to monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedSubscriptionsForDispatch
void registerForDeletedSubscriptionsForDispatch(Id dispatchId) throws OperationFailedException, PermissionDeniedException Register for notifications of changed subscriptions for the given dispatchId.SubscriptionReceiver.deletedSubscriptions()is invoked when aSubscriptionfor the dispatch is deleted.- Parameters:
dispatchId- theIdof the dispatch to monitor- Throws:
NullArgumentException-dispatchIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedSubscription
void registerForDeletedSubscription(Id subscriptionId) throws OperationFailedException, PermissionDeniedException Registers for notification of a deleted subscription.SubscriptionReceiver.deletedSubscriptions()is invoked when the specified subscription is deleted.- Parameters:
subscriptionId- theIdof theSubscriptionto monitor- Throws:
NullArgumentException-subscriptionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-