summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.sdnr/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-07 18:07:09 -0400
committerJim Hahn <jrh3@att.com>2021-05-07 18:13:22 -0400
commit71a2c192c13200c5f864bca610e1ba6cf99e8e82 (patch)
treeca4b6f8cc12a00b494b3337215bac6e2eca9a8e0 /models-interactions/model-actors/actor.sdnr/src
parentda708d64dc27f36ed5da733fca14ebfb4cc2832b (diff)
Fix sonars in policy-models actors
Fixed: - use "var" - don't throw generic Exception Issue-ID: POLICY-3094 Change-Id: I020addb9511fd665b5fed48e7d40719e27039224 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.sdnr/src')
-rw-r--r--models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java b/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java
index ebfbaba68..5b30c673a 100644
--- a/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java
+++ b/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrOperation.java
@@ -83,7 +83,7 @@ public class SdnrOperation extends BidirectionalTopicOperation<PciMessage, PciMe
return Status.FAILURE;
}
- StatusCodeEnum code = StatusCodeEnum.fromStatusCode(response.getStatus().getCode());
+ var code = StatusCodeEnum.fromStatusCode(response.getStatus().getCode());
if (code == null) {
logger.warn("unknown SDNR response status code: {}", response.getStatus().getCode());
@@ -119,7 +119,7 @@ public class SdnrOperation extends BidirectionalTopicOperation<PciMessage, PciMe
return setOutcome(outcome, result);
}
- PciResponse pciResponse = responseWrapper.getBody().getOutput();
+ var pciResponse = responseWrapper.getBody().getOutput();
if (pciResponse.getStatus() == null || pciResponse.getStatus().getValue() == null) {
return setOutcome(outcome, result);
}
@@ -135,17 +135,17 @@ public class SdnrOperation extends BidirectionalTopicOperation<PciMessage, PciMe
/* Construct an SDNR request using pci Model */
- PciMessage dmaapRequest = new PciMessage();
+ var dmaapRequest = new PciMessage();
dmaapRequest.setVersion("1.0");
dmaapRequest.setCorrelationId(params.getRequestId() + "-" + subRequestId);
dmaapRequest.setType("request");
dmaapRequest.setRpcName(params.getOperation().toLowerCase());
/* This is the actual request that is placed in the dmaap wrapper. */
- final PciRequest sdnrRequest = new PciRequest();
+ final var sdnrRequest = new PciRequest();
/* The common header is a required field for all SDNR requests. */
- PciCommonHeader requestCommonHeader = new PciCommonHeader();
+ var requestCommonHeader = new PciCommonHeader();
requestCommonHeader.setRequestId(params.getRequestId());
requestCommonHeader.setSubRequestId(subRequestId);
@@ -156,7 +156,7 @@ public class SdnrOperation extends BidirectionalTopicOperation<PciMessage, PciMe
/*
* Once the pci request is constructed, add it into the body of the dmaap wrapper.
*/
- PciBody body = new PciBody();
+ var body = new PciBody();
body.setInput(sdnrRequest);
dmaapRequest.setBody(body);