Class DirectlyEvaluatedClockworkPolicyRuleImpl
java.lang.Object
com.evolveum.midpoint.repo.common.policy.BaseEvaluatedPolicyRuleImpl
com.evolveum.midpoint.model.impl.lens.DirectlyEvaluatedClockworkPolicyRuleImpl
- All Implemented Interfaces:
DirectlyEvaluatedClockworkPolicyRule,EvaluatedClockworkPolicyRule,EvaluatedPolicyRule,DebugDumpable,Serializable,Cloneable
public class DirectlyEvaluatedClockworkPolicyRuleImpl
extends BaseEvaluatedPolicyRuleImpl
implements DirectlyEvaluatedClockworkPolicyRule
A (single) implementation of
DirectlyEvaluatedClockworkPolicyRule.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.model.api.context.DirectlyEvaluatedClockworkPolicyRule
DirectlyEvaluatedClockworkPolicyRule.TargetType -
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionDirectlyEvaluatedClockworkPolicyRuleImpl(@NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull String ruleId, @Nullable AssignmentPath ruleAssignmentPath, @NotNull DirectlyEvaluatedClockworkPolicyRule.TargetType targetType) DirectlyEvaluatedClockworkPolicyRuleImpl(@NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull String ruleId, @Nullable AssignmentPath ruleAssignmentPath, @NotNull DirectlyEvaluatedClockworkPolicyRule.TargetType targetType, ActivityPolicyRule activityPolicyRule) DirectlyEvaluatedClockworkPolicyRuleImpl(@NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull String ruleId, @Nullable AssignmentPath ruleAssignmentPath, @Nullable EvaluatedAssignmentImpl<?> originatingAssignment, @NotNull DirectlyEvaluatedClockworkPolicyRule.TargetType targetType) DirectlyEvaluatedClockworkPolicyRuleImpl(@NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull String ruleId, @Nullable AssignmentPath ruleAssignmentPath, @Nullable EvaluatedAssignmentImpl<?> originatingAssignment, @NotNull DirectlyEvaluatedClockworkPolicyRule.TargetType targetType, ActivityPolicyRule activityPolicyRule) -
Method Summary
Modifier and TypeMethodDescriptionclone()voidcomputeEnabledActions(@Nullable PolicyRuleEvaluationContext<?> rctx, PrismObject<?> object, Task task, OperationResult result) Call only after "triggered" status was determined.debugDump(int indent) booleangetCount()@NotNull List<? extends PolicyActionConfigItem<?>>Returns all enabled actions.@Nullable EvaluatedAssignmentImpl<?>The assignment that brought this policy rule to the focus or to the assignment target object.@NotNull Collection<EvaluatedExclusionTrigger>Returns all exclusion triggers that are relevant for the assignment owning this direct/foreign rule.@Nullable AssignmentPathInformation about exact place where the rule was found.@NotNull AssignmentPathTo which object is the policy rule targeted and how.inthashCode()booleanWas the rule already evaluated?booleanisGlobal()Is this a global policy rule?voidvoidvoid@NotNull Collection<EvaluatedPolicyRuleType>toEvaluatedPolicyRuleBeans(@NotNull PolicyRuleExternalizationOptions options, @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector) Serializes the policy rule into bean form (EvaluatedPolicyRuleType)Returns short, (more or less) user-level characterization of this object.toString()Methods inherited from class com.evolveum.midpoint.repo.common.policy.BaseEvaluatedPolicyRuleImpl
extractMessages, extractShortMessages, getAllTriggers, getAllTriggers, getPolicyRuleConfigItem, getPolicySituation, getRuleIdentifier, getTriggers, isTriggered, setTriggers, triggerMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.model.api.context.DirectlyEvaluatedClockworkPolicyRule
getAssignmentPath, isApplicableToAssignment, isApplicableToFocusObject, isApplicableToProjectionMethods inherited from interface com.evolveum.midpoint.model.api.context.EvaluatedClockworkPolicyRule
getAssignmentOverride, getAssignmentOverrideShortDump, getEvaluatedAssignment, getRelevantTriggersFilter, isTriggeredMethods inherited from interface com.evolveum.midpoint.repo.common.policy.EvaluatedPolicyRule
containsEnabledAction, containsEnabledAction, extractMessages, extractShortMessages, getActions, getAllEventMarksOids, getAllTriggers, getAllTriggers, getEnabledAction, getEnabledActions, getName, getOrder, getPolicyConstraints, getPolicyMarkRef, getPolicyRuleBean, getPolicyRuleConfigItem, getPolicySituation, getPolicyThreshold, getRawActions, getRuleIdentifier, getRuleOrigin, getTriggers, hasSituationConstraint, hasThreshold, isContainedIn, isOverThreshold, trigger, trigger
-
Constructor Details
-
DirectlyEvaluatedClockworkPolicyRuleImpl
public DirectlyEvaluatedClockworkPolicyRuleImpl(@NotNull @NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull @NotNull String ruleId, @Nullable @Nullable AssignmentPath ruleAssignmentPath, @NotNull @NotNull DirectlyEvaluatedClockworkPolicyRule.TargetType targetType) -
DirectlyEvaluatedClockworkPolicyRuleImpl
public DirectlyEvaluatedClockworkPolicyRuleImpl(@NotNull @NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull @NotNull String ruleId, @Nullable @Nullable AssignmentPath ruleAssignmentPath, @NotNull @NotNull DirectlyEvaluatedClockworkPolicyRule.TargetType targetType, ActivityPolicyRule activityPolicyRule) -
DirectlyEvaluatedClockworkPolicyRuleImpl
public DirectlyEvaluatedClockworkPolicyRuleImpl(@NotNull @NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull @NotNull String ruleId, @Nullable @Nullable AssignmentPath ruleAssignmentPath, @Nullable @Nullable EvaluatedAssignmentImpl<?> originatingAssignment, @NotNull @NotNull DirectlyEvaluatedClockworkPolicyRule.TargetType targetType) -
DirectlyEvaluatedClockworkPolicyRuleImpl
public DirectlyEvaluatedClockworkPolicyRuleImpl(@NotNull @NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull @NotNull String ruleId, @Nullable @Nullable AssignmentPath ruleAssignmentPath, @Nullable @Nullable EvaluatedAssignmentImpl<?> originatingAssignment, @NotNull @NotNull DirectlyEvaluatedClockworkPolicyRule.TargetType targetType, ActivityPolicyRule activityPolicyRule)
-
-
Method Details
-
clone
-
getActivityPath
- Specified by:
getActivityPathin interfaceEvaluatedPolicyRule
-
setCount
- Specified by:
setCountin interfaceEvaluatedPolicyRule- Overrides:
setCountin classBaseEvaluatedPolicyRuleImpl
-
isGlobal
public boolean isGlobal()Description copied from interface:EvaluatedClockworkPolicyRuleIs this a global policy rule?- Specified by:
isGlobalin interfaceEvaluatedClockworkPolicyRule
-
getRuleAssignmentPath
Description copied from interface:DirectlyEvaluatedClockworkPolicyRuleInformation about exact place where the rule was found. This can be important for rules that are indirectly attached to an assignment. An example: Let `Engineer` induce `Employee` which conflicts with `Contractor`. The SoD rule is attached to `Employee`. But let the user have assignments for `Engineer` and `Contractor` only. When evaluating `Engineer` assignment, we find a (indirectly attached) SoD rule. But we need to know it came from `Employee`. This is what `assignmentPath` (`Engineer`->`Employee`->(maybe some metarole)->rule) is for. For global policy rules, `assignmentPath` is the path to the target object that matched global policy rule. See alsoDirectlyEvaluatedClockworkPolicyRule.getTargetType(). It can null for artificially-created policy rules e.g. in task validity cases. TODO To be reviewed.- Specified by:
getRuleAssignmentPathin interfaceDirectlyEvaluatedClockworkPolicyRule
-
getRuleAssignmentPathRequired
-
getOriginatingAssignment
Description copied from interface:EvaluatedClockworkPolicyRuleThe assignment that brought this policy rule to the focus or to the assignment target object. May be missing e.g. for object-related global policy rules or object collection related policy rules. (Note that assignment-related global policy rules have a value here.)- Specified by:
getOriginatingAssignmentin interfaceEvaluatedClockworkPolicyRule
-
getRelevantExclusionTriggers
Description copied from interface:EvaluatedClockworkPolicyRuleReturns all exclusion triggers that are relevant for the assignment owning this direct/foreign rule.- Specified by:
getRelevantExclusionTriggersin interfaceEvaluatedClockworkPolicyRule- See Also:
-
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable- Overrides:
debugDumpin classBaseEvaluatedPolicyRuleImpl
-
toString
-
toShortString
Description copied from interface:EvaluatedClockworkPolicyRuleReturns short, (more or less) user-level characterization of this object.- Specified by:
toShortStringin interfaceEvaluatedClockworkPolicyRule
-
toEvaluatedPolicyRuleBeans
@NotNull public @NotNull Collection<EvaluatedPolicyRuleType> toEvaluatedPolicyRuleBeans(@NotNull @NotNull PolicyRuleExternalizationOptions options, @Nullable @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector) Description copied from interface:EvaluatedPolicyRuleSerializes the policy rule into bean form (EvaluatedPolicyRuleType). - Serializes only triggered rules. - For sitation rules with are both hidden and final, serializes the inner rules. (TODO why should that be?) TODO consider if we cannot merge trigger selector with the options- Specified by:
toEvaluatedPolicyRuleBeansin interfaceEvaluatedPolicyRule- Parameters:
options- Options - how the serialization should take place.triggerSelector- Which triggers should be processed?
-
getEnabledActions
Description copied from interface:EvaluatedPolicyRuleReturns all enabled actions. Fails if they were not computed yet. TODO clockwork vs other policy rules- Specified by:
getEnabledActionsin interfaceEvaluatedPolicyRule- Overrides:
getEnabledActionsin classBaseEvaluatedPolicyRuleImpl
-
computeEnabledActions
public void computeEnabledActions(@Nullable @Nullable PolicyRuleEvaluationContext<?> rctx, PrismObject<?> object, Task task, OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException Call only after "triggered" status was determined. -
getCount
- Specified by:
getCountin interfaceEvaluatedPolicyRule- Overrides:
getCountin classBaseEvaluatedPolicyRuleImpl
-
getTargetType
Description copied from interface:DirectlyEvaluatedClockworkPolicyRuleTo which object is the policy rule targeted and how. SeeDirectlyEvaluatedClockworkPolicyRule.TargetTypefor detailed explanation.- Specified by:
getTargetTypein interfaceDirectlyEvaluatedClockworkPolicyRule
-
registerAsForeignRuleIfNeeded
public void registerAsForeignRuleIfNeeded() -
setEvaluated
public void setEvaluated() -
isEvaluated
public boolean isEvaluated()Description copied from interface:EvaluatedClockworkPolicyRuleWas the rule already evaluated?- Specified by:
isEvaluatedin interfaceEvaluatedClockworkPolicyRule
-
equals
- Overrides:
equalsin classBaseEvaluatedPolicyRuleImpl
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseEvaluatedPolicyRuleImpl
-