Interface DemographicBinAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface DemographicBinAssignmentSession extends OsidSession

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

Adding a reference of a Demographic to another Bin is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignDemographics

      boolean canAssignDemographics()
      Tests if this user can alter demographic/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 lookup operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignDemographicsToBin

      boolean canAssignDemographicsToBin(Id binId)
      Tests if this user can alter demographic/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 lookup 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 demographic 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.
    • getAssignableBinIdsForDemographic

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

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

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

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