Interface RuleEngineAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionvoidassignRuleToEngine(Id ruleId, Id engineId) Adds an existingRuleto anEngine.booleanTests if this user can alter rule/engine mappings.booleancanAssignRulesToEngine(Id engineId) Tests if this user can alter rule/engine mappings.getAssignableEngineIds(Id engineId) Gets a list of engines including and under the given engine node in which any rule can be assigned.getAssignableEngineIdsForRule(Id engineId, Id ruleId) Gets a list of engines including and under the given engine node in which a specific rule can be assigned.voidreassignRuleToEngine(Id ruleId, Id fromEngineId, Id toEngineId) Moves aRulefrom oneEngineto another.voidunassignRuleFromEngine(Id ruleId, Id engineId) Removes aRulefrom anEngine.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignRulesToEngine
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
engineId- theIdof theEngine- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-engineIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableEngineIds
Gets a list of engines including and under the given engine node in which any rule can be assigned.- Parameters:
engineId- theIdof theEngine- Returns:
- list of assignable rule
Ids - Throws:
NullArgumentException-engineIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableEngineIdsForRule
Gets a list of engines including and under the given engine node in which a specific rule can be assigned.- Parameters:
engineId- theIdof theEngineruleId- theIdof theEngine- Returns:
- list of assignable engine
Ids - Throws:
NullArgumentException-engineIdorruleIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignRuleToEngine
void assignRuleToEngine(Id ruleId, Id engineId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingRuleto anEngine.- Parameters:
ruleId- theIdof theRuleengineId- theIdof theEngine- Throws:
AlreadyExistsException-ruleIdis already assigned toengineIdNotFoundException-ruleIdorengineIdnot foundNullArgumentException-ruleIdorengineIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignRuleFromEngine
void unassignRuleFromEngine(Id ruleId, Id engineId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aRulefrom anEngine.- Parameters:
ruleId- theIdof theRuleengineId- theIdof theEngine- Throws:
NotFoundException-ruleIdorengineIdnot found orruleIdnot assigned toengineIdNullArgumentException-ruleIdorengineIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignRuleToEngine
void reassignRuleToEngine(Id ruleId, Id fromEngineId, Id toEngineId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aRulefrom oneEngineto another. Mappings to otherEnginesare unaffected.- Parameters:
ruleId- theIdof theRulefromEngineId- theIdof the currentEnginetoEngineId- theIdof the destinationEngine- Throws:
AlreadyExistsException-ruleIdalready assigned totoEngineIdNotFoundException-ruleId, fromEngineId, ortoEngineIdnot found orruleIdnot mapped tofromEngineIdNullArgumentException-ruleId, fromEngineId, ortoEngineIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-