diff options
author | Jim Hahn <jrh3@att.com> | 2021-05-07 18:07:09 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-05-07 18:13:22 -0400 |
commit | 71a2c192c13200c5f864bca610e1ba6cf99e8e82 (patch) | |
tree | ca4b6f8cc12a00b494b3337215bac6e2eca9a8e0 /models-interactions/model-actors/actor.sdnc | |
parent | da708d64dc27f36ed5da733fca14ebfb4cc2832b (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.sdnc')
2 files changed, 18 insertions, 18 deletions
diff --git a/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperation.java b/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperation.java index 61bf8385a..2f6654d09 100644 --- a/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperation.java +++ b/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperation.java @@ -71,45 +71,45 @@ public class BandwidthOnDemandOperation extends SdncOperation { throw new IllegalArgumentException("missing enrichment data, " + SERVICE_ID_KEY); } - SdncHealVfModuleParameter bandwidth = new SdncHealVfModuleParameter(); + var bandwidth = new SdncHealVfModuleParameter(); bandwidth.setName(BANDWIDTH); bandwidth.setValue(getRequiredProperty(OperationProperties.ENRICHMENT_BANDWIDTH, "bandwidth from enrichment data")); - SdncHealVfModuleParameter timeStamp = new SdncHealVfModuleParameter(); + var timeStamp = new SdncHealVfModuleParameter(); timeStamp.setName(BANDWIDTH_CHANGE_TIME); timeStamp.setValue(getRequiredProperty(OperationProperties.ENRICHMENT_BANDWIDTH_CHANGE_TIME, "bandwidth change time from enrichment data")); - SdncHealVfModuleParametersInfo vfParametersInfo = new SdncHealVfModuleParametersInfo(); + var vfParametersInfo = new SdncHealVfModuleParametersInfo(); vfParametersInfo.addParameters(bandwidth); vfParametersInfo.addParameters(timeStamp); - SdncHealVfModuleRequestInput vfRequestInfo = new SdncHealVfModuleRequestInput(); + var vfRequestInfo = new SdncHealVfModuleRequestInput(); vfRequestInfo.setVfModuleParametersInfo(vfParametersInfo); - SdncHealServiceInfo serviceInfo = new SdncHealServiceInfo(); + var serviceInfo = new SdncHealServiceInfo(); serviceInfo.setServiceInstanceId(serviceInstance); - SdncHealRequestInfo requestInfo = new SdncHealRequestInfo(); + var requestInfo = new SdncHealRequestInfo(); requestInfo.setRequestAction("SdwanBandwidthChange"); - SdncHealRequestHeaderInfo headerInfo = new SdncHealRequestHeaderInfo(); + var headerInfo = new SdncHealRequestHeaderInfo(); headerInfo.setSvcAction("update"); headerInfo.setSvcRequestId(getSubRequestId()); - SdncRequest request = new SdncRequest(); + var request = new SdncRequest(); request.setNsInstanceId(serviceInstance); request.setRequestId(params.getRequestId()); request.setUrl("/" + getPath()); - SdncHealVnfInfo vnfInfo = new SdncHealVnfInfo(); + var vnfInfo = new SdncHealVnfInfo(); vnfInfo.setVnfId(getRequiredProperty(OperationProperties.ENRICHMENT_VNF_ID, "VNF id from enrichment data")); - SdncHealVfModuleInfo vfModuleInfo = new SdncHealVfModuleInfo(); + var vfModuleInfo = new SdncHealVfModuleInfo(); vfModuleInfo.setVfModuleId(""); - SdncHealRequest healRequest = new SdncHealRequest(); + var healRequest = new SdncHealRequest(); healRequest.setVnfInfo(vnfInfo); healRequest.setVfModuleInfo(vfModuleInfo); healRequest.setRequestHeaderInfo(headerInfo); diff --git a/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperation.java b/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperation.java index 02209bbd2..562266d5b 100644 --- a/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperation.java +++ b/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperation.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. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,29 +61,29 @@ public class RerouteOperation extends SdncOperation { if (StringUtils.isBlank(serviceInstance)) { throw new IllegalArgumentException("missing enrichment data, " + SERVICE_ID_KEY); } - SdncHealServiceInfo serviceInfo = new SdncHealServiceInfo(); + var serviceInfo = new SdncHealServiceInfo(); serviceInfo.setServiceInstanceId(serviceInstance); String networkId = getProperty(OperationProperties.ENRICHMENT_NETWORK_ID); if (StringUtils.isBlank(networkId)) { throw new IllegalArgumentException("missing enrichment data, " + NETWORK_ID_KEY); } - SdncHealNetworkInfo networkInfo = new SdncHealNetworkInfo(); + var networkInfo = new SdncHealNetworkInfo(); networkInfo.setNetworkId(networkId); - SdncHealRequestInfo requestInfo = new SdncHealRequestInfo(); + var requestInfo = new SdncHealRequestInfo(); requestInfo.setRequestAction("ReoptimizeSOTNInstance"); - SdncHealRequestHeaderInfo headerInfo = new SdncHealRequestHeaderInfo(); + var headerInfo = new SdncHealRequestHeaderInfo(); headerInfo.setSvcAction("reoptimize"); headerInfo.setSvcRequestId(getSubRequestId()); - SdncRequest request = new SdncRequest(); + var request = new SdncRequest(); request.setNsInstanceId(serviceInstance); request.setRequestId(params.getRequestId()); request.setUrl("/" + getPath()); - SdncHealRequest healRequest = new SdncHealRequest(); + var healRequest = new SdncHealRequest(); healRequest.setRequestHeaderInfo(headerInfo); healRequest.setNetworkInfo(networkInfo); healRequest.setRequestInfo(requestInfo); |