diff options
Diffstat (limited to 'feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java')
-rw-r--r-- | feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java index 0720ec98..e9f4b9bf 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleStatePassive.java @@ -20,16 +20,22 @@ package org.onap.policy.drools.lifecycle; +import lombok.NonNull; import lombok.ToString; +import org.onap.policy.drools.system.PolicyController; import org.onap.policy.models.pdp.concepts.PdpStateChange; import org.onap.policy.models.pdp.enums.PdpResponseStatus; import org.onap.policy.models.pdp.enums.PdpState; +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Lifecycle Passive State. */ @ToString public class LifecycleStatePassive extends LifecycleStateRunning { + private static final Logger logger = LoggerFactory.getLogger(LifecycleStatePassive.class); protected LifecycleStatePassive(LifecycleFsm manager) { super(manager); @@ -41,13 +47,25 @@ public class LifecycleStatePassive extends LifecycleStateRunning { } @Override - protected boolean stateChangeToActive(PdpStateChange change) { + protected boolean stateChangeToActive(@NonNull PdpStateChange change) { fsm.transitionToAction(new LifecycleStateActive(fsm)); return fsm.statusAction(response(change.getRequestId(), PdpResponseStatus.SUCCESS,null)); } @Override - protected boolean stateChangeToPassive(PdpStateChange change) { + protected boolean stateChangeToPassive(@NonNull PdpStateChange change) { return fsm.statusAction(response(change.getRequestId(), PdpResponseStatus.SUCCESS,null)); } + + @Override + protected boolean deployPolicy(@NonNull PolicyController controller, @NonNull ToscaPolicy policy) { + logger.info("{}: deploy {} from {}", this, policy.getIdentifier(), controller.getName()); + return true; + } + + @Override + protected boolean undeployPolicy(@NonNull PolicyController controller, @NonNull ToscaPolicy policy) { + logger.info("{}: undeploy {} from {}", this, policy.getIdentifier(), controller.getName()); + return true; + } } |