Interface PersonNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PersonNotificationSession extends OsidSession

This session defines methods to receive notifications on adds/changes to Person 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

    • getRealmId

      Id getRealmId()
      Gets the Realm Id associated with this session.
      Returns:
      the Realm Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getRealm

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

      boolean canRegisterForPersonNotifications()
      Tests if this user can register for Person 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.
    • useFederatedRealmView

      void useFederatedRealmView()
      Federates the view for methods in this session. A federated view will include notifications for persons in realms which are children of this realm in the realm hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedRealmView

      void useIsolatedRealmView()
      Isolates the view for methods in this session. An isolated view restricts notifications to this realm only.
      Compliance:
      mandatory - This method is must be implemented.
    • reliablePersonNotifications

      void reliablePersonNotifications()
      Reliable notifications are desired. In reliable mode, notifications are to be acknowledged using acknowledgePersonNotification() .
      Compliance:
      mandatory - This method is must be implemented.
    • unreliablePersonNotifications

      void unreliablePersonNotifications()
      Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.
      Compliance:
      mandatory - This method is must be implemented.
    • acknowledgePersonNotification

      void acknowledgePersonNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException
      Acknowledge a person notification.
      Parameters:
      notificationId - the Id of the notification
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewPersons

      void registerForNewPersons() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new persons. PersonReceiver.newPersons() is invoked when a new Person is created.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedPersons

      void registerForChangedPersons() throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated persons. PersonReceiver.changedPersons() is invoked when a person in this realm is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedPerson

      void registerForChangedPerson(Id personId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Registers for notification of an updated person. PersonReceiver.changedPersons() is invoked when the specified person in this realm is changed.
      Parameters:
      personId - the Id of the Person to monitor
      Throws:
      NotFoundException - a person was not found identified by the given Id
      NullArgumentException - personId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedPersons

      void registerForDeletedPersons() throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted persons. PersonReceiver.deletedPersons() is invoked when a person is removed from this realm.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedPerson

      void registerForDeletedPerson(Id personId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Registers for notification of a deleted person. PersonReceiver.deletedPersons() is invoked when the specified person is removed from this realm.
      Parameters:
      personId - the Id of the Person to monitor
      Throws:
      NotFoundException - a person was not found identified by the given Id
      NullArgumentException - personId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.