diff options
Diffstat (limited to 'holmes-actions/src')
4 files changed, 11 insertions, 13 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiResponseUtil.java b/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiResponseUtil.java index ccfb4fd..37bfc1d 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiResponseUtil.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiResponseUtil.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.jvnet.hk2.annotations.Service; -import org.onap.holmes.common.aai.entity.RelationshipList; import org.onap.holmes.common.aai.entity.RelationshipList.RelatedToProperty; import org.onap.holmes.common.aai.entity.RelationshipList.Relationship; import org.onap.holmes.common.aai.entity.RelationshipList.RelationshipData; @@ -33,6 +32,7 @@ import org.onap.holmes.common.aai.entity.VnfEntity; @Service public class AaiResponseUtil { + public static final String RELATIONSHIP_LIST = "relationship-list"; public List<VmResourceLink> convertJsonToVmResourceLink(String responseJson) throws IOException { ObjectMapper mapper = new ObjectMapper(); JsonNode jsonNode = mapper.readTree(responseJson); @@ -61,8 +61,8 @@ public class AaiResponseUtil { vmEntity.setVserverName2(getTextElementByNode(jsonNode,"vserver-name2")); vmEntity.setVserverSelflink(getTextElementByNode(jsonNode,"vserver-selflink")); - if (jsonNode.has("relationship-list")) { - JsonNode relationshipListNode = jsonNode.get("relationship-list"); + if (jsonNode.has(RELATIONSHIP_LIST)) { + JsonNode relationshipListNode = jsonNode.get(RELATIONSHIP_LIST); if (relationshipListNode.has("relationship")) { JsonNode relationshipNode = relationshipListNode.get("relationship"); vmEntity.getRelationshipList().setRelationships(convertRelationships(relationshipNode)); @@ -92,8 +92,8 @@ public class AaiResponseUtil { vnfEntity.setVnfName(getTextElementByNode(jsonNode,"vnf-name")); vnfEntity.setVnfType(getTextElementByNode(jsonNode,"vnf-type")); - if (jsonNode.has("relationship-list")) { - JsonNode relationshipListNode = jsonNode.get("relationship-list"); + if (jsonNode.has(RELATIONSHIP_LIST)) { + JsonNode relationshipListNode = jsonNode.get(RELATIONSHIP_LIST); if (relationshipListNode.has("relationship")) { JsonNode relationshipNode = relationshipListNode.get("relationship"); vnfEntity.getRelationshipList().setRelationships(convertRelationships(relationshipNode)); diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/aai/config/AaiConfig.java b/holmes-actions/src/main/java/org/onap/holmes/common/aai/config/AaiConfig.java index 0161eb0..1d02c78 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/aai/config/AaiConfig.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/aai/config/AaiConfig.java @@ -15,17 +15,17 @@ package org.onap.holmes.common.aai.config; public class AaiConfig { - public static String AAI_VNF_ADDR = "/aai/v11/network/generic-vnfs/generic-vnf?"; + public static final String AAI_VNF_ADDR = "/aai/v11/network/generic-vnfs/generic-vnf?"; - public static String AAI_VM_ADDR = "/aai/v11/search/nodes-query?search-node-type=vserver&filter="; + public static final String AAI_VM_ADDR = "/aai/v11/search/nodes-query?search-node-type=vserver&filter="; - public static String X_TRANSACTION_ID = "9999"; + public static final String X_TRANSACTION_ID = "9999"; - public static String X_FROMAPP_ID = "jimmy-postman"; + public static final String X_FROMAPP_ID = "jimmy-postman"; - private static String AAI_AUTHENTICATION_USER = "AAI"; + private static final String AAI_AUTHENTICATION_USER = "AAI"; - private static String AAI_AUTHENTICATION_PAASWORD = "AAI"; + private static final String AAI_AUTHENTICATION_PAASWORD = "AAI"; public static String getAuthenticationCredentials() { String usernameAndPassword = AAI_AUTHENTICATION_USER + ":" diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/VmEntity.java b/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/VmEntity.java index 2a2f14e..7dfc5f8 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/VmEntity.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/VmEntity.java @@ -15,7 +15,6 @@ */ package org.onap.holmes.common.aai.entity; -import java.util.List; import lombok.Getter; import lombok.Setter; diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/VnfEntity.java b/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/VnfEntity.java index 4f72a30..6c1990c 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/VnfEntity.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/aai/entity/VnfEntity.java @@ -15,7 +15,6 @@ */ package org.onap.holmes.common.aai.entity; -import java.util.List; import lombok.Getter; import lombok.Setter; |