Class EvaluatedPolicyRuleImpl
java.lang.Object
com.evolveum.midpoint.model.impl.lens.EvaluatedPolicyRuleImpl
- All Implemented Interfaces:
AssociatedPolicyRule,EvaluatedPolicyRule,DebugDumpable,Serializable,Cloneable
public class EvaluatedPolicyRuleImpl
extends Object
implements EvaluatedPolicyRule, AssociatedPolicyRule
- Author:
- semancik
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.model.api.context.EvaluatedPolicyRule
EvaluatedPolicyRule.TargetType -
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionEvaluatedPolicyRuleImpl(@NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull String ruleId, @Nullable AssignmentPath assignmentPath, @NotNull EvaluatedPolicyRule.TargetType targetType) EvaluatedPolicyRuleImpl(@NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull String ruleId, @Nullable AssignmentPath assignmentPath, @Nullable EvaluatedAssignmentImpl<?> evaluatedAssignment, @NotNull EvaluatedPolicyRule.TargetType targetType) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToEvaluatedPolicyRuleBeans(@NotNull Collection<EvaluatedPolicyRuleType> ruleBeans, @NotNull PolicyRuleExternalizationOptions options, @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector, @Nullable EvaluatedAssignment newOwner) Honors "final" but not "hidden" flag.voidaddToEvaluatedPolicyRuleBeansInternal(@NotNull Collection<EvaluatedPolicyRuleType> ruleBeans, @NotNull PolicyRuleExternalizationOptions options, @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector, @Nullable EvaluatedAssignment newOwner) voidaddTrigger(@NotNull EvaluatedPolicyRuleTrigger<?> trigger) Adds a trigger to the policy rule.clone()voidcomputeEnabledActions(@Nullable PolicyRuleEvaluationContext<?> rctx, PrismObject<?> object, Task task, OperationResult result) Call only after "triggered" status was determined.booleanbooleancontainsEnabledAction(Class<? extends PolicyActionType> type) Are there any enabled actions of given type?debugDump(int indent) boolean@NotNull Collection<EvaluatedPolicyRuleTrigger<?>>Returns all triggers, even those that were indirectly collected via situation policy rules.<T extends EvaluatedPolicyRuleTrigger<?>>
Collection<T>getAllTriggers(Class<T> type) Returns all triggers of given type, stepping down to situation policy rules and composite triggers.@Nullable AssignmentPath@NotNull AssignmentPathintgetCount()<T extends PolicyActionType>
PolicyActionConfigItem<T>getEnabledAction(Class<T> type) Returns enabled action of given type, if there's any.@NotNull List<? extends PolicyActionConfigItem<?>>Returns all enabled actions.<T extends PolicyActionType>
@NotNull List<? extends PolicyActionConfigItem<T>>getEnabledActions(Class<T> type) Returns all enabled actions of given type.@Nullable EvaluatedAssignmentImpl<?>Evaluated assignment that brought this policy rule to the focus or target.@NotNull EvaluatedPolicyRuleReturns the original policy rule.getName()Name of the policy rule, as configured.@Nullable EvaluatedAssignmentReturns new owner (for foreign rules) or `null` (for original ones).@NotNull List<ObjectReferenceType>@NotNull PolicyRuleType@NotNull StringAutomatically generated identifier that - we hope - uniquely identifies the policy rule.@Nullable StringReturns the policy situation connected to this rule.@NotNull Collection<EvaluatedExclusionTrigger>Returns exclusion triggers without ones that are not relevant for given "new owner" (see class javadoc).@NotNull ConfigurationItemOriginTo which object is the policy rule targeted and how.@NotNull Collection<EvaluatedPolicyRuleTrigger<?>>inthashCode()booleanbooleanTODObooleanisGlobal()booleanbooleanWas this rule triggered, i.e.voidvoidsetCount(int value) voidReturns short, (more or less) user-level characterization of this object.toString()voidtrigger(Collection<EvaluatedPolicyRuleTrigger<?>> triggers) Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.model.api.context.AssociatedPolicyRule
getNewOwnerShortStringMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.model.api.context.EvaluatedPolicyRule
hasThreshold, isApplicableToAssignment, isApplicableToFocusObject, isApplicableToProjection
-
Constructor Details
-
EvaluatedPolicyRuleImpl
public EvaluatedPolicyRuleImpl(@NotNull @NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull @NotNull String ruleId, @Nullable @Nullable AssignmentPath assignmentPath, @NotNull @NotNull EvaluatedPolicyRule.TargetType targetType) -
EvaluatedPolicyRuleImpl
public EvaluatedPolicyRuleImpl(@NotNull @NotNull AbstractPolicyRuleConfigItem<?> policyRuleCI, @NotNull @NotNull String ruleId, @Nullable @Nullable AssignmentPath assignmentPath, @Nullable @Nullable EvaluatedAssignmentImpl<?> evaluatedAssignment, @NotNull @NotNull EvaluatedPolicyRule.TargetType targetType)
-
-
Method Details
-
clone
-
getName
Description copied from interface:EvaluatedPolicyRuleName of the policy rule, as configured.- Specified by:
getNamein interfaceEvaluatedPolicyRule
-
getPolicyRule
- Specified by:
getPolicyRulein interfaceEvaluatedPolicyRule
-
getRuleOrigin
-
getAssignmentPath
- Specified by:
getAssignmentPathin interfaceEvaluatedPolicyRule
-
getAssignmentPathRequired
-
getEvaluatedAssignment
Description copied from interface:EvaluatedPolicyRuleEvaluated assignment that brought this policy rule to the focus or target. May be missing for artificially-crafted policy rules (to be reviewed!)- Specified by:
getEvaluatedAssignmentin interfaceEvaluatedPolicyRule
-
getPolicyConstraints
- Specified by:
getPolicyConstraintsin interfaceEvaluatedPolicyRule
-
getPolicyThreshold
- Specified by:
getPolicyThresholdin interfaceEvaluatedPolicyRule
-
getTriggers
- Specified by:
getTriggersin interfaceEvaluatedPolicyRule
-
isTriggered
public boolean isTriggered()Description copied from interface:AssociatedPolicyRuleWas this rule triggered, i.e. are there any triggers? We do not distinguish between relevant and irrelevant triggers here, as foreign rules should have always some triggers, so this is always `true` for them.- Specified by:
isTriggeredin interfaceAssociatedPolicyRule
-
getAllTriggers
Description copied from interface:EvaluatedPolicyRuleReturns all triggers, even those that were indirectly collected via situation policy rules.- Specified by:
getAllTriggersin interfaceEvaluatedPolicyRule
-
getRelevantExclusionTriggers
Description copied from interface:AssociatedPolicyRuleReturns exclusion triggers without ones that are not relevant for given "new owner" (see class javadoc).- Specified by:
getRelevantExclusionTriggersin interfaceAssociatedPolicyRule
-
getAllTriggers
Description copied from interface:EvaluatedPolicyRuleReturns all triggers of given type, stepping down to situation policy rules and composite triggers. An exception are composite "not" triggers: it is usually of no use to collect negated triggers.- Specified by:
getAllTriggersin interfaceEvaluatedPolicyRule
-
trigger
-
addTrigger
Description copied from interface:AssociatedPolicyRuleAdds a trigger to the policy rule. For internal use only.- Specified by:
addTriggerin interfaceAssociatedPolicyRule
-
getActions
- Specified by:
getActionsin interfaceEvaluatedPolicyRule
-
getPolicySituation
Description copied from interface:AssociatedPolicyRuleReturns the policy situation connected to this rule. Will be replaced by object marks.- Specified by:
getPolicySituationin interfaceAssociatedPolicyRule
-
getPolicyMarkRef
- Specified by:
getPolicyMarkRefin interfaceAssociatedPolicyRule
-
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable
-
equals
-
hashCode
public int hashCode() -
toString
-
isGlobal
public boolean isGlobal()- Specified by:
isGlobalin interfaceEvaluatedPolicyRule
-
toShortString
Description copied from interface:AssociatedPolicyRuleReturns short, (more or less) user-level characterization of this object.- Specified by:
toShortStringin interfaceAssociatedPolicyRule
-
extractMessages
- Specified by:
extractMessagesin interfaceEvaluatedPolicyRule
-
extractShortMessages
- Specified by:
extractShortMessagesin interfaceEvaluatedPolicyRule
-
addToEvaluatedPolicyRuleBeans
public void addToEvaluatedPolicyRuleBeans(@NotNull @NotNull Collection<EvaluatedPolicyRuleType> ruleBeans, @NotNull @NotNull PolicyRuleExternalizationOptions options, @Nullable @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector, @Nullable @Nullable EvaluatedAssignment newOwner) Honors "final" but not "hidden" flag.- Specified by:
addToEvaluatedPolicyRuleBeansin interfaceAssociatedPolicyRule- Parameters:
ruleBeans- Collection of beans into which to put the result.options- Options - how the serialization should take place.triggerSelector- Which triggers should be processed?newOwner- If set, we should ignore triggers not relevant for this evaluated assignment.
-
addToEvaluatedPolicyRuleBeansInternal
public void addToEvaluatedPolicyRuleBeansInternal(@NotNull @NotNull Collection<EvaluatedPolicyRuleType> ruleBeans, @NotNull @NotNull PolicyRuleExternalizationOptions options, @Nullable @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector, @Nullable @Nullable EvaluatedAssignment newOwner) -
getEnabledActions
Description copied from interface:EvaluatedPolicyRuleReturns all enabled actions. Fails if they were not computed yet.- Specified by:
getEnabledActionsin interfaceEvaluatedPolicyRule
-
containsEnabledAction
public boolean containsEnabledAction()- Specified by:
containsEnabledActionin interfaceEvaluatedPolicyRule
-
containsEnabledAction
Description copied from interface:AssociatedPolicyRuleAre there any enabled actions of given type?- Specified by:
containsEnabledActionin interfaceAssociatedPolicyRule
-
getEnabledActions
@NotNull public <T extends PolicyActionType> @NotNull List<? extends PolicyActionConfigItem<T>> getEnabledActions(Class<T> type) Description copied from interface:AssociatedPolicyRuleReturns all enabled actions of given type.- Specified by:
getEnabledActionsin interfaceAssociatedPolicyRule
-
getEnabledAction
Description copied from interface:AssociatedPolicyRuleReturns enabled action of given type, if there's any. Throws an exception if there are more of them.- Specified by:
getEnabledActionin interfaceAssociatedPolicyRule
-
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. -
getPolicyRuleIdentifier
Description copied from interface:AssociatedPolicyRuleAutomatically generated identifier that - we hope - uniquely identifies the policy rule.- Specified by:
getPolicyRuleIdentifierin interfaceAssociatedPolicyRule
-
getCount
public int getCount()- Specified by:
getCountin interfaceEvaluatedPolicyRule
-
setCount
public void setCount(int value) - Specified by:
setCountin interfaceEvaluatedPolicyRule
-
isOverThreshold
- Specified by:
isOverThresholdin interfaceEvaluatedPolicyRule- Throws:
ConfigurationException
-
hasSituationConstraint
public boolean hasSituationConstraint()- Specified by:
hasSituationConstraintin interfaceEvaluatedPolicyRule
-
getTargetType
Description copied from interface:EvaluatedPolicyRuleTo which object is the policy rule targeted and how.- Specified by:
getTargetTypein interfaceEvaluatedPolicyRule
-
registerAsForeignRuleIfNeeded
public void registerAsForeignRuleIfNeeded() -
getNewOwner
Description copied from interface:AssociatedPolicyRuleReturns new owner (for foreign rules) or `null` (for original ones).- Specified by:
getNewOwnerin interfaceAssociatedPolicyRule
-
getEvaluatedPolicyRule
Description copied from interface:AssociatedPolicyRuleReturns the original policy rule.- Specified by:
getEvaluatedPolicyRulein interfaceAssociatedPolicyRule
-
setEvaluated
public void setEvaluated() -
isEvaluated
public boolean isEvaluated()Description copied from interface:AssociatedPolicyRuleTODO- Specified by:
isEvaluatedin interfaceAssociatedPolicyRule
-