Interface CreditNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on adds/changes
to Credit objects. 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 TypeMethodDescriptionvoidacknowledgeCreditNotification(Id notificationId) Acknowledge a credit notification.booleanTests if this user can register forCreditnotifications.Gets theBillingassociated with this session.Gets theBillingIdassociated with this session.voidregisterForChangedCredit(Id creditId) Registers for notification of an updated credit.voidRegisters for notification of updated credits.voidregisterForChangedCreditsByGenusType(Type creditGenusType) Register for notifications of changed credits by the given credit gfenusType.voidregisterForChangedCreditsForReference(Id referenceId) Register for notifications of changed credits for the given referenceId.voidregisterForChangedCreditsForResource(Id resourceId) Register for notifications of changed credits for the given resourceId.voidregisterForDeletedCredit(Id creditId) Registers for notification of a deleted credit.voidRegisters for notification of deleted credits.voidregisterForDeletedCreditsByGenusType(Type creditGenusType) Register for notifications of deleted credits by the credit genusType.voidregisterForDeletedCreditsForReference(Id referenceId) Register for notifications of deleted credits for the given referenceId.voidregisterForDeletedCreditsForResource(Id resourceId) Register for notifications of deleted credits for the given resourceId.voidRegister for notifications of new credits.voidregisterForNewCreditsByGenusType(Type creditGenusType) Register for notifications of new credits by the given credit genusType.voidregisterForNewCreditsForReference(Id referenceId) Register for notifications of new credits for the given referenceId.voidregisterForNewCreditsForResource(Id resourceId) Register for notifications of new credits 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
-
getBillingId
Id getBillingId()Gets theBillingIdassociated with this session.- Returns:
- the
Billing Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBilling
Gets theBillingassociated with this session.- Returns:
- the billing
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForCreditNotifications
boolean canRegisterForCreditNotifications()Tests if this user can register forCreditnotifications. 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.
-
useFederatedBillingView
void useFederatedBillingView()Federates the view for methods in this session. A federated view will include notifications for credits in billings which are children of this billing in the billing hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedBillingView
void useIsolatedBillingView()Isolates the view for methods in this session. An isolated view restricts notifications to this billing only.- Compliance:
mandatory- This method is must be implemented.
-
reliableCreditNotifications
void reliableCreditNotifications()Reliable notifications are desired. In reliable mode, notifications are to be acknowledged usingacknowledgeCreditNotification().- Compliance:
mandatory- This method is must be implemented.
-
unreliableCreditNotifications
void unreliableCreditNotifications()Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.- Compliance:
mandatory- This method is must be implemented.
-
acknowledgeCreditNotification
void acknowledgeCreditNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a credit notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewCredits
Register for notifications of new credits.CreditReceiver.newCredits()is invoked when a newCreditis created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewCreditsByGenusType
void registerForNewCreditsByGenusType(Type creditGenusType) throws OperationFailedException, PermissionDeniedException Register for notifications of new credits by the given credit genusType.CreditReceiver.newCredits()is invoked when a newCreditappears in this billing.- Parameters:
creditGenusType- theIdof the reference to monitor- Throws:
NullArgumentException-creditGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewCreditsForReference
void registerForNewCreditsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException Register for notifications of new credits for the given referenceId.CreditReceiver.newCredits()is invoked when a newCreditappears in this billing.- Parameters:
referenceId- the reference to monitor- Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewCreditsForResource
void registerForNewCreditsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of new credits for the given resourceId.CreditReceiver.newCredits()is invoked when a newCreditappears in this billing.- Parameters:
resourceId- theIdof the resource to monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedCredits
Registers for notification of updated credits.CreditReceiver.changedCredits()is invoked when a credit in this billing is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedCreditsByGenusType
void registerForChangedCreditsByGenusType(Type creditGenusType) throws OperationFailedException, PermissionDeniedException Register for notifications of changed credits by the given credit gfenusType.CreditReceiver.changedCredits()is invoked when aCreditfor the reference in this billing is changed.- Parameters:
creditGenusType- the genus type of the credit to monitor- Throws:
NullArgumentException-creditGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedCreditsForReference
void registerForChangedCreditsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException Register for notifications of changed credits for the given referenceId.CreditReceiver.changedCredits()is invoked when aCreditfor the reference in this billing is changed.- Parameters:
referenceId- theIdof the reference to monitor- Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedCreditsForResource
void registerForChangedCreditsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of changed credits for the given resourceId.CreditReceiver.changedCredits()is invoked when aCreditfor the resource is changed in this billing.- Parameters:
resourceId- theIdof the resource to monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedCredit
void registerForChangedCredit(Id creditId) throws NotFoundException, OperationFailedException, PermissionDeniedException Registers for notification of an updated credit.CreditReceiver.changedCredits()is invoked when the specified credit in this billing is changed.- Parameters:
creditId- theIdof theCreditto monitor- Throws:
NotFoundException- a credit was not found identified by the givenIdNullArgumentException-creditIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedCredits
Registers for notification of deleted credits.CreditReceiver.deletedCredit()is invoked when a credit is removed from this billing.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedCreditsByGenusType
void registerForDeletedCreditsByGenusType(Type creditGenusType) throws OperationFailedException, PermissionDeniedException Register for notifications of deleted credits by the credit genusType.CreditReceiver.deletedCredit()is invoked when aCreditfor the reference is removed from this billing.- Parameters:
creditGenusType- the genus type of the credit to monitor- Throws:
NullArgumentException-creditGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedCreditsForReference
void registerForDeletedCreditsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException Register for notifications of deleted credits for the given referenceId.CreditReceiver.deletedCredit()is invoked when aCreditfor the reference is removed from this billing.- Parameters:
referenceId- theIdof the reference to monitor- Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedCreditsForResource
void registerForDeletedCreditsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of deleted credits for the given resourceId.CreditReceiver.deletedCredit()is invoked when aCreditfor the resource is removed from this billing.- Parameters:
resourceId- theIdof the resource to monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedCredit
void registerForDeletedCredit(Id creditId) throws NotFoundException, OperationFailedException, PermissionDeniedException Registers for notification of a deleted credit.CreditReceiver.deletedCredit()is invoked when the specified credit is removed from this billing.- Parameters:
creditId- theIdof theCreditto monitor- Throws:
NotFoundException- a credit was not found identified by the givenIdNullArgumentException-creditIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-