From c72d565bb58226b20625b2bce5f0019046bee649 Mon Sep 17 00:00:00 2001 From: "Sonsino, Ofir (os0695)" Date: Tue, 10 Jul 2018 14:20:54 +0300 Subject: Merge 1806 code of vid-common Change-Id: I75d52abed4a24dfe3827d79edc4a2938726aa87a Issue-ID: VID-208 Signed-off-by: Sonsino, Ofir (os0695) --- .../model/AaiGetInstanceGroupsByCloudRegion.java | 20 +++ .../AaiGetNetworkCollectionDetails.java | 23 +++ .../AaiGetNetworkCollectionDetailsHelper.java | 38 +++++ .../AaiGetRelatedInstanceGroupsByVnfId.java | 181 +++++++++++++++++++++ .../AaiGetNetworkCollectionDetails/Collection.java | 130 +++++++++++++++ .../InstanceGroup.java | 105 ++++++++++++ .../AaiGetNetworkCollectionDetails/Network.java | 142 ++++++++++++++++ .../RelatedToProperty.java | 37 +++++ .../Relationship.java | 67 ++++++++ .../RelationshipData.java | 29 ++++ .../RelationshipList.java | 25 +++ .../AaiGetNetworkCollectionDetails/Result.java | 64 ++++++++ .../ServiceInstance.java | 17 ++ .../aai/model/AaiGetPortMirroringSourcePorts.java | 18 ++ .../onap/vid/aai/model/AaiNodeQueryResponse.java | 26 +++ .../org/onap/vid/aai/model/InstanceGroupInfo.java | 32 ++++ .../onap/vid/aai/model/InstanceGroupWrapper.java | 20 +++ .../onap/vid/aai/model/PortDetailsTranslator.java | 138 ++++++++++++++++ .../java/org/onap/vid/aai/model/Properties.java | 33 ++++ .../java/org/onap/vid/aai/model/RelatedTo.java | 39 +++++ .../org/onap/vid/aai/model/RelatedToProperty.java | 6 +- .../java/org/onap/vid/aai/model/Relationship.java | 6 +- .../org/onap/vid/aai/model/RelationshipData.java | 5 +- .../org/onap/vid/aai/model/RelationshipList.java | 4 +- .../java/org/onap/vid/aai/model/ResourceType.java | 44 +++++ .../java/org/onap/vid/aai/model/SimpleResult.java | 85 ++++++++++ 26 files changed, 1324 insertions(+), 10 deletions(-) create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetInstanceGroupsByCloudRegion.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetails.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetailsHelper.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetRelatedInstanceGroupsByVnfId.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Collection.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/InstanceGroup.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Network.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelatedToProperty.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Relationship.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelationshipData.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelationshipList.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Result.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/ServiceInstance.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPortMirroringSourcePorts.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiNodeQueryResponse.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/InstanceGroupInfo.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/InstanceGroupWrapper.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/PortDetailsTranslator.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/Properties.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedTo.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/ResourceType.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/SimpleResult.java (limited to 'vid-app-common/src/main/java/org/onap/vid/aai/model') diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetInstanceGroupsByCloudRegion.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetInstanceGroupsByCloudRegion.java new file mode 100644 index 00000000..a1fec6b8 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetInstanceGroupsByCloudRegion.java @@ -0,0 +1,20 @@ +package org.onap.vid.aai.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class AaiGetInstanceGroupsByCloudRegion { + + private final List results; + + public AaiGetInstanceGroupsByCloudRegion(@JsonProperty("results") List results) { + this.results = results; + } + + public List getResults() { + return results; + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetails.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetails.java new file mode 100644 index 00000000..a1047862 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetails.java @@ -0,0 +1,23 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class AaiGetNetworkCollectionDetails { + + public AaiGetNetworkCollectionDetails(){ + results = new Result(); + } + @JsonProperty("results") + private Result results = null; + + @JsonProperty("results") + public Result getResults() { + return results; + } + + @JsonProperty("results") + public void setResults(Result results) { + this.results = results; + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetailsHelper.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetailsHelper.java new file mode 100644 index 00000000..2d3cfb91 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetNetworkCollectionDetailsHelper.java @@ -0,0 +1,38 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AaiGetNetworkCollectionDetailsHelper { + @JsonProperty("results") + private List results = null; + @JsonIgnore + private Map additionalProperties = new HashMap(); + + @JsonProperty("results") + public List getResults() { + return results; + } + + @JsonProperty("results") + public void setResults(List results) { + this.results = results; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetRelatedInstanceGroupsByVnfId.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetRelatedInstanceGroupsByVnfId.java new file mode 100644 index 00000000..d5556511 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/AaiGetRelatedInstanceGroupsByVnfId.java @@ -0,0 +1,181 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + + +@JsonIgnoreProperties(ignoreUnknown = true) +public class AaiGetRelatedInstanceGroupsByVnfId { + + @JsonProperty("vnf-id") + private String vnfId; + @JsonProperty("vnf-name") + private String vnfName; + @JsonProperty("vnf-type") + private String vnfType; + @JsonProperty("prov-status") + private String provStatus; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("equipment-role") + private String equipmentRole; + @JsonProperty("in-maint") + private Boolean inMaint; + @JsonProperty("is-closed-loop-disabled") + private Boolean isClosedLoopDisabled; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("model-invariant-id") + private String modelInvariantId; + @JsonProperty("model-version-id") + private String modelVersionId; + @JsonProperty("model-customization-id") + private String modelCustomizationId; + @JsonProperty("selflink") + private String selflink; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + + + @JsonProperty("vnf-id") + public String getVnfId() { + return vnfId; + } + + @JsonProperty("vnf-id") + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + @JsonProperty("vnf-name") + public String getVnfName() { + return vnfName; + } + + @JsonProperty("vnf-name") + public void setVnfName(String vnfName) { + this.vnfName = vnfName; + } + + @JsonProperty("vnf-type") + public String getVnfType() { + return vnfType; + } + + @JsonProperty("vnf-type") + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + @JsonProperty("prov-status") + public String getProvStatus() { + return provStatus; + } + + @JsonProperty("prov-status") + public void setProvStatus(String provStatus) { + this.provStatus = provStatus; + } + + @JsonProperty("operational-status") + public String getOperationalStatus() { + return operationalStatus; + } + + @JsonProperty("operational-status") + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + @JsonProperty("equipment-role") + public String getEquipmentRole() { + return equipmentRole; + } + + @JsonProperty("equipment-role") + public void setEquipmentRole(String equipmentRole) { + this.equipmentRole = equipmentRole; + } + + @JsonProperty("in-maint") + public Boolean getInMaint() { + return inMaint; + } + + @JsonProperty("in-maint") + public void setInMaint(Boolean inMaint) { + this.inMaint = inMaint; + } + + @JsonProperty("is-closed-loop-disabled") + public Boolean getIsClosedLoopDisabled() { + return isClosedLoopDisabled; + } + + @JsonProperty("is-closed-loop-disabled") + public void setIsClosedLoopDisabled(Boolean isClosedLoopDisabled) { + this.isClosedLoopDisabled = isClosedLoopDisabled; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonProperty("model-invariant-id") + public String getModelInvariantId() { + return modelInvariantId; + } + + @JsonProperty("model-invariant-id") + public void setModelInvariantId(String modelInvariantId) { + this.modelInvariantId = modelInvariantId; + } + + @JsonProperty("model-version-id") + public String getModelVersionId() { + return modelVersionId; + } + + @JsonProperty("model-version-id") + public void setModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + } + + @JsonProperty("model-customization-id") + public String getModelCustomizationId() { + return modelCustomizationId; + } + + @JsonProperty("model-customization-id") + public void setModelCustomizationId(String modelCustomizationId) { + this.modelCustomizationId = modelCustomizationId; + } + + @JsonProperty("selflink") + public String getSelflink() { + return selflink; + } + + @JsonProperty("selflink") + public void setSelflink(String selflink) { + this.selflink = selflink; + } + + @JsonProperty("relationship-list") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + @JsonProperty("relationship-list") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Collection.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Collection.java new file mode 100644 index 00000000..7badaa29 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Collection.java @@ -0,0 +1,130 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class Collection { + @JsonProperty("collection-id") + private String collectionId; + @JsonProperty("model-invariant-id") + private String modelInvariantId; + @JsonProperty("model-version-id") + private String modelVersionId; + @JsonProperty("collection-name") + private String collectionName; + @JsonProperty("collection-type") + private String collectionType; + @JsonProperty("collection-role") + private String collectionRole; + @JsonProperty("collection-function") + private String collectionFunction; + @JsonProperty("collection-customization-id") + private String collectionCustomizationId; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + @JsonProperty("resource-version") + private String resourceVersion; + + @JsonProperty("collection-id") + public String getCollectionId() { + return collectionId; + } + + @JsonProperty("collection-id") + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + @JsonProperty("model-invariant-id") + public String getModelInvariantId() { + return modelInvariantId; + } + + @JsonProperty("model-invariant-id") + public void setModelInvariantId(String modelInvariantId) { + this.modelInvariantId = modelInvariantId; + } + + @JsonProperty("model-version-id") + public String getModelVersionId() { + return modelVersionId; + } + + @JsonProperty("model-version-id") + public void setModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + } + + @JsonProperty("collection-name") + public String getCollectionName() { + return collectionName; + } + + @JsonProperty("collection-name") + public void setCollectionName(String collectionName) { + this.collectionName = collectionName; + } + + @JsonProperty("collection-type") + public String getCollectionType() { + return collectionType; + } + + @JsonProperty("collection-type") + public void setCollectionType(String collectionType) { + this.collectionType = collectionType; + } + + @JsonProperty("collection-role") + public String getCollectionRole() { + return collectionRole; + } + + @JsonProperty("collection-role") + public void setCollectionRole(String collectionRole) { + this.collectionRole = collectionRole; + } + + @JsonProperty("collection-function") + public String getCollectionFunction() { + return collectionFunction; + } + + @JsonProperty("collection-function") + public void setCollectionFunction(String collectionFunction) { + this.collectionFunction = collectionFunction; + } + + @JsonProperty("collection-customization-id") + public String getCollectionCustomizationId() { + return collectionCustomizationId; + } + + @JsonProperty("collection-customization-id") + public void setCollectionCustomizationId(String collectionCustomizationId) { + this.collectionCustomizationId = collectionCustomizationId; + } + + @JsonProperty("relationship-list") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + @JsonProperty("relationship-list") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/InstanceGroup.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/InstanceGroup.java new file mode 100644 index 00000000..b540fa40 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/InstanceGroup.java @@ -0,0 +1,105 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class InstanceGroup { + @JsonProperty("instance-group-role") + private String instanceGroupRole; + @JsonProperty("model-invariant-id") + private String modelInvariantId; + @JsonProperty("model-version-id") + private String modelVersionId; + private String id; + private String description; + @JsonProperty("instance-group-type") + private String instanceGroupType; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("instance-group-name") + private String instanceGroupName; + @JsonProperty("instance-group-function") + private String instanceGroupFunction; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + + public InstanceGroup(){ + super(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public InstanceGroup( + @JsonProperty("instance-group-role") + String instanceGroupRole, + @JsonProperty("model-invariant-id") + String modelInvariantId, + @JsonProperty("model-version-id") + String modelVersionId, + @JsonProperty(value = "id", required = true) + String id, + @JsonProperty(value = "description", required = true) + String description, + @JsonProperty(value = "instance-group-type", required = true) + String instanceGroupType, + @JsonProperty("resource-version") + String resourceVersion, + @JsonProperty("instance-group-name") + String instanceGroupName, + @JsonProperty("instance-group-function") + String instanceGroupFunction, + @JsonProperty("relationship-list") + RelationshipList relationshipList) { + this.instanceGroupRole = instanceGroupRole; + this.modelInvariantId = modelInvariantId; + this.modelVersionId = modelVersionId; + this.id = id; + this.description = description; + this.instanceGroupType = instanceGroupType; + this.resourceVersion = resourceVersion; + this.instanceGroupName = instanceGroupName; + this.instanceGroupFunction = instanceGroupFunction; + this.relationshipList = relationshipList; + } + + public String getInstanceGroupRole() { + return instanceGroupRole; + } + + public String getModelInvariantId() { + return modelInvariantId; + } + + public String getModelVersionId() { + return modelVersionId; + } + + public String getId() { + return id; + } + + public String getDescription() { + return description; + } + + public String getInstanceGroupType() { + return instanceGroupType; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public String getInstanceGroupName() { + return instanceGroupName; + } + + public String getInstanceGroupFunction() { + return instanceGroupFunction; + } + + public RelationshipList getRelationshipList() { + return relationshipList; + } + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Network.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Network.java new file mode 100644 index 00000000..29450a8f --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Network.java @@ -0,0 +1,142 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class Network { + @JsonProperty("network-id") + private String networkId; + @JsonProperty("network-name") + private String networkName; + @JsonProperty("network-type") + private String networkType; + @JsonProperty("network-role") + private String networkRole; + @JsonProperty("network-technology") + private String networkTechnology; + @JsonProperty("is-bound-to-vpn") + private Boolean isBoundToVpn; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("is-provider-network") + private Boolean isProviderNetwork; + @JsonProperty("is-shared-network") + private Boolean isSharedNetwork; + @JsonProperty("is-external-network") + private Boolean isExternalNetwork; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + + + @JsonProperty("network-id") + public String getNetworkId() { + return networkId; + } + + @JsonProperty("network-id") + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + @JsonProperty("network-name") + public String getNetworkName() { + return networkName; + } + + @JsonProperty("network-name") + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + @JsonProperty("network-type") + public String getNetworkType() { + return networkType; + } + + @JsonProperty("network-type") + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + @JsonProperty("network-role") + public String getNetworkRole() { + return networkRole; + } + + @JsonProperty("network-role") + public void setNetworkRole(String networkRole) { + this.networkRole = networkRole; + } + + @JsonProperty("network-technology") + public String getNetworkTechnology() { + return networkTechnology; + } + + @JsonProperty("network-technology") + public void setNetworkTechnology(String networkTechnology) { + this.networkTechnology = networkTechnology; + } + + @JsonProperty("is-bound-to-vpn") + public Boolean getIsBoundToVpn() { + return isBoundToVpn; + } + + @JsonProperty("is-bound-to-vpn") + public void setIsBoundToVpn(Boolean isBoundToVpn) { + this.isBoundToVpn = isBoundToVpn; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonProperty("is-provider-network") + public Boolean getIsProviderNetwork() { + return isProviderNetwork; + } + + @JsonProperty("is-provider-network") + public void setIsProviderNetwork(Boolean isProviderNetwork) { + this.isProviderNetwork = isProviderNetwork; + } + + @JsonProperty("is-shared-network") + public Boolean getIsSharedNetwork() { + return isSharedNetwork; + } + + @JsonProperty("is-shared-network") + public void setIsSharedNetwork(Boolean isSharedNetwork) { + this.isSharedNetwork = isSharedNetwork; + } + + @JsonProperty("is-external-network") + public Boolean getIsExternalNetwork() { + return isExternalNetwork; + } + + @JsonProperty("is-external-network") + public void setIsExternalNetwork(Boolean isExternalNetwork) { + this.isExternalNetwork = isExternalNetwork; + } + + @JsonProperty("relationship-list") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + @JsonProperty("relationship-list") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelatedToProperty.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelatedToProperty.java new file mode 100644 index 00000000..1c10500a --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelatedToProperty.java @@ -0,0 +1,37 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class RelatedToProperty { + + public String getPropertyKey() { + return propertyKey; + } + + + public void setPropertyKey(String propertyKey) { + this.propertyKey = propertyKey; + } + + + public String getPropertyValue() { + return propertyValue; + } + + + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + + @JsonProperty("property-key") + public String propertyKey; + + + @JsonProperty("property-value") + public String propertyValue; + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Relationship.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Relationship.java new file mode 100644 index 00000000..56c08ed0 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Relationship.java @@ -0,0 +1,67 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + + +@JsonIgnoreProperties(ignoreUnknown = true) +public class Relationship { + + @JsonProperty("related-to") + public String relatedTo; + + @JsonProperty("related-link") + public String relatedLink; + + @JsonProperty("relationship-label") + public String relationshipLabel; + + @JsonProperty("relationship-data") + public List relationshipData; + + @JsonProperty("related-to-property") + public List relatedToProperty; + + + public String getRelatedTo() { + return relatedTo; + } + + public void setRelatedTo(String relatedTo) { + this.relatedTo = relatedTo; + } + + public String getRelatedLink() { + return relatedLink; + } + + public void setRelatedLink(String relatedLink) { + this.relatedLink = relatedLink; + } + + public List getRelationDataList() { + return relationshipData; + } + + public void setRelationDataList(List relationDataList) { + this.relationshipData = relationDataList; + } + + public List getRelatedToPropertyList() { + return relatedToProperty; + } + + public void setRelatedToPropertyList(List relatedToPropertyList) { + this.relatedToProperty = relatedToPropertyList; + } + + public String getRelationshipLabel() { + return relationshipLabel; + } + + public void setRelationshipLabel(String relationshipLabel) { + this.relationshipLabel = relationshipLabel; + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelationshipData.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelationshipData.java new file mode 100644 index 00000000..48cc000e --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelationshipData.java @@ -0,0 +1,29 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class RelationshipData { + @JsonProperty("relationship-key") + public String getRelationshipKey() { + return relationshipKey; + } + @JsonProperty("relationship-key") + public void setRelationshipKey(String relationshipKey) { + this.relationshipKey = relationshipKey; + } + @JsonProperty("relationship-value") + public String getRelationshipValue() { + return relationshipValue; + } + @JsonProperty("relationship-value") + public void setRelationshipValue(String relationshipValue) { + this.relationshipValue = relationshipValue; + } + + public String relationshipKey; + + public String relationshipValue; + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelationshipList.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelationshipList.java new file mode 100644 index 00000000..df1e03a0 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/RelationshipList.java @@ -0,0 +1,25 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class RelationshipList { + + @JsonProperty("relationship") + public List getRelationship() { + return relationship; + } + + @JsonProperty("relationship") + public void setRelationship(List relationship) { + this.relationship = relationship; + } + + public List relationship; + + + + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Result.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Result.java new file mode 100644 index 00000000..776493a5 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Result.java @@ -0,0 +1,64 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.ArrayList; +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class Result { + + @JsonProperty("service-instance") + private ServiceInstance serviceInstance; + @JsonProperty("collection") + private Collection collection; + @JsonProperty("instance-group") + private InstanceGroup instanceGroup; + @JsonProperty("networks") + private List networks; + + public Result(){ + this.networks = new ArrayList<>(); + } + + + @JsonProperty("service-instance") + public ServiceInstance getServiceInstance() { + return serviceInstance; + } + + @JsonProperty("service-instance") + public void setServiceInstance(ServiceInstance serviceInstance) { + this.serviceInstance = serviceInstance; + } + + @JsonProperty("collection") + public Collection getCollection() { + return collection; + } + + @JsonProperty("collection") + public void setCollection(Collection collection) { + this.collection = collection; + } + + @JsonProperty("instance-group") + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + + @JsonProperty("instance-group") + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } + + @JsonProperty("networks") + public List getNetworks() { return networks; } + + @JsonProperty("networks") + public void setNetworks(List networks) { this.networks = networks; } + + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/ServiceInstance.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/ServiceInstance.java new file mode 100644 index 00000000..c366402e --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/ServiceInstance.java @@ -0,0 +1,17 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ServiceInstance { + + @JsonProperty("service-instance-id") + public String serviceInstanceId; + + @JsonProperty("resource-version") + public String resourceVersion; + + @JsonProperty("relationship-list") + public RelationshipList relationshipList; +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPortMirroringSourcePorts.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPortMirroringSourcePorts.java new file mode 100644 index 00000000..47a57daf --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPortMirroringSourcePorts.java @@ -0,0 +1,18 @@ +package org.onap.vid.aai.model; + +import org.codehaus.jackson.annotate.JsonProperty; + +import java.util.List; + +public class AaiGetPortMirroringSourcePorts { + + private final List results; + + public AaiGetPortMirroringSourcePorts(@JsonProperty("results") List results) { + this.results = results; + } + + public List getResults() { + return results; + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiNodeQueryResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiNodeQueryResponse.java new file mode 100644 index 00000000..18bf1619 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiNodeQueryResponse.java @@ -0,0 +1,26 @@ +package org.onap.vid.aai.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class AaiNodeQueryResponse { + + public static class ResultData { + + public final ResourceType resourceType; + public final String resourceLink; + + public ResultData(@JsonProperty("resource-type") ResourceType resourceType, + @JsonProperty("resource-link") String resourceLink) { + this.resourceType = resourceType; + this.resourceLink = resourceLink; + } + } + + public final List resultData; + + public AaiNodeQueryResponse(@JsonProperty("result-data") List resultData) { + this.resultData = resultData; + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/InstanceGroupInfo.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/InstanceGroupInfo.java new file mode 100644 index 00000000..c2eb7094 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/InstanceGroupInfo.java @@ -0,0 +1,32 @@ +package org.onap.vid.aai.model; + +public class InstanceGroupInfo { + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + private String type; + private String name; + + public InstanceGroupInfo(String name){ + this.name = name; + this.type = "instance-group"; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/InstanceGroupWrapper.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/InstanceGroupWrapper.java new file mode 100644 index 00000000..879fa63a --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/InstanceGroupWrapper.java @@ -0,0 +1,20 @@ +package org.onap.vid.aai.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.onap.vid.aai.model.AaiGetNetworkCollectionDetails.InstanceGroup; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class InstanceGroupWrapper { + + private InstanceGroup instanceGroup; + + @JsonProperty("instance-group") + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + @JsonProperty("instance-group") + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/PortDetailsTranslator.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/PortDetailsTranslator.java new file mode 100644 index 00000000..f8980457 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/PortDetailsTranslator.java @@ -0,0 +1,138 @@ +package org.onap.vid.aai.model; + + +import com.google.common.collect.ImmutableList; +import org.onap.vid.aai.AaiResponse; +import org.onap.vid.properties.Features; +import org.togglz.core.manager.FeatureManager; + +import javax.inject.Inject; +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +public class PortDetailsTranslator { + + @Inject + FeatureManager featureManager; + + public static class PortDetailsOk extends PortDetails { + + private final String interfaceId; + private final String interfaceName; + private final boolean isPortMirrored; + + public PortDetailsOk(String interfaceId, String interfaceName, boolean isPortMirrored) { + this.interfaceId = interfaceId; + this.interfaceName = interfaceName; + this.isPortMirrored = isPortMirrored; + } + + public String getInterfaceId() { + return interfaceId; + } + + public String getInterfaceName() { + return interfaceName; + } + + public boolean getIsPortMirrored() { + return isPortMirrored; + } + } + + public abstract static class PortDetails { + } + + public static class PortDetailsError extends PortDetails { + private final String errorDescription; + private final String rawAaiResponse; + + public PortDetailsError(String errorDescription, String rawAaiResponse){ + this.errorDescription = errorDescription; + this.rawAaiResponse = rawAaiResponse; + } + + public String getErrorDescription() { + return errorDescription; + } + + public String getRawAaiResponse() { + return rawAaiResponse; + } + } + + public static PortDetails extractPortDetailsFromProperties(Properties properties, String rawPayload){ + List errorDescriptions = new LinkedList<>(); + describeIfNullOrEmpty("interface-id", properties.getInterfaceId(), errorDescriptions); + describeIfNullOrEmpty("interface-name", properties.getInterfaceName(), errorDescriptions); + describeIfNullOrEmpty("is-port-mirrored", properties.getIsPortMirrored(), errorDescriptions); + + if(errorDescriptions.isEmpty()){ + return new PortDetailsOk(properties.getInterfaceId(), properties.getInterfaceName(), properties.getIsPortMirrored()); + } else { + return new PortDetailsError(String.join(" ", errorDescriptions), rawPayload); + } + } + + private static void describeIfNullOrEmpty(String name, Object value, List errorDescriptions) { + if (value == null) { + errorDescriptions.add("Value of '" + name + "' is missing."); + } else if (value.toString().isEmpty()) { + errorDescriptions.add("Value of '" + name + "' is empty."); + } + } + + private static Optional> extractErrorResponseIfHttpError(AaiResponse aaiResponse, String rawPayload) { + if (aaiResponse.getHttpCode() != org.springframework.http.HttpStatus.OK.value()) { + final String errorMessage = aaiResponse.getErrorMessage(); + return Optional.of(ImmutableList.of(new PortDetailsError( + "Got " + aaiResponse.getHttpCode() + " from aai", + errorMessage != null ? errorMessage.toString() : rawPayload) + )); + } else { + return Optional.empty(); + } + } + + public List extractPortDetailsInternal(AaiGetPortMirroringSourcePorts aaiGetPortsResponse, String rawPayload){ + List filteredResult = getFilteredPortList(aaiGetPortsResponse.getResults()); + + return filteredResult.stream() + .map(SimpleResult::getProperties) + .map(p -> extractPortDetailsFromProperties(p, rawPayload)) + .collect(Collectors.toList()); + } + + public List getFilteredPortList(List results) { + String LINTERFACE = "l-interface"; + + final Predicate ifIsPort = (SimpleResult r) -> LINTERFACE.equals(r.getNodeType()); + Predicate ifIsSource = getIsSourcePredicate(); + + return results.stream() + .filter(ifIsPort) + .filter(ifIsSource) + .collect(Collectors.toList()); + } + + private Predicate getIsSourcePredicate() { + boolean FLAG_ADVANCED_PORTS_FILTER = featureManager.isActive(Features.FLAG_ADVANCED_PORTS_FILTER); + + if (FLAG_ADVANCED_PORTS_FILTER) { + String PORT_LABEL = "org.onap.relationships.inventory.Source"; + return (SimpleResult r) -> r.getRelatedTo().stream() + .anyMatch(relatedTo -> PORT_LABEL.equalsIgnoreCase(relatedTo.getRelationshipLabel())); + } else { + return (SimpleResult r) -> true; + } + } + + public List extractPortDetails(AaiResponse aaiGetPortsResponse, String rawPayload){ + return extractErrorResponseIfHttpError(aaiGetPortsResponse, rawPayload).orElseGet(() -> extractPortDetailsInternal(aaiGetPortsResponse.getT(), rawPayload)); + + } + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Properties.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Properties.java new file mode 100644 index 00000000..6fecbed5 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Properties.java @@ -0,0 +1,33 @@ +package org.onap.vid.aai.model; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; +import org.codehaus.jackson.annotate.JsonProperty; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class Properties { + + private final String interfaceName; + private final String interfaceId; + private final Boolean isPortMirrored; + + public Properties( + @JsonProperty("interface-name") String interfaceName, + @JsonProperty("interface-id") String interfaceId, + @JsonProperty("is-port-mirrored") Boolean isPortMirrored) { + this.interfaceName = interfaceName; + this.interfaceId = interfaceId; + this.isPortMirrored = isPortMirrored; + } + + public String getInterfaceName() { + return interfaceName; + } + + public String getInterfaceId() { + return interfaceId; + } + + public Boolean getIsPortMirrored() { + return isPortMirrored; + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedTo.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedTo.java new file mode 100644 index 00000000..f14a445f --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedTo.java @@ -0,0 +1,39 @@ +package org.onap.vid.aai.model; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; +import org.codehaus.jackson.annotate.JsonProperty; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class RelatedTo { + private final String id; + private final String relationshipLabel; + private final String nodeType; + private final String url; + + public RelatedTo( + @JsonProperty("id") String id, + @JsonProperty("relationship-label") String relationshipLabel, + @JsonProperty("node-type") String nodeType, + @JsonProperty("url") String url) { + this.id = id; + this.relationshipLabel = relationshipLabel; + this.nodeType = nodeType; + this.url = url; + } + + public String getId() { + return id; + } + + public String getRelationshipLabel() { + return relationshipLabel; + } + + public String getNodeType() { + return nodeType; + } + + public String getUrl() { + return url; + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java index 38003aec..a2a98fc2 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java @@ -1,8 +1,10 @@ package org.onap.vid.aai.model; +import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; +@JsonIgnoreProperties(ignoreUnknown = true) public class RelatedToProperty { public String getPropertyKey() { @@ -27,8 +29,8 @@ public class RelatedToProperty { @JsonProperty("property-key") public String propertyKey; - - + + @JsonProperty("property-value") public String propertyValue; diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java index c80d5b6b..6bf63c43 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java @@ -1,14 +1,14 @@ package org.onap.vid.aai.model; +import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; - import java.util.List; - +@JsonIgnoreProperties(ignoreUnknown = true) public class Relationship { - + @JsonProperty("related-to") public String relatedTo; diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java index 5d2d4091..41536651 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java @@ -1,8 +1,9 @@ package org.onap.vid.aai.model; - +import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; +@JsonIgnoreProperties(ignoreUnknown = true) public class RelationshipData { @JsonProperty("relationship-key") public String getRelationshipKey() { @@ -21,10 +22,8 @@ public class RelationshipData { this.relationshipValue = relationshipValue; } - @JsonProperty("relationship-key") public String relationshipKey; - @JsonProperty("relationship-value") public String relationshipValue; } diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java index 43194fc7..b16ddd01 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java @@ -1,10 +1,11 @@ package org.onap.vid.aai.model; +import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import java.util.List; - +@JsonIgnoreProperties(ignoreUnknown = true) public class RelationshipList { @JsonProperty("relationship") @@ -17,7 +18,6 @@ public class RelationshipList { this.relationship = relationship; } - @JsonProperty("relationship") public List relationship; diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ResourceType.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ResourceType.java new file mode 100644 index 00000000..736a1aa9 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ResourceType.java @@ -0,0 +1,44 @@ +package org.onap.vid.aai.model; + +import com.fasterxml.jackson.annotation.JsonCreator; + +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public enum ResourceType { + + SERVICE_INSTANCE("service-instance", "service-instance-name"), + GENERIC_VNF("generic-vnf", "vnf-name"), + VF_MODULE("vf-module", "vf-module-name"), + VOLUME_GROUP("volume-group", "volume-group-name"); + + private static Map AAI_FORMAT_MAP = Stream + .of(ResourceType.values()) + .collect(Collectors.toMap(s -> s.aaiFormat, Function.identity())); + + private final String aaiFormat; + private final String nameFilter; + + ResourceType(String formatted, String nameFilter) { + this.aaiFormat = formatted; + this.nameFilter = nameFilter; + } + + public String getAaiFormat() { + return aaiFormat; + } + + public String getNameFilter() { + return nameFilter; + } + + @JsonCreator + public static ResourceType fromString(String string) { + return Optional + .ofNullable(AAI_FORMAT_MAP.get(string)) + .orElseThrow(() -> new IllegalArgumentException(string)); + } +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/SimpleResult.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/SimpleResult.java new file mode 100644 index 00000000..b2edfc17 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/SimpleResult.java @@ -0,0 +1,85 @@ +package org.onap.vid.aai.model; + +import org.codehaus.jackson.annotate.JsonAnyGetter; +import org.codehaus.jackson.annotate.JsonAnySetter; +import org.codehaus.jackson.annotate.JsonIgnore; +import org.codehaus.jackson.annotate.JsonProperty; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SimpleResult { + @JsonProperty("id") + private String id; + @JsonProperty("node-type") + private String nodeType; + @JsonProperty("url") + private String url; + @JsonProperty("properties") + private Properties properties; + @JsonProperty("related-to") + private List relatedTo = null; + @JsonIgnore + private Map additionalProperties = new HashMap(); + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("id") + public void setId(String id) { + this.id = id; + } + + @JsonProperty("node-type") + public String getNodeType() { + return nodeType; + } + + @JsonProperty("node-type") + public void setNodeType(String nodeType) { + this.nodeType = nodeType; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("url") + public void setUrl(String url) { + this.url = url; + } + + @JsonProperty("properties") + public Properties getProperties() { + return properties; + } + + @JsonProperty("properties") + public void setProperties(Properties properties) { + this.properties = properties; + } + + @JsonProperty("related-to") + public List getRelatedTo() { + return relatedTo; + } + + @JsonProperty("related-to") + public void setRelatedTo(List relatedTo) { + this.relatedTo = relatedTo; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } +} -- cgit 1.2.3-korg