Interface ContactEnablerAddressBookAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ContactEnablerAddressBookAssignmentSession extends OsidSession

This session provides methods to re-assign ContactEnabler to AddressBook mappings. A ContactEnabler may appear in multiple AddressBook objects and removing the last reference to a ContactEnabler is the equivalent of deleting it. Each AddressBook may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a ContactEnabler to another AddressBook is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignContactEnablers

      boolean canAssignContactEnablers()
      Tests if this user can alter contact enabler/address book mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping 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 lookup operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignContactEnablersToAddressBook

      boolean canAssignContactEnablersToAddressBook(Id addressBookId)
      Tests if this user can alter contact enabler/address book mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping 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 lookup operations to unauthorized users.
      Parameters:
      addressBookId - the Id of the AddressBook
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - addressBookId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableAddressBookIds

      IdList getAssignableAddressBookIds(Id addressBookId) throws OperationFailedException
      Gets a list of address books including and under the given address book node in which any contact enabler can be assigned.
      Parameters:
      addressBookId - the Id of the AddressBook
      Returns:
      list of assignable address book Ids
      Throws:
      NullArgumentException - addressBookId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableAddressBookIdsForContactEnabler

      IdList getAssignableAddressBookIdsForContactEnabler(Id addressBookId, Id contactEnablerId) throws OperationFailedException
      Gets a list of address books including and under the given address book node in which a specific contact enabler can be assigned.
      Parameters:
      addressBookId - the Id of the AddressBook
      contactEnablerId - the Id of the ContactEnabler
      Returns:
      list of assignable address book Ids
      Throws:
      NullArgumentException - addressBookId or contactEnablerId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignContactEnablerToAddressBook

      void assignContactEnablerToAddressBook(Id contactEnablerId, Id addressBookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing ContactEnabler to an AddressBook .
      Parameters:
      contactEnablerId - the Id of the ContactEnabler
      addressBookId - the Id of the AddressBook
      Throws:
      AlreadyExistsException - contactEnablerId is already assigned to addressBookId
      NotFoundException - contactEnablerId or addressBookId not found
      NullArgumentException - contactEnablerId or addressBookId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignContactEnablerFromAddressBook

      void unassignContactEnablerFromAddressBook(Id contactEnablerId, Id addressBookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a ContactEnabler from an AddressBook .
      Parameters:
      contactEnablerId - the Id of the ContactEnabler
      addressBookId - the Id of the AddressBook
      Throws:
      NotFoundException - contactEnablerId or addressBookId not found or contactEnablerId is not assigned to addressBookId
      NullArgumentException - contactEnablerId or addressBookId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignContactEnablerToAddressBook

      void reassignContactEnablerToAddressBook(Id contactEnablerId, Id fromAddressBookId, Id toAddressBookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a ContactEnabler from one AddressBook to another. Mappings to other AddressBooks are unaffected.
      Parameters:
      contactEnablerId - the Id of the ContactEnabler
      fromAddressBookId - the Id of the current AddressBook
      toAddressBookId - the Id of the destination AddressBook
      Throws:
      AlreadyExistsException - contactEnablerId already assigned to toAddressBookId
      NotFoundException - contactEnablerId, fromAddressBookId , or toAddressBookId not found or contactEnablerId not mapped to fromAddressBookId
      NullArgumentException - contactEnablerId, fromAddressBookId , or toAddressBookId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.