summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-05-02 13:03:53 +0200
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-05-02 13:03:53 +0200
commit27643f6e0e807c25230214df188f88a3cf0ab2a4 (patch)
treec891159d0119c8059a6ea3d9fe372d4c8b693ef7 /src
parent269d207cee2ec47b2ecf1830e46ac45b7cea38f2 (diff)
Remove useless exception
Remove useless exception in code + re-align comments Issue-ID: CLAMP-147 Change-Id: I2ebced0ac87ff0a9ce5c3b8681a8965b6d8115a5 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
index 289f31b92..6bab2303f 100644
--- a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
@@ -122,7 +122,7 @@ public class DcaeInventoryServices {
}
private void analyzeAndSaveDcaeResponse(DcaeInventoryResponse dcaeResponse, CldsModel cldsModel,
- DcaeEvent dcaeEvent, String userId) throws ParseException {
+ DcaeEvent dcaeEvent, String userId) {
if (dcaeResponse != null) {
logger.info("Dcae Response for query on inventory: " + dcaeResponse);
String oldTypeId = cldsModel.getTypeId();
@@ -169,8 +169,7 @@ public class DcaeInventoryServices {
String fullUrl = refProp.getStringValue(DCAE_INVENTORY_URL) + "/dcae-service-types" + queryString;
logger.info("Dcae Inventory Service full url - " + fullUrl);
String dcaeInventoryResponse = null;
-
- String responseStr = queryDCAEInventory (fullUrl);
+ String responseStr = queryDCAEInventory(fullUrl);
JSONParser parser = new JSONParser();
Object obj0 = parser.parse(responseStr);
JSONObject jsonObj = (JSONObject) obj0;
@@ -188,16 +187,15 @@ public class DcaeInventoryServices {
return JacksonUtils.getObjectMapperInstance().readValue(dcaeInventoryResponse, DcaeInventoryResponse.class);
}
- private String queryDCAEInventory (String fullUrl) throws IOException, InterruptedException {
+ private String queryDCAEInventory(String fullUrl) throws IOException, InterruptedException {
int retryInterval = 0;
int retryLimit = 1;
if (refProp.getStringValue(DCAE_INVENTORY_RETRY_LIMIT) != null) {
retryLimit = Integer.valueOf(refProp.getStringValue(DCAE_INVENTORY_RETRY_LIMIT));
}
if (refProp.getStringValue(DCAE_INVENTORY_RETRY_INTERVAL) != null) {
- retryInterval = Integer.valueOf(refProp.getStringValue(DCAE_INVENTORY_RETRY_INTERVAL));
+ retryInterval = Integer.valueOf(refProp.getStringValue(DCAE_INVENTORY_RETRY_INTERVAL));
}
-
int i = 0;
while (i < retryLimit) {
i++;
@@ -205,7 +203,8 @@ public class DcaeInventoryServices {
return DcaeHttpConnectionManager.doDcaeHttpQuery(fullUrl, "GET", null, null);
} catch (BadRequestException e) {
if (i == retryLimit) {
- // reach the retry limit, but still failed to connect to DCAE
+ // reach the retry limit, but still failed to connect to
+ // DCAE
throw e;
} else {
// wait for a while and try to connect to DCAE again
@@ -213,9 +212,11 @@ public class DcaeInventoryServices {
}
}
}
- // normally it should not go to this branch. It should either return the DCAE query result, or throw exception
+ // normally it should not go to this branch. It should either return the
+ // DCAE query result, or throw exception
return null;
}
+
/**
* Inserts a new DCAEServiceType or updates an existing instance. If the
* typeName is same second time(already exists) then the