Class PolicyRuleTypeUtil
- java.lang.Object
-
- com.evolveum.midpoint.schema.util.PolicyRuleTypeUtil
-
public class PolicyRuleTypeUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PolicyRuleTypeUtil.LazyMapConstraintsResolver
-
Constructor Summary
Constructors Constructor Description PolicyRuleTypeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
accept(PolicyConstraintsType pc, com.evolveum.midpoint.schema.util.PolicyRuleTypeUtil.ConstraintVisitor visitor, boolean deep, boolean alsoRoots, QName rootElementName, boolean ignoreRefs)
Returns false if the process was stopped by the consumer.static String
createId(String containingObjectOid)
static String
createId(String containingObjectOid, Long containerId)
static <T extends PolicyActionType>
List<T>filterActions(List<PolicyActionType> actions, Class<T> clazz)
static List<PolicyActionType>
getAllActions(PolicyActionsType actions)
static @NotNull List<EvaluatedExclusionTriggerType>
getAllExclusionTriggers(List<EvaluatedPolicyRuleType> rules)
static @NotNull List<TimeValidityPolicyConstraintType>
getTimeValidityConstraints(PolicyRuleType policyRule)
static boolean
hasNotificationActions(PolicyRuleType policyRule)
static boolean
isApplicableToAssignment(PolicyRuleType rule)
Returns true if this policy rule can be applied to an assignment.static boolean
isApplicableToObject(PolicyRuleType rule)
Returns true if this policy rule can be applied to an object as a whole.static void
resolveReferences(List<PolicyRuleType> rules, Collection<? extends PolicyRuleType> otherRules, PrismContext prismContext)
static List<javax.xml.bind.JAXBElement<AbstractPolicyConstraintType>>
toConstraintsList(PolicyConstraintsType pc, boolean deep, boolean ignoreRefs)
static String
toDiagShortcut(PolicyConstraintKindType constraintKind)
static String
toShortString(PolicyActionsType actions)
static String
toShortString(PolicyActionsType actions, List<PolicyActionType> enabledActions)
static String
toShortString(PolicyConstraintsType constraints)
static String
toShortString(PolicyConstraintsType constraints, char join)
static String
toShortString(PolicyRuleType rule)
static String
toShortString(javax.xml.bind.JAXBElement<? extends AbstractPolicyConstraintType> constraint)
static boolean
triggerCollectionsEqual(Collection<EvaluatedPolicyRuleTriggerType> triggers, Collection<EvaluatedPolicyRuleTriggerType> currentTriggersUnpacked)
static void
visit(List<EvaluatedPolicyRuleTriggerType> triggers, Consumer<EvaluatedPolicyRuleTriggerType> visitor)
-
-
-
Method Detail
-
toShortString
public static String toShortString(PolicyRuleType rule)
-
toShortString
public static String toShortString(javax.xml.bind.JAXBElement<? extends AbstractPolicyConstraintType> constraint)
-
toShortString
public static String toShortString(PolicyConstraintsType constraints)
-
toShortString
public static String toShortString(PolicyConstraintsType constraints, char join)
-
toShortString
public static String toShortString(PolicyActionsType actions)
-
toShortString
public static String toShortString(PolicyActionsType actions, List<PolicyActionType> enabledActions)
- Parameters:
enabledActions
- if null we don't consider action enabled/disabled state
-
toDiagShortcut
public static String toDiagShortcut(PolicyConstraintKindType constraintKind)
-
visit
public static void visit(List<EvaluatedPolicyRuleTriggerType> triggers, Consumer<EvaluatedPolicyRuleTriggerType> visitor)
-
triggerCollectionsEqual
public static boolean triggerCollectionsEqual(Collection<EvaluatedPolicyRuleTriggerType> triggers, Collection<EvaluatedPolicyRuleTriggerType> currentTriggersUnpacked)
-
getAllActions
public static List<PolicyActionType> getAllActions(PolicyActionsType actions)
-
filterActions
public static <T extends PolicyActionType> List<T> filterActions(List<PolicyActionType> actions, Class<T> clazz)
-
getTimeValidityConstraints
@NotNull public static @NotNull List<TimeValidityPolicyConstraintType> getTimeValidityConstraints(PolicyRuleType policyRule)
-
hasNotificationActions
public static boolean hasNotificationActions(PolicyRuleType policyRule)
-
accept
public static boolean accept(PolicyConstraintsType pc, com.evolveum.midpoint.schema.util.PolicyRuleTypeUtil.ConstraintVisitor visitor, boolean deep, boolean alsoRoots, QName rootElementName, boolean ignoreRefs)
Returns false if the process was stopped by the consumer. All references should be resolved.
-
toConstraintsList
public static List<javax.xml.bind.JAXBElement<AbstractPolicyConstraintType>> toConstraintsList(PolicyConstraintsType pc, boolean deep, boolean ignoreRefs)
-
isApplicableToAssignment
public static boolean isApplicableToAssignment(PolicyRuleType rule)
Returns true if this policy rule can be applied to an assignment. By default, rules that have only object-related constraints, are said to be applicable to objects only (even if technically they could be applied to assignments as well).
-
isApplicableToObject
public static boolean isApplicableToObject(PolicyRuleType rule)
Returns true if this policy rule can be applied to an object as a whole.
-
resolveReferences
public static void resolveReferences(List<PolicyRuleType> rules, Collection<? extends PolicyRuleType> otherRules, PrismContext prismContext)
-
getAllExclusionTriggers
@NotNull public static @NotNull List<EvaluatedExclusionTriggerType> getAllExclusionTriggers(List<EvaluatedPolicyRuleType> rules)
-
-