Class ForeignPolicyRuleImpl
java.lang.Object
com.evolveum.midpoint.model.impl.lens.assignments.ForeignPolicyRuleImpl
- All Implemented Interfaces:
AssociatedPolicyRule
,DebugDumpable
,Serializable
,Cloneable
A rule that has been "transplanted" onto new owner (
EvaluatedAssignment
) - currently, the other side
of "one-sided" exclusion constraint.- See Also:
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addToEvaluatedPolicyRuleBeans
(@NotNull Collection<EvaluatedPolicyRuleType> ruleBeans, @NotNull PolicyRuleExternalizationOptions options, @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector, @Nullable EvaluatedAssignment newOwner) Serializes the policy rule into bean form (EvaluatedPolicyRuleType
).void
addTrigger
(@NotNull EvaluatedPolicyRuleTrigger<?> trigger) Adds a trigger to the policy rule.boolean
containsEnabledAction
(Class<? extends PolicyActionType> type) Are there any enabled actions of given type?debugDump
(int indent) <T extends PolicyActionType>
PolicyActionConfigItem<T>getEnabledAction
(Class<T> type) Returns enabled action of given type, if there's any.<T extends PolicyActionType>
@NotNull List<? extends PolicyActionConfigItem<T>>getEnabledActions
(Class<T> type) Returns all enabled actions of given type.@NotNull EvaluatedPolicyRuleImpl
Returns the original policy rule.@NotNull EvaluatedAssignmentImpl<?>
Returns new owner (for foreign rules) or `null` (for original ones).@NotNull String
Automatically generated identifier that - we hope - uniquely identifies the policy rule.@Nullable String
Returns 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).boolean
TODOboolean
Was this rule triggered, i.e. are there any triggers?static ForeignPolicyRuleImpl
of
(@NotNull EvaluatedPolicyRuleImpl rule, @NotNull EvaluatedAssignmentImpl<?> newOwner) Returns short, (more or less) user-level characterization of this object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.model.api.context.AssociatedPolicyRule
getNewOwnerShortString
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Method Details
-
of
public static ForeignPolicyRuleImpl of(@NotNull @NotNull EvaluatedPolicyRuleImpl rule, @NotNull @NotNull EvaluatedAssignmentImpl<?> newOwner) -
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
toShortString
Description copied from interface:AssociatedPolicyRule
Returns short, (more or less) user-level characterization of this object.- Specified by:
toShortString
in interfaceAssociatedPolicyRule
-
getPolicyRuleIdentifier
Description copied from interface:AssociatedPolicyRule
Automatically generated identifier that - we hope - uniquely identifies the policy rule.- Specified by:
getPolicyRuleIdentifier
in interfaceAssociatedPolicyRule
-
isTriggered
public boolean isTriggered()Description copied from interface:AssociatedPolicyRule
Was 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:
isTriggered
in interfaceAssociatedPolicyRule
-
isEvaluated
public boolean isEvaluated()Description copied from interface:AssociatedPolicyRule
TODO- Specified by:
isEvaluated
in interfaceAssociatedPolicyRule
-
containsEnabledAction
Description copied from interface:AssociatedPolicyRule
Are there any enabled actions of given type?- Specified by:
containsEnabledAction
in interfaceAssociatedPolicyRule
-
getEnabledAction
Description copied from interface:AssociatedPolicyRule
Returns enabled action of given type, if there's any. Throws an exception if there are more of them.- Specified by:
getEnabledAction
in interfaceAssociatedPolicyRule
-
getEnabledActions
@NotNull public <T extends PolicyActionType> @NotNull List<? extends PolicyActionConfigItem<T>> getEnabledActions(Class<T> type) Description copied from interface:AssociatedPolicyRule
Returns all enabled actions of given type.- Specified by:
getEnabledActions
in interfaceAssociatedPolicyRule
-
getRelevantExclusionTriggers
Description copied from interface:AssociatedPolicyRule
Returns exclusion triggers without ones that are not relevant for given "new owner" (see class javadoc).- Specified by:
getRelevantExclusionTriggers
in interfaceAssociatedPolicyRule
-
getNewOwner
Description copied from interface:AssociatedPolicyRule
Returns new owner (for foreign rules) or `null` (for original ones).- Specified by:
getNewOwner
in interfaceAssociatedPolicyRule
-
getEvaluatedPolicyRule
Description copied from interface:AssociatedPolicyRule
Returns the original policy rule.- Specified by:
getEvaluatedPolicyRule
in interfaceAssociatedPolicyRule
-
getPolicySituation
Description copied from interface:AssociatedPolicyRule
Returns the policy situation connected to this rule. Will be replaced by object marks.- Specified by:
getPolicySituation
in interfaceAssociatedPolicyRule
-
addToEvaluatedPolicyRuleBeans
public void addToEvaluatedPolicyRuleBeans(@NotNull @NotNull Collection<EvaluatedPolicyRuleType> ruleBeans, @NotNull @NotNull PolicyRuleExternalizationOptions options, @Nullable @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector, @Nullable @Nullable EvaluatedAssignment newOwner) Description copied from interface:AssociatedPolicyRule
Serializes the policy rule into bean form (EvaluatedPolicyRuleType
). Currently not very nice contract, should be improved later.- Specified by:
addToEvaluatedPolicyRuleBeans
in 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.
-
addTrigger
Description copied from interface:AssociatedPolicyRule
Adds a trigger to the policy rule. For internal use only.- Specified by:
addTrigger
in interfaceAssociatedPolicyRule
-