Interface ItemBankAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ItemBankAssignmentSession extends OsidSession

This session provides methods to re-assign Items to Banks . An Item may map to multiple Banks and removing the last reference to an Item is the equivalent of deleting it. Each Bank may have its own authorizations governing who is allowed to operate on it.

Moving or adding a reference of an Item to another Bank is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignItems

      boolean canAssignItems()
      Tests if this user can alter item/bank mappings. A return of true does not guarantee successful assessment. 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.
    • canAssignItemsToBank

      boolean canAssignItemsToBank(Id bankId)
      Tests if this user can alter item/bank 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:
      bankId - the Id of the Bank
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - bankId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBankIds

      IdList getAssignableBankIds(Id bankId) throws OperationFailedException
      Gets a list of banks including and under the given bank node in which any item can be assigned.
      Parameters:
      bankId - the Id of the Bank
      Returns:
      list of assignable bank Ids
      Throws:
      NullArgumentException - bankId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBankIdsForItem

      IdList getAssignableBankIdsForItem(Id bankId, Id itemId) throws OperationFailedException
      Gets a list of banks including and under the given bank node in which a specific item can be assigned.
      Parameters:
      bankId - the Id of the Bank
      itemId - the Id of the Item
      Returns:
      list of assignable bank Ids
      Throws:
      NullArgumentException - bankId or itemId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignItemToBank

      Adds an existing Item to a Bank .
      Parameters:
      itemId - the Id of the Item
      bankId - the Id of the Bank
      Throws:
      AlreadyExistsException - itemId is already assigned to bankId
      NotFoundException - itemId or bankId not found
      NullArgumentException - itemId or bankId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      Compliance:
      mandatory - This method must be implemented.
    • unassignItemFromBank

      void unassignItemFromBank(Id itemId, Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes an Item from a Bank .
      Parameters:
      itemId - the Id of the Item
      bankId - the Id of the Bank
      Throws:
      NotFoundException - itemId or bankId not found or itemId not assigned to bankId
      NullArgumentException - itemId or bankId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      Compliance:
      mandatory - This method must be implemented.
    • reassignItemToBank

      void reassignItemToBank(Id itemId, Id fromBankId, Id toBankId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves an Item from one Bank to another. Mappings to other Banks are unaffected.
      Parameters:
      itemId - the Id of the Item
      fromBankId - the Id of the current Bank
      toBankId - the Id of the destination Bank
      Throws:
      AlreadyExistsException - itemId already assigned to toBankId
      NotFoundException - itemId, fromBankId , or toBankId not found or itemId not mapped to fromBankId
      NullArgumentException - itemId, fromBankId , or toBankId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.