Interface ProductStoreAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ProductStoreAssignmentSession extends OsidSession

This session provides methods to re-assign Products to Stores . A Product may map to multiple Stores and removing the last reference to a Product 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 a Product to another Store is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignProducts

      boolean canAssignProducts()
      Tests if this user can alter product/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.
    • canAssignProductsToStore

      boolean canAssignProductsToStore(Id storeId)
      Tests if this user can alter product/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 product 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.
    • getAssignableStoreIdsForProduct

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

      void assignProductToStore(Id productId, Id storeId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Product to a Store .
      Parameters:
      productId - the Id of the Product
      storeId - the Id of the Store
      Throws:
      AlreadyExistsException - productId is already assigned to storeId
      NotFoundException - productId or storeId not found
      NullArgumentException - productId or storeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignProductFromStore

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

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