Interface BlockOublietteAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface BlockOublietteAssignmentSession extends OsidSession

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

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

  • Method Details

    • canAssignBlocks

      boolean canAssignBlocks()
      Tests if this user can alter block/oubliette 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 hold is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignBlocksToOubliette

      boolean canAssignBlocksToOubliette(Id oublietteId)
      Tests if this user can alter block/oubliette 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:
      oublietteId - the Id of the Oubliette
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - oublietteId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableOublietteIds

      IdList getAssignableOublietteIds(Id oublietteId) throws OperationFailedException
      Gets a list of oubliettes including and under the given oubliette node in which any block can be assigned.
      Parameters:
      oublietteId - the Id of the Oubliette
      Returns:
      list of assignable oubliette Ids
      Throws:
      NullArgumentException - oublietteId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableOublietteIdsForBlock

      IdList getAssignableOublietteIdsForBlock(Id oublietteId, Id blockId) throws OperationFailedException
      Gets a list of oubliettes including and under the given oubliette node in which a specific block can be assigned.
      Parameters:
      oublietteId - the Id of the Oubliette
      blockId - the Id of the Block
      Returns:
      list of assignable oubliette Ids
      Throws:
      NullArgumentException - oublietteId or blockId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignBlockToOubliette

      void assignBlockToOubliette(Id blockId, Id oublietteId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Block to an Oubliette .
      Parameters:
      blockId - the Id of the Block
      oublietteId - the Id of the Oubliette
      Throws:
      AlreadyExistsException - blockId is already assigned to oublietteId
      NotFoundException - blockId or oublietteId not found
      NullArgumentException - blockId or oublietteId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignBlockFromOubliette

      void unassignBlockFromOubliette(Id blockId, Id oublietteId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Block from an Oubliette .
      Parameters:
      blockId - the Id of the Block
      oublietteId - the Id of the Oubliette
      Throws:
      NotFoundException - blockId or oublietteId not found or blockId is not assigned to oublietteId
      NullArgumentException - blockId or oublietteId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignBlockToOubliette

      void reassignBlockToOubliette(Id blockId, Id fromOublietteId, Id toOublietteId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Block from one Oubliette to another. Mappings to other Oubliettes are unaffected.
      Parameters:
      blockId - the Id of the Block
      fromOublietteId - the Id of the current Oubliette
      toOublietteId - the Id of the destination Oubliette
      Throws:
      AlreadyExistsException - blockId already assigned to toOublietteId
      NotFoundException - blockId, fromOublietteId , or toOublietteId not found or blockId not mapped to fromOublietteId
      NullArgumentException - blockId, fromOublietteId , or toOublietteId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.