Interface WarehouseAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface WarehouseAdminSession extends OsidSession

This session creates, updates, and deletes Warehouses . The data for create and update is provided by the consumer via the form object. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Warehouse , a WarehouseForm is requested using getWarehouseFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned WarehouseForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the WarehouseForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each WarehouseForm corresponds to an attempted transaction.

For updates, WarehouseForms are requested to the Warehouse Id that is to be updated using getWarehouseFormForUpdate() . Similarly, the WarehouseForm has metadata about the data that can be updated and it can perform validation before submitting the update. The WarehouseForm can only be used once for a successful update and cannot be reused.

The delete operations delete Warehouses .

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • canCreateWarehouses

      boolean canCreateWarehouses()
      Tests if this user can create Warehouses . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Warehouse . will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Returns:
      false if Warehouse creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateWarehouseWithRecordTypes

      boolean canCreateWarehouseWithRecordTypes(Type[] warehouseRecordTypes)
      Tests if this user can create a single Warehouse using the desired record types. While InventoryManager.getWarehouseRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Warehouse . Providing an empty array tests if a Warehouse can be created with no records.
      Parameters:
      warehouseRecordTypes - array of warehouse record types
      Returns:
      true if Warehouse creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - warehouseRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getWarehouseFormForCreate

      WarehouseForm getWarehouseFormForCreate(Type[] warehouseRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the warehouse form for creating new warehouses. A new form should be requested for each create transaction.
      Parameters:
      warehouseRecordTypes - array of warehouse record types
      Returns:
      the warehouse form
      Throws:
      NullArgumentException - warehouseRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createWarehouse

      Creates a new Warehouse .
      Parameters:
      warehouseForm - the form for this Warehouse
      Returns:
      the new Warehouse
      Throws:
      IllegalStateException - warehouseForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - warehouseForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - warehouseForm did not originate from getWarehouseFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateWarehouses

      boolean canUpdateWarehouses()
      Tests if this user can update Warehouses . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Warehouse will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if Warehouse modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getWarehouseFormForUpdate

      WarehouseForm getWarehouseFormForUpdate(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the warehouse form for updating an existing warehouse. A new warehouse form should be requested for each update transaction.
      Parameters:
      warehouseId - the Id of the Warehouse
      Returns:
      the warehouse form
      Throws:
      NotFoundException - warehouseId is not found
      NullArgumentException - warehouseId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateWarehouse

      void updateWarehouse(WarehouseForm warehouseForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing warehouse.
      Parameters:
      warehouseForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - warehouseForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - warehouseForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - warehouseForm did not originate from getWarehouseFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteWarehouses

      boolean canDeleteWarehouses()
      Tests if this user can delete Warehouses . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Warehouse will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
      Returns:
      false if Warehouse deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteWarehouse

      void deleteWarehouse(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a Warehouse .
      Parameters:
      warehouseId - the Id of the Warehouse to remove
      Throws:
      NotFoundException - warehouseId not found
      NullArgumentException - warehouseId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageWarehouseAliases

      boolean canManageWarehouseAliases()
      Tests if this user can manage Id aliases for Warehouses . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if Warehouse aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasWarehouse

      Adds an Id to a Warehouse for the purpose of creating compatibility. The primary Id of the Warehouse is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another warehouse, it is reassigned to the given warehouse Id .
      Parameters:
      warehouseId - the Id of a Warehouse
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - aliasId is in use as a primary Id
      NullArgumentException - warehouseId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.