diff options
author | Jim Hahn <jrh3@att.com> | 2021-08-05 15:45:21 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-08-05 16:09:01 -0400 |
commit | f9eaa709e739a1596fafe0d840c354087f7ed5ff (patch) | |
tree | 155559ca797819233511a8e49e1ad61400580f62 /feature-lifecycle/src/main/java/org/onap | |
parent | da1b7d9f04453e94fb77ebe4213f456a0be63fc2 (diff) |
Use lombok in drools-pdp #3
Updated feature-healthcheck thru feature-pooling-dmaap.
Issue-ID: POLICY-3397
Change-Id: Ia7b00a521cdb82ed0eb22bdaed03d02665fbbff1
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-lifecycle/src/main/java/org/onap')
4 files changed, 10 insertions, 16 deletions
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java index 1326c3b0..8e97d3ef 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java @@ -164,10 +164,10 @@ public class LifecycleFsm implements Startable { setPdpType(properties.getProperty(PDP_TYPE, DEFAULT_PDP_TYPE)); policyTypesMap.put(POLICY_TYPE_DROOLS_NATIVE_CONTROLLER, - new PolicyTypeNativeDroolsController(this, POLICY_TYPE_DROOLS_NATIVE_CONTROLLER)); + new PolicyTypeNativeDroolsController(POLICY_TYPE_DROOLS_NATIVE_CONTROLLER, this)); policyTypesMap.put( POLICY_TYPE_DROOLS_NATIVE_RULES, - new PolicyTypeNativeArtifactController(this, POLICY_TYPE_DROOLS_NATIVE_RULES)); + new PolicyTypeNativeArtifactController(POLICY_TYPE_DROOLS_NATIVE_RULES, this)); String commaSeparatedPolicyTypes = properties.getProperty(MANDATORY_POLICY_TYPES); if (!StringUtils.isBlank(commaSeparatedPolicyTypes)) { @@ -234,7 +234,7 @@ public class LifecycleFsm implements Startable { for (ToscaConceptIdentifier id : controller.getPolicyTypes()) { PolicyTypeDroolsController ptDc = (PolicyTypeDroolsController) policyTypesMap.get(id); //NOSONAR if (ptDc == null) { - policyTypesMap.put(id, new PolicyTypeDroolsController(this, id, controller)); + policyTypesMap.put(id, new PolicyTypeDroolsController(id, this, controller)); logger.info("policy-type {} added", id); } else { ptDc.add(controller); diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeDroolsController.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeDroolsController.java index 41d75878..fa87617d 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeDroolsController.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeDroolsController.java @@ -62,7 +62,7 @@ public class PolicyTypeDroolsController implements PolicyTypeController { * Creates a Policy Type Drools Controller. */ public PolicyTypeDroolsController( - LifecycleFsm fsm, ToscaConceptIdentifier policyType, PolicyController controller) { + ToscaConceptIdentifier policyType, LifecycleFsm fsm, PolicyController controller) { this.policyType = policyType; this.controllers.put(controller.getName(), controller); this.fsm = fsm; diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactController.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactController.java index b97d9026..fd98eed3 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactController.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactController.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,6 +21,7 @@ package org.onap.policy.drools.lifecycle; +import lombok.AllArgsConstructor; import lombok.Getter; import org.onap.policy.common.gson.annotation.GsonJsonIgnore; import org.onap.policy.common.utils.coder.CoderException; @@ -36,6 +37,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@AllArgsConstructor public class PolicyTypeNativeArtifactController implements PolicyTypeController { private static final Logger logger = LoggerFactory.getLogger(PolicyTypeNativeArtifactController.class); @@ -45,11 +47,6 @@ public class PolicyTypeNativeArtifactController implements PolicyTypeController @GsonJsonIgnore protected final LifecycleFsm fsm; - public PolicyTypeNativeArtifactController(LifecycleFsm fsm, ToscaConceptIdentifier policyType) { - this.policyType = policyType; - this.fsm = fsm; - } - @Override public boolean deploy(ToscaPolicy policy) { NativeArtifactPolicy nativePolicy; diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeDroolsController.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeDroolsController.java index 361b4b10..8e62e2a8 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeDroolsController.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeDroolsController.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,6 +26,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; import java.util.stream.Collectors; +import lombok.AllArgsConstructor; import lombok.Getter; import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; import org.onap.policy.common.endpoints.event.comm.TopicSink; @@ -47,6 +48,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@AllArgsConstructor public class PolicyTypeNativeDroolsController implements PolicyTypeController { private static final Logger logger = LoggerFactory.getLogger(PolicyTypeNativeDroolsController.class); @@ -56,11 +58,6 @@ public class PolicyTypeNativeDroolsController implements PolicyTypeController { @GsonJsonIgnore protected final LifecycleFsm fsm; - public PolicyTypeNativeDroolsController(LifecycleFsm fsm, ToscaConceptIdentifier policyType) { - this.policyType = policyType; - this.fsm = fsm; - } - @Override public boolean deploy(ToscaPolicy policy) { var controllerProps = new Properties(); |