Class ForeignPolicyRuleImpl
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.lens.assignments.ForeignPolicyRuleImpl
-
- All Implemented Interfaces:
AssociatedPolicyRule
,DebugDumpable
,Serializable
,Cloneable
public class ForeignPolicyRuleImpl extends Object implements AssociatedPolicyRule
A rule that has been "transplanted" onto new owner (EvaluatedAssignment
) - currently, the other side of "one-sided" exclusion constraint.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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?String
debugDump(int indent)
<T extends PolicyActionType>
TgetEnabledAction(Class<T> type)
Returns enabled action of given type, if there's any.<T extends PolicyActionType>
@NotNull List<T>getEnabledActions(Class<T> type)
Returns all enabled actions of given type.@NotNull EvaluatedPolicyRuleImpl
getEvaluatedPolicyRule()
Returns the original policy rule.@NotNull EvaluatedAssignmentImpl<?>
getNewOwner()
Returns new owner (for foreign rules) or `null` (for original ones).@NotNull String
getPolicyRuleIdentifier()
Automatically generated identifier that - we hope - uniquely identifies the policy rule.@Nullable String
getPolicySituation()
Returns the policy situation connected to this rule.@NotNull Collection<EvaluatedExclusionTrigger>
getRelevantExclusionTriggers()
Returns exclusion triggers without ones that are not relevant for given "new owner" (see class javadoc).boolean
isTriggered()
Was this rule triggered, i.e.static ForeignPolicyRuleImpl
of(@NotNull EvaluatedPolicyRuleImpl rule, @NotNull EvaluatedAssignmentImpl<?> newOwner)
String
toShortString()
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 Detail
-
of
public static ForeignPolicyRuleImpl of(@NotNull @NotNull EvaluatedPolicyRuleImpl rule, @NotNull @NotNull EvaluatedAssignmentImpl<?> newOwner)
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
toShortString
public String toShortString()
Description copied from interface:AssociatedPolicyRule
Returns short, (more or less) user-level characterization of this object.- Specified by:
toShortString
in interfaceAssociatedPolicyRule
-
getPolicyRuleIdentifier
@NotNull public @NotNull String 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
-
containsEnabledAction
public boolean containsEnabledAction(Class<? extends PolicyActionType> type)
Description copied from interface:AssociatedPolicyRule
Are there any enabled actions of given type?- Specified by:
containsEnabledAction
in interfaceAssociatedPolicyRule
-
getEnabledAction
public <T extends PolicyActionType> T getEnabledAction(Class<T> type)
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<T> getEnabledActions(Class<T> type)
Description copied from interface:AssociatedPolicyRule
Returns all enabled actions of given type.- Specified by:
getEnabledActions
in interfaceAssociatedPolicyRule
-
getRelevantExclusionTriggers
@NotNull public @NotNull Collection<EvaluatedExclusionTrigger> 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
@NotNull public @NotNull EvaluatedAssignmentImpl<?> getNewOwner()
Description copied from interface:AssociatedPolicyRule
Returns new owner (for foreign rules) or `null` (for original ones).- Specified by:
getNewOwner
in interfaceAssociatedPolicyRule
-
getEvaluatedPolicyRule
@NotNull public @NotNull EvaluatedPolicyRuleImpl getEvaluatedPolicyRule()
Description copied from interface:AssociatedPolicyRule
Returns the original policy rule.- Specified by:
getEvaluatedPolicyRule
in interfaceAssociatedPolicyRule
-
getPolicySituation
@Nullable public @Nullable String 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
public void addTrigger(@NotNull @NotNull EvaluatedPolicyRuleTrigger<?> trigger)
Description copied from interface:AssociatedPolicyRule
Adds a trigger to the policy rule. For internal use only.- Specified by:
addTrigger
in interfaceAssociatedPolicyRule
-
-