Interface InstructionEngineAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface InstructionEngineAssignmentSession extends OsidSession

This session provides methods to re-assign Instructions to Engine mappings. An Instruction may appear in multiple Engine objects and removing the last reference to an Instruction is the equivalent of deleting it. Each Engine may have its own authorizations governing who is allowed to operate on it.

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

  • Method Details

    • canAssignInstructions

      boolean canAssignInstructions()
      Tests if this user can alter instruction/engine 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 instruction is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignInstructionsToEngine

      boolean canAssignInstructionsToEngine(Id engineId)
      Tests if this user can alter instruction/engine 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:
      engineId - the Id of the Engine
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - engineId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableEngineIds

      IdList getAssignableEngineIds(Id engineId) throws OperationFailedException
      Gets a list of engines including and under the given engine node in which any instruction can be assigned.
      Parameters:
      engineId - the Id of the Engine
      Returns:
      list of assignable engine Ids
      Throws:
      NullArgumentException - engineId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableEngineIdsForInstruction

      IdList getAssignableEngineIdsForInstruction(Id engineId, Id instructionId) throws OperationFailedException
      Gets a list of engines including and under the given engine node in which a specific instruction can be assigned.
      Parameters:
      engineId - the Id of the Engine
      instructionId - the Id of the Instruction
      Returns:
      list of assignable engine Ids
      Throws:
      NullArgumentException - engineId or instructionId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignInstructionToEngine

      void assignInstructionToEngine(Id instructionId, Id engineId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Instruction to a Engine .
      Parameters:
      instructionId - the Id of the Instruction
      engineId - the Id of the Engine
      Throws:
      AlreadyExistsException - instructionId is already assigned to engineId
      NotFoundException - instructionId or engineId not found
      NullArgumentException - instructionId or engineId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignInstructionFromEngine

      void unassignInstructionFromEngine(Id instructionId, Id engineId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes an Instruction from a Engine .
      Parameters:
      instructionId - the Id of the Instruction
      engineId - the Id of the Engine
      Throws:
      NotFoundException - instructionId or engineId not found or instructionId not assigned to engineId
      NullArgumentException - instructionId or engineId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignInstructionToEngine

      void reassignInstructionToEngine(Id instructionId, Id fromEngineId, Id toEngineId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves an Instruction from one Engine to another. Mappings to other Engines are unaffected.
      Parameters:
      instructionId - the Id of the Instruction
      fromEngineId - the Id of the current Engine
      toEngineId - the Id of the destination Engine
      Throws:
      AlreadyExistsException - instructionId already assigned to toEngineId
      NotFoundException - instructionId, fromEngineId , or toEngineId not found or instructionId not mapped to fromEngineId
      NullArgumentException - instructionId, fromEngineId , or toEngineId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.