aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-02-08 15:54:17 +0000
committerGerrit Code Review <gerrit@onap.org>2018-02-08 15:54:17 +0000
commit5ce818fe869b66e4c4031776fb66215059b079c5 (patch)
treefa094151d52642a190c6313b129c7f449a23bdae
parent764226d76d4373cff24811b9ef99f6e43da1b97b (diff)
parenta9a9bb8b5f61968583981378305c73227afb6620 (diff)
Merge "Sonar:Critical"
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClient.java14
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java8
2 files changed, 9 insertions, 13 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClient.java
index ca815cf904..214be060e3 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClient.java
@@ -32,13 +32,9 @@ import com.fasterxml.jackson.databind.JsonMappingException;
public interface AAIRestClient {
- Pservers getPhysicalServers(String hostName, String uuid);
-
- List<Pserver> getPhysicalServerByVnfId(String vnfId, String transactionLoggingUuid) throws UnsupportedEncodingException, JsonParseException, JsonMappingException, IOException;
-
- void updateMaintenceFlag(String vnfId,boolean inMaint, String transactionLoggingUuid) throws Exception;
-
- void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid) throws Exception;
-
- GenericVnf getVnfByName(String vnfId, String transactionLoggingUuid) throws Exception;
+Pservers getPhysicalServers(String hostName, String uuid);
+List<Pserver> getPhysicalServerByVnfId(String vnfId, String transactionLoggingUuid) throws UnsupportedEncodingException, JsonParseException, JsonMappingException, IOException;
+void updateMaintenceFlag(String vnfId,boolean inMaint, String transactionLoggingUuid) throws JsonParseException, JsonMappingException, IOException;
+void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid) throws JsonParseException, JsonMappingException , IOException;
+GenericVnf getVnfByName(String vnfId, String transactionLoggingUuid) throws JsonParseException, JsonMappingException , IOException;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java
index ae8638f0b7..af1eddf491 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java
@@ -139,14 +139,14 @@ public class AAIRestClientImpl implements AAIRestClient {
}
@Override
- public void updateMaintenceFlag(String vnfName, boolean inMaint, String transactionLoggingUuid) throws Exception {
+ public void updateMaintenceFlag(String vnfName, boolean inMaint, String transactionLoggingUuid) throws JsonParseException, JsonMappingException, IOException {
GenericVnfs genericVnfs = webTarget.register(AAIResourcesObjectMapperProvider.class).path(ENDPOINT_GET_ALL_VNFS)
.queryParam("vnf-name", vnfName).request().header("X-FromAppId", "MSO")
.header("X-TransactionId", transactionLoggingUuid).header("Content-Type", "application/json")
.accept(MediaType.APPLICATION_JSON_TYPE).get().readEntity(GenericVnfs.class);
if (genericVnfs.getGenericVnf().size() > 1)
- throw new Exception("Multiple Generic Vnfs Returned");
+ throw new IndexOutOfBoundsException ("Multiple Generic Vnfs Returned");
GenericVnf genericVnf = genericVnfs.getGenericVnf().get(0);
updateMaintenceFlagVnfId(genericVnf.getVnfId(), inMaint, transactionLoggingUuid);
@@ -154,7 +154,7 @@ public class AAIRestClientImpl implements AAIRestClient {
@Override
public void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid)
- throws Exception {
+ throws JsonParseException, JsonMappingException, IOException {
GenericVnf genericVnf = new GenericVnf();
genericVnf.setInMaint(inMaint);
webTarget.register(AAIResourcesObjectMapperProvider.class).path(GENERIC_VNF_PATH + "/" + vnfId).request()
@@ -165,7 +165,7 @@ public class AAIRestClientImpl implements AAIRestClient {
}
@Override
- public GenericVnf getVnfByName(String vnfId, String transactionLoggingUuid) throws Exception {
+ public GenericVnf getVnfByName(String vnfId, String transactionLoggingUuid) throws JsonParseException, JsonMappingException, IOException {
return webTarget.register(AAIResourcesObjectMapperProvider.class).path(GENERIC_VNF_PATH + "/" + vnfId).request()
.header("X-FromAppId", "MSO").header("X-TransactionId", transactionLoggingUuid)
.header("Content-Type", "application/json").accept(MediaType.APPLICATION_JSON_TYPE).get()