Interface ItemWarehouseAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ItemWarehouseAssignmentSession extends OsidSession

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

Adding a reference of an Item to another Warehouse is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignItems

      boolean canAssignItems()
      Tests if this user can alter item/warehouse 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.
    • canAssignItemToWarehouse

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

      IdList getAssignableWarehouseIds(Id warehouseId) throws OperationFailedException
      Gets a list of warehouses including and under the given warehouse node in which any item can be assigned.
      Parameters:
      warehouseId - the Id of the Warehouse
      Returns:
      list of assignable warehouse Ids
      Throws:
      NullArgumentException - warehouseId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableWarehouseIdsForItem

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

      void assignItemToWarehouse(Id itemId, Id warehouseId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Item to a Warehouse .
      Parameters:
      itemId - the Id of the Item
      warehouseId - the Id of the Warehouse
      Throws:
      AlreadyExistsException - itemId is already assigned to warehouseId
      NotFoundException - itemId or warehouseId not found
      NullArgumentException - itemId or warehouseId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignItemFromWarehouse

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

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