Interface AddressAddressBookAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface AddressAddressBookAssignmentSession extends OsidSession

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

  • Method Details

    • canAssignAddresses

      boolean canAssignAddresses()
      Tests if this user can alter address/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.
    • canAssignAddressesToAddressBook

      boolean canAssignAddressesToAddressBook(Id addressBookId)
      Tests if this user can alter address/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 address 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.
    • getAssignableAddressBookIdsForAddress

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

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

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

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