Interface ResourceBinAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ResourceBinAssignmentSession extends OsidSession

This session provides methods to re-assign Resources to Bins . A Resource may map to multiple Bin objects and removing the last reference to a Resource is the equivalent of deleting it. Each Bin may have its own authorizations governing who is allowed to operate on it.

Moving or adding a reference of a Resource to another Bin is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignResources

      boolean canAssignResources()
      Tests if this user can alter resource/bin 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.
    • canAssignResourcesToBin

      boolean canAssignResourcesToBin(Id binId)
      Tests if this user can alter resource/bin 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:
      binId - the Id of the Bin
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - binId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBinIds

      IdList getAssignableBinIds(Id binId) throws OperationFailedException
      Gets a list of bins including and under the given bin node in which any resource can be assigned.
      Parameters:
      binId - the Id of the Bin
      Returns:
      list of assignable bin Ids
      Throws:
      NullArgumentException - binId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBinIdsForResource

      IdList getAssignableBinIdsForResource(Id binId, Id resourceId) throws OperationFailedException
      Gets a list of bins including and under the given bin node in which a specific resource can be assigned.
      Parameters:
      binId - the Id of the Bin
      resourceId - the Id of the Resource
      Returns:
      list of assignable bin Ids
      Throws:
      NullArgumentException - binId or resourceId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignResourceToBin

      void assignResourceToBin(Id resourceId, Id binId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Resource to a Bin .
      Parameters:
      resourceId - the Id of the Resource
      binId - the Id of the Bin
      Throws:
      AlreadyExistsException - resourceId is already assigned to binId
      NotFoundException - resourceId or binId not found
      NullArgumentException - resourceId or binId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignResourceFromBin

      void unassignResourceFromBin(Id resourceId, Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Resource from a Bin .
      Parameters:
      resourceId - the Id of the Resource
      binId - the Id of the Bin
      Throws:
      NotFoundException - resourceId or binId not found or resourceId not assigned to binId
      NullArgumentException - resourceId or binId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignResourceToBin

      void reassignResourceToBin(Id resourceId, Id fromBinId, Id toBinId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Resource from one Bin to another. Mappings to other Bins are unaffected.
      Parameters:
      resourceId - the Id of the Resource
      fromBinId - the Id of the current Bin
      toBinId - the Id of the destination Bin
      Throws:
      AlreadyExistsException - resourceId already assigned to toBinId
      NotFoundException - resourceId, fromBinId , or toBinId not found or resourceId not mapped to fromBinId
      NullArgumentException - resourceId, fromBinId , or toBinId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.