Interface RuleEngineAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface RuleEngineAssignmentSession extends OsidSession

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

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

  • Method Details

    • canAssignRules

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

      boolean canAssignRulesToEngine(Id engineId)
      Tests if this user can alter rule/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 assignment 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 rule can be assigned.
      Parameters:
      engineId - the Id of the Engine
      Returns:
      list of assignable rule Ids
      Throws:
      NullArgumentException - engineId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableEngineIdsForRule

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

      Adds an existing Rule to an Engine .
      Parameters:
      ruleId - the Id of the Rule
      engineId - the Id of the Engine
      Throws:
      AlreadyExistsException - ruleId is already assigned to engineId
      NotFoundException - ruleId or engineId not found
      NullArgumentException - ruleId or engineId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignRuleFromEngine

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

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