Interface AssociatedPolicyRule

    • Method Detail

      • getPolicyRuleIdentifier

        @NotNull
        @NotNull String getPolicyRuleIdentifier()
        Automatically generated identifier that - we hope - uniquely identifies the policy rule.
      • isTriggered

        boolean isTriggered()
        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.
      • containsEnabledAction

        boolean containsEnabledAction​(Class<? extends PolicyActionType> type)
        Are there any enabled actions of given type?
      • getEnabledAction

        @Nullable
        <T extends PolicyActionType> T getEnabledAction​(Class<T> type)
        Returns enabled action of given type, if there's any. Throws an exception if there are more of them.
      • getEnabledActions

        @NotNull
        <T extends PolicyActionType> @NotNull List<T> getEnabledActions​(Class<T> type)
        Returns all enabled actions of given type.
      • getRelevantExclusionTriggers

        @NotNull
        @NotNull Collection<EvaluatedExclusionTrigger> getRelevantExclusionTriggers()
        Returns exclusion triggers without ones that are not relevant for given "new owner" (see class javadoc).
      • toShortString

        String toShortString()
        Returns short, (more or less) user-level characterization of this object.
      • getNewOwner

        @Nullable
        @Nullable EvaluatedAssignment getNewOwner()
        Returns new owner (for foreign rules) or `null` (for original ones).
      • getEvaluatedPolicyRule

        @NotNull
        @NotNull EvaluatedPolicyRule getEvaluatedPolicyRule()
        Returns the original policy rule.
      • getNewOwnerShortString

        default String getNewOwnerShortString()
      • getPolicySituation

        @Nullable
        @Nullable String getPolicySituation()
        Returns the policy situation connected to this rule. Will be replaced by object marks.
      • addToEvaluatedPolicyRuleBeans

        void addToEvaluatedPolicyRuleBeans​(@NotNull
                                           @NotNull Collection<EvaluatedPolicyRuleType> ruleBeans,
                                           @NotNull
                                           @NotNull PolicyRuleExternalizationOptions options,
                                           @Nullable
                                           @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector,
                                           @Nullable
                                           @Nullable EvaluatedAssignment newOwner)
        Serializes the policy rule into bean form (EvaluatedPolicyRuleType). Currently not very nice contract, should be improved later.
        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

        void addTrigger​(@NotNull
                        @NotNull EvaluatedPolicyRuleTrigger<?> trigger)
        Adds a trigger to the policy rule. For internal use only.