Interface CreditNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CreditNotificationSession extends 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 Details

    • getBillingId

      Id getBillingId()
      Gets the Billing Id associated with this session.
      Returns:
      the Billing Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBilling

      Gets the Billing associated with this session.
      Returns:
      the billing
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canRegisterForCreditNotifications

      boolean canRegisterForCreditNotifications()
      Tests if this user can register for Credit notifications. 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer notification operations.
      Returns:
      false if notification methods are not authorized, true otherwise
      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 using acknowledgeCreditNotification() .
      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 - the Id of the notification
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewCredits

      void registerForNewCredits() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new credits. CreditReceiver.newCredits() is invoked when a new Credit is created.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 genus Type . CreditReceiver.newCredits() is invoked when a new Credit appears in this billing.
      Parameters:
      creditGenusType - the Id of the reference to monitor
      Throws:
      NullArgumentException - creditGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 reference Id . CreditReceiver.newCredits() is invoked when a new Credit appears in this billing.
      Parameters:
      referenceId - the reference to monitor
      Throws:
      NullArgumentException - referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 resource Id . CreditReceiver.newCredits() is invoked when a new Credit appears in this billing.
      Parameters:
      resourceId - the Id of the resource to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedCredits

      void registerForChangedCredits() throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated credits. CreditReceiver.changedCredits() is invoked when a credit in this billing is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 gfenus Type . CreditReceiver.changedCredits() is invoked when a Credit for the reference in this billing is changed.
      Parameters:
      creditGenusType - the genus type of the credit to monitor
      Throws:
      NullArgumentException - creditGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 reference Id . CreditReceiver.changedCredits() is invoked when a Credit for the reference in this billing is changed.
      Parameters:
      referenceId - the Id of the reference to monitor
      Throws:
      NullArgumentException - referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 resource Id . CreditReceiver.changedCredits() is invoked when a Credit for the resource is changed in this billing.
      Parameters:
      resourceId - the Id of the resource to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - the Id of the Credit to monitor
      Throws:
      NotFoundException - a credit was not found identified by the given Id
      NullArgumentException - creditId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedCredits

      void registerForDeletedCredits() throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted credits. CreditReceiver.deletedCredit() is invoked when a credit is removed from this billing.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 genus Type . CreditReceiver.deletedCredit() is invoked when a Credit for the reference is removed from this billing.
      Parameters:
      creditGenusType - the genus type of the credit to monitor
      Throws:
      NullArgumentException - creditGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 reference Id . CreditReceiver.deletedCredit() is invoked when a Credit for the reference is removed from this billing.
      Parameters:
      referenceId - the Id of the reference to monitor
      Throws:
      NullArgumentException - referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 resource Id . CreditReceiver.deletedCredit() is invoked when a Credit for the resource is removed from this billing.
      Parameters:
      resourceId - the Id of the resource to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - the Id of the Credit to monitor
      Throws:
      NotFoundException - a credit was not found identified by the given Id
      NullArgumentException - creditId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.