summaryrefslogtreecommitdiffstats
path: root/feature-lifecycle/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'feature-lifecycle/src/main/java')
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java6
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeDroolsController.java2
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactController.java9
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeDroolsController.java9
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();