summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java2
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/service/rs/RestServiceImpl.java2
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java40
3 files changed, 25 insertions, 19 deletions
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java b/src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java
index cba4aa9..5392c08 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java
@@ -59,7 +59,7 @@ public class SpringServiceImpl implements SpringService {
} catch (AuditException ae) {
throw ae;
} catch (Exception e) {
- throw new AuditException(e.getLocalizedMessage());
+ throw new AuditException(e.getLocalizedMessage(), e);
}
return context;
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/service/rs/RestServiceImpl.java b/src/main/java/org/onap/pomba/contextbuilder/aai/service/rs/RestServiceImpl.java
index f5653f2..6542db5 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/service/rs/RestServiceImpl.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/service/rs/RestServiceImpl.java
@@ -87,6 +87,7 @@ public class RestServiceImpl implements RestService {
response = Response.ok().entity(gson.toJson(aaiContext)).build();
}
} catch (AuditException ce) {
+ log.error("getContext failure", ce);
if (ce.getHttpStatus() !=null) {
response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build();
}else {
@@ -94,6 +95,7 @@ public class RestServiceImpl implements RestService {
response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(ce.getMessage()).build();
}
} catch (Exception e) {
+ log.error("getContext failure", e);
response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java b/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java
index 928153b..cf28487 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java
@@ -658,30 +658,34 @@ public class RestUtil {
if (isEmptyJson(pserverPayload)) {
log.info(LogMessages.NOT_FOUND, "PSERVER with url", pserverURL);
} else {
- log.info(String.format("Message from AAI for pserver url %s ,message body: %s", pserverURL, JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(pserverPayload))));
-
+ log.info("Message from AAI for pserver url {}, message body {}", pserverURL,
+ JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(pserverPayload)));
// Logic to Create the Pserver POJO object
PserverInstance pserverInst = PserverInstance.fromJson(pserverPayload);
if ((pserverInst.getPInterfaceInstanceList() != null)
- &&(!(pserverInst.getPInterfaceInstanceList().getPInterfaceList().isEmpty()))) {
- List<PInterfaceInstance> pInterfaceInstList_aai = pserverInst.getPInterfaceInstanceList().getPInterfaceList();
- for (PInterfaceInstance pInterfaceInst_aai : pInterfaceInstList_aai) {
- //Obtain P-Interface level logical-link
- pInterfaceInst_aai.setLogicalLinkInstanceList(obtainLogicalLinkInfoFromAai ( aaiClient, baseURL,
- requestId, aaiBasicAuthorization, pInterfaceInst_aai.getRelationshipList()));
-
- List<LInterfaceInstance> lInterfaceInstList_aai = pInterfaceInst_aai.getLInterfaceInstanceList().getLInterfaceList();
- for (LInterfaceInstance lInterfaceInst_aai : lInterfaceInstList_aai) {
- //Obtain L-Interface level logical-link
- lInterfaceInst_aai.setLogicalLinkInstanceList(obtainLogicalLinkInfoFromAai ( aaiClient, baseURL,
- requestId, aaiBasicAuthorization, lInterfaceInst_aai.getRelationshipList()));
- }
-
- }
+ && (!(pserverInst.getPInterfaceInstanceList().getPInterfaceList().isEmpty()))) {
+ List<PInterfaceInstance> pInterfaceInstListAai = pserverInst.getPInterfaceInstanceList()
+ .getPInterfaceList();
+ for (PInterfaceInstance pInterfaceInst_aai : pInterfaceInstListAai) {
+ // Obtain P-Interface level logical-link
+ pInterfaceInst_aai.setLogicalLinkInstanceList(obtainLogicalLinkInfoFromAai(aaiClient, baseURL,
+ requestId, aaiBasicAuthorization, pInterfaceInst_aai.getRelationshipList()));
+
+ if (pInterfaceInst_aai.getLInterfaceInstanceList() != null) {
+ List<LInterfaceInstance> lInterfaceInstListAai = pInterfaceInst_aai
+ .getLInterfaceInstanceList().getLInterfaceList();
+ for (LInterfaceInstance lInterfaceInstAai : lInterfaceInstListAai) {
+ // Obtain L-Interface level logical-link
+ lInterfaceInstAai.setLogicalLinkInstanceList(
+ obtainLogicalLinkInfoFromAai(aaiClient, baseURL, requestId,
+ aaiBasicAuthorization, lInterfaceInstAai.getRelationshipList()));
+ }
+ }
+ }
}
- //update P-Interface if any.
+ // update P-Interface if any.
pserverLst.add(pserverInst);
}
}