Interface OrderStoreAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface OrderStoreAssignmentSession extends OsidSession

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

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

  • Method Details

    • canAssignOrders

      boolean canAssignOrders()
      Tests if this user can alter order/store 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.
    • canAssignOrdersToStore

      boolean canAssignOrdersToStore(Id storeId)
      Tests if this user can alter order/store 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.
      Parameters:
      storeId - the Id of the Store
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - storeId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableStoreIds

      IdList getAssignableStoreIds(Id storeId) throws OperationFailedException
      Gets a list of stores including and under the given store node in which any order can be assigned.
      Parameters:
      storeId - the Id of the Store
      Returns:
      list of assignable store Ids
      Throws:
      NullArgumentException - storeId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableStoreIdsForOrder

      IdList getAssignableStoreIdsForOrder(Id storeId, Id orderId) throws OperationFailedException
      Gets a list of stores including and under the given store node in which a specific order can be assigned.
      Parameters:
      storeId - the Id of the Store
      orderId - the Id of the Order
      Returns:
      list of assignable store Ids
      Throws:
      NullArgumentException - storeId or orderId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignOrderToStore

      Adds an existing Order to a Store .
      Parameters:
      orderId - the Id of the Order
      storeId - the Id of the Store
      Throws:
      AlreadyExistsException - orderId is already assigned to storeId
      NotFoundException - orderId or storeId not found
      NullArgumentException - orderId or storeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignOrderFromStore

      void unassignOrderFromStore(Id orderId, Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes an Order from a Store .
      Parameters:
      orderId - the Id of the Order
      storeId - the Id of the Store
      Throws:
      NotFoundException - orderId or storeId not found or orderId not assigned to storeId
      NullArgumentException - orderId or storeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignOrderToStore

      void reassignOrderToStore(Id orderId, Id fromStoreId, Id toStoreId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves an Order from one Store to another. Mappings to other Stores are unaffected.
      Parameters:
      orderId - the Id of the Order
      fromStoreId - the Id of the current Store
      toStoreId - the Id of the destination Store
      Throws:
      AlreadyExistsException - orderId already assigned to storeId
      NotFoundException - orderId, fromStoreId , or toStoreId not found or orderId not mapped to fromStoreId
      NullArgumentException - orderId, fromStoreId , or toStoreId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.