diff options
author | Leigh, Phillip (pl876u) <phillip.leigh@amdocs.com> | 2019-01-11 11:34:33 -0500 |
---|---|---|
committer | Leigh, Phillip (pl876u) <phillip.leigh@amdocs.com> | 2019-01-11 11:41:06 -0500 |
commit | 60b01f16d78078441d4fcf054b37cc6f7347282b (patch) | |
tree | 3b53985436c6a22bd64edd6f6d85b73d81c95b5d | |
parent | e4ada8c413ede55376a3e5adb24297aa3871cbbf (diff) |
BugFix:Ensure no null PNF attributes in AaiCtxBder
Also add versioning to AaiCtxBuilder
Issue-ID: LOG-764
Change-Id: I907ac5f045e90f591bd8d26c7badf46e4df7df94
Signed-off-by: Leigh, Phillip (pl876u) <phillip.leigh@amdocs.com>
3 files changed, 27 insertions, 15 deletions
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/service/ConsumerService.java b/src/main/java/org/onap/pomba/contextbuilder/aai/service/ConsumerService.java index c23a6dc..4c1a013 100644 --- a/src/main/java/org/onap/pomba/contextbuilder/aai/service/ConsumerService.java +++ b/src/main/java/org/onap/pomba/contextbuilder/aai/service/ConsumerService.java @@ -34,7 +34,7 @@ public class ConsumerService { } public Object getWelcomeMsg() { - return restTemplate.exchange(url+ "/aaicontextbuilder/service/hello?name=User",HttpMethod.GET, null, String.class).getBody(); + return restTemplate.exchange(url+ "/aaicontextbuilder/v2/service/hello?name=User",HttpMethod.GET, null, String.class).getBody(); } }
\ No newline at end of file diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/service/rs/RestService.java b/src/main/java/org/onap/pomba/contextbuilder/aai/service/rs/RestService.java index ba4193a..39a24ef 100644 --- a/src/main/java/org/onap/pomba/contextbuilder/aai/service/rs/RestService.java +++ b/src/main/java/org/onap/pomba/contextbuilder/aai/service/rs/RestService.java @@ -33,7 +33,7 @@ import org.onap.pomba.contextbuilder.aai.model.GenericResponse; @Api -@Path("/service") +@Path("{version: v2}/service") @Produces({MediaType.APPLICATION_JSON}) public interface RestService { 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 09ade48..21a8d10 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 @@ -521,7 +521,8 @@ public class RestUtil { // Iterate through the ENUM Attribute list for (Attribute.Name name: Attribute.Name.values()) { - if (name.toString().equals(PNF_NETWORK_FUNCTION )) { + if ((name.toString().equals(PNF_NETWORK_FUNCTION )) + &&(pnf_from_aai.getNfFunction() != null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.networkFunction); @@ -529,7 +530,8 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_NETWORK_ROLE )) { + if ((name.toString().equals(PNF_NETWORK_ROLE )) + && (pnf_from_aai.getNfRole() != null )){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.networkRole); @@ -537,7 +539,8 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_RESOURCE_VERSION)) { + if ((name.toString().equals(PNF_RESOURCE_VERSION)) + && (pnf_from_aai.getResourceVersion() != null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.resourceVersion); @@ -545,7 +548,8 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_NAME2)) { + if ((name.toString().equals(PNF_NAME2)) + && (pnf_from_aai.getPnfName2() != null )){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.name2); @@ -553,7 +557,8 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_NAME2_SOURCE )) { + if ((name.toString().equals(PNF_NAME2_SOURCE )) + && (pnf_from_aai.getPnfName2Source() != null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.name2Source); @@ -561,7 +566,8 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_EQUIPMENT_TYPE )) { + if ((name.toString().equals(PNF_EQUIPMENT_TYPE )) + && (pnf_from_aai.getEquipmentType() != null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.equipType); @@ -569,7 +575,8 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_EQUIPMENT_VENDOR )) { + if ((name.toString().equals(PNF_EQUIPMENT_VENDOR )) + && (pnf_from_aai.getEquipmentVendor() != null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.equipVendor); @@ -577,7 +584,8 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_EQUIPMENT_MODEL)) { + if ((name.toString().equals(PNF_EQUIPMENT_MODEL)) + && (pnf_from_aai.getEquipmentModel() != null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.equipModel); @@ -585,7 +593,8 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_MANAGEMENT_OPTIONS)) { + if ((name.toString().equals(PNF_MANAGEMENT_OPTIONS)) + &&(pnf_from_aai.getManagementOptions() != null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.managementOptions); @@ -593,15 +602,17 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_SW_VERSION)) { + if ((name.toString().equals(PNF_SW_VERSION)) + &&(pnf_from_aai.getSwVersion()!= null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.swVersion); - att.setValue(String.valueOf( pnf_from_aai.getManagementOptions())); + att.setValue(String.valueOf( pnf_from_aai.getSwVersion())); attributeList.add(att); } - if (name.toString().equals(PNF_FRAME_ID)) { + if ((name.toString().equals(PNF_FRAME_ID)) + &&(pnf_from_aai.getFrameId() != null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.frameId); @@ -609,7 +620,8 @@ public class RestUtil { attributeList.add(att); } - if (name.toString().equals(PNF_SERIAL_NUMBER)) { + if ((name.toString().equals(PNF_SERIAL_NUMBER)) + &&(pnf_from_aai.getSerialNumber() != null)){ Attribute att = new Attribute(); att.setDataQuality(DataQuality.ok()); att.setName(Attribute.Name.serialNumber); |