summaryrefslogtreecommitdiffstats
path: root/controlloop/common/simulators/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-09-21 09:31:25 -0400
committerJim Hahn <jrh3@att.com>2018-09-21 10:12:52 -0400
commitd85e766c5538de762820132ac723d928f5a9bf89 (patch)
tree738c4de12a3a261035bbb25199558a490d550d3e /controlloop/common/simulators/src
parentfaf283066f186838665ed5c38c1ba8319041bc1c (diff)
new sonar issues in drools-applications
Don't return null lists from AAI. Transient TargetLock. Extract aai.url, et. al., constants. Don't allocate extra unneeded variable. Re-order fields in xacml attributes. Extract "vserver" constant from simulator. Replace thread sleep with join. Change-Id: Iee1bd182862632af1f131cca5db5b526f5865b9f Issue-ID: POLICY-1129 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/simulators/src')
-rw-r--r--controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
index f5a4f6e53..3dd8347f2 100644
--- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
+++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
@@ -42,6 +42,8 @@ import org.onap.policy.aai.util.Serialization;
@Path("/aai")
public class AaiSimulatorJaxRs {
+ private static final String VSERVER = "vserver";
+
/**
* A&AI get query.
*
@@ -72,12 +74,12 @@ public class AaiSimulatorJaxRs {
public String aaiPostQuery(final String req) throws IOException {
final AaiNqRequest request = Serialization.gsonPretty.fromJson(req, AaiNqRequest.class);
- if (request.getInstanceFilters().getInstanceFilter().get(0).containsKey("vserver")) {
+ if (request.getInstanceFilters().getInstanceFilter().get(0).containsKey(VSERVER)) {
final String vserverName =
- request.getInstanceFilters().getInstanceFilter().get(0).get("vserver").get("vserver-name");
+ request.getInstanceFilters().getInstanceFilter().get(0).get(VSERVER).get("vserver-name");
if ("error".equals(vserverName)) {
Map<String,String> params = new TreeMap<>();
- params.put("type", "vserver");
+ params.put("type", VSERVER);
return load("aai/AaiNqResponse-Error.json", params);
} else {
// vll format - new