Interface StockWarehouseAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface StockWarehouseAssignmentSession extends OsidSession

This session provides methods to re-assign Stocks to Warehouses . A Stock may appear in multiple Warehouse objects and removing the last reference to a Stock 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 a Stock to another Warehouse is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignStocks

      boolean canAssignStocks()
      Tests if this user can alter stock/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.
    • canAssignStockToWarehouse

      boolean canAssignStockToWarehouse(Id warehouseId)
      Tests if this user can alter stock/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 stock 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.
    • getAssignableWarehouseIdsForStock

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

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

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

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