summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.vfc/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-06-13 10:39:55 -0400
committerJim Hahn <jrh3@att.com>2019-06-17 10:50:16 -0400
commitd37c71292d9cbdd892f328d63f49a8027b1f13c4 (patch)
tree615a8af45285d1032a02af1214c76b938c58044d /models-interactions/model-actors/actor.vfc/src/main
parentf59ec395bf1e41df894f884e70ff3185280668c0 (diff)
Fix simple sonar issues in models
Added @FunctionalInterface where needed. Replaced anonymous classes with lambda expressions. Replaced duplicate strings with a constant. Removed unused BeforeClass & AfterClass test methods. Removed some trailing spaces. Fixed: aai actor.appc actor.appclcm actor.sdnc actor.sdnr actor.so actor.vfc actorServiceProvider appc appclcm cds events Change-Id: I0e21cbb10db6d1217bbd0e00e6dd4fac3eb84e31 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.vfc/src/main')
-rw-r--r--models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java b/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java
index 61cf81da9..a41d9e82d 100644
--- a/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java
+++ b/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java
@@ -41,6 +41,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class VfcActorServiceProvider implements Actor {
+ private static final String GENERIC_VNF_ID = "generic-vnf.vnf-id";
+
private static final Logger logger = LoggerFactory.getLogger(VfcActorServiceProvider.class);
// Strings for VFC Actor
@@ -105,7 +107,7 @@ public class VfcActorServiceProvider implements Actor {
request.setNsInstanceId(serviceInstance);
request.setRequestId(onset.getRequestId());
request.setHealRequest(new VfcHealRequest());
- request.getHealRequest().setVnfInstanceId(onset.getAai().get("generic-vnf.vnf-id"));
+ request.getHealRequest().setVnfInstanceId(onset.getAai().get(GENERIC_VNF_ID));
request.getHealRequest().setCause(operation.getMessage());
request.getHealRequest().setAdditionalParams(new VfcHealAdditionalParams());
@@ -127,7 +129,7 @@ public class VfcActorServiceProvider implements Actor {
AaiGetVnfResponse response = null;
UUID requestId = event.getRequestId();
String vnfName = event.getAai().get("generic-vnf.vnf-name");
- String vnfId = event.getAai().get("generic-vnf.vnf-id");
+ String vnfId = event.getAai().get(GENERIC_VNF_ID);
try {
if (vnfName != null) {
String url = aaiUrl + "/aai/v11/network/generic-vnfs/generic-vnf?vnf-name=";
@@ -176,7 +178,7 @@ public class VfcActorServiceProvider implements Actor {
request.setNsInstanceId(serviceInstance);
request.setRequestId(onset.getRequestId());
request.setHealRequest(new VfcHealRequest());
- request.getHealRequest().setVnfInstanceId(onset.getAai().get("generic-vnf.vnf-id"));
+ request.getHealRequest().setVnfInstanceId(onset.getAai().get(GENERIC_VNF_ID));
request.getHealRequest().setCause(operation.getMessage());
request.getHealRequest().setAdditionalParams(new VfcHealAdditionalParams());