diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2020-11-17 14:40:16 -0600 |
---|---|---|
committer | jhh <jorge.hernandez-herrero@att.com> | 2020-11-17 14:53:22 -0600 |
commit | 6a429b8504cdd38cadb3ce9bb532d08cc5115da9 (patch) | |
tree | 480e4cdc3f4a5606792bc6f60435524b42d812e0 /feature-lifecycle/src/main/java | |
parent | dc6c4a21d46909dad59f4bd16cb6d4fc29fcce77 (diff) |
support for not validated policy types
Issue-ID: POLICY-2880
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Id816bb3edd44c34a342cd7ada95dd8f2f9d1b0a6
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'feature-lifecycle/src/main/java')
-rw-r--r-- | feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java index cf13c46d..860986d5 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStateRunning.java @@ -24,6 +24,7 @@ package org.onap.policy.drools.lifecycle; import java.util.List; import java.util.function.BiPredicate; import lombok.NonNull; +import org.onap.policy.drools.policies.DomainMaker; import org.onap.policy.models.pdp.concepts.PdpResponseDetails; import org.onap.policy.models.pdp.concepts.PdpStateChange; import org.onap.policy.models.pdp.concepts.PdpUpdate; @@ -161,6 +162,7 @@ public abstract class LifecycleStateRunning extends LifecycleStateDefault { protected boolean syncPolicies(List<ToscaPolicy> policies, BiPredicate<PolicyTypeController, ToscaPolicy> sync) { boolean success = true; + DomainMaker domain = fsm.getDomainMaker(); for (ToscaPolicy policy : policies) { ToscaPolicyTypeIdentifier policyType = policy.getTypeIdentifier(); PolicyTypeController controller = fsm.getController(policyType); @@ -170,7 +172,12 @@ public abstract class LifecycleStateRunning extends LifecycleStateDefault { continue; } - success = fsm.getDomainMaker().isConformant(policy) && sync.test(controller, policy) && success; + if (domain.isRegistered(policy.getTypeIdentifier())) { + success = domain.isConformant(policy) && sync.test(controller, policy) && success; + } else { + logger.info("no validator registered for policy type {}", policy.getTypeIdentifier()); + success = sync.test(controller, policy) && success; + } } return success; |