Interface ContactAddressBookAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ContactAddressBookAssignmentSession extends OsidSession

This session provides methods to re-assign Contacts to AddressBooks . A Contact may map to multiple AddressBooks and removing the last reference to a Contact 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 Contact to another AddressBook is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignContacts

      boolean canAssignContacts()
      Tests if this user can alter contact/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 assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignContactsToAddressBook

      boolean canAssignContactsToAddressBook(Id addressBookId)
      Tests if this user can alter contact/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 assignment 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 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.
    • getAssignableAddressBookIdsForContact

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

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

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

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