Interface ModelWarehouseAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ModelWarehouseAssignmentSession extends OsidSession

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

  • Method Details

    • canAssignModels

      boolean canAssignModels()
      Tests if this user can alter model/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.
    • canAssignModelToWarehouse

      boolean canAssignModelToWarehouse(Id warehouseId)
      Tests if this user can alter model/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 model 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.
    • getAssignableWarehouseIdsForModel

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

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

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

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