Interface ItemBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ItemBusinessAssignmentSession extends OsidSession

This session provides methods to re-assign Items to Businesses . An Item may appear in multiple Businesses and removing the last reference to an Item is the equivalent of deleting it. Each Business may have its own authorizations governing who is allowed to operate on it.

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

  • Method Details

    • canAssignItems

      boolean canAssignItems()
      Tests if this user can alter item/business 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.
    • canAssignItemToBusiness

      boolean canAssignItemToBusiness(Id businessId)
      Tests if this user can alter item/business 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:
      businessId - the Id of the Business
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - businessId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBusinessIds

      IdList getAssignableBusinessIds(Id businessId) throws OperationFailedException
      Gets a list of businesses including and under the given business node in which any item can be assigned.
      Parameters:
      businessId - the Id of the Business
      Returns:
      list of assignable business Ids
      Throws:
      NullArgumentException - businessId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBusinessIdsForItem

      IdList getAssignableBusinessIdsForItem(Id businessId, Id itemId) throws OperationFailedException
      Gets a list of businesses including and under the given business node in which a specific item can be assigned.
      Parameters:
      businessId - the Id of the Business
      itemId - the Id of the Item
      Returns:
      list of assignable business Ids
      Throws:
      NullArgumentException - businessId or itemId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignItemToBusiness

      void assignItemToBusiness(Id itemId, Id businessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Item to a Business .
      Parameters:
      itemId - the Id of the Item
      businessId - the Id of the Business
      Throws:
      AlreadyExistsException - itemId is already assigned to businessId
      NotFoundException - itemId or businessId not found
      NullArgumentException - itemId or businessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignItemFromBusiness

      void unassignItemFromBusiness(Id itemId, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes an Item from a Business .
      Parameters:
      itemId - the Id of the Item
      businessId - the Id of the Business
      Throws:
      NotFoundException - itemId or businessId not found or itemId not assigned to businessId
      NullArgumentException - itemId or businessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignItemToBusiness

      void reassignItemToBusiness(Id itemId, Id fromBusinessId, Id toBusinessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves an Item from one Business to another. Mappings to other Businesses are unaffected.
      Parameters:
      itemId - the Id of the Item
      fromBusinessId - the Id of the current Business
      toBusinessId - the Id of the destination Business
      Throws:
      AlreadyExistsException - itemId already assigned to toBusinessId
      NotFoundException - itemId, fromBusinessId , or toBusinessId not found or itemId not mapped to fromBusinessId
      NullArgumentException - itemId, fromBusinessId , or toBusinessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.