From 6ad41e3ccd398a2721f41ad61c80b7bb03f7d127 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Mon, 31 Dec 2018 17:21:27 +0200 Subject: Merge from ECOMP's repository Main Features -------------- - Async-Instantiation jobs mechanism major update; still WIP (package `org.onap.vid.job`) - New features in View/Edit: Activate fabric configuration; show related networks; soft delete - Support AAI service-tree traversal (`AAIServiceTree`) - In-memory cache for SDC models and certain A&AI queries (`CacheProviderWithLoadingCache`) - Upgrade TOSCA Parser and add parsing options; fix malformed TOSCA models - Resolve Cloud-Owner values for MSO - Pass X-ONAP headers to MSO Infrastructure -------------- - Remove codehaus' jackson mapper; use soley fasterxml 2.9.7 - Surefire invokes both TestNG and JUnit tests - Support Kotlin source files - AaiController2 which handles errors in a "Spring manner" - Inline generated-sources and remove jsonschema2pojo Quality -------- - Cumulative bug fixes (A&AI API, UI timeouts, and many more) - Many Sonar issues cleaned-up - Some unused classes removed - Minor changes in vid-automation project, allowing some API verification to run Hard Merges ------------ - HTTP Clients (MSO, A&AI, WebConfig, OutgoingRequestHeadersTest) - Moved `package org.onap.vid.controllers` to `controller`, without plural -- just to keep semantic sync with ECOMP. Reference commit in ECOMP: 3d1141625 Issue-ID: VID-378 Change-Id: I9c8d1e74caa41815891d441fc0760bb5f29c5788 Signed-off-by: Ittay Stern --- .../CloudRegion.java | 55 ++++++++++++++ .../AaiGetNetworkCollectionDetails/Network.java | 16 ++++- .../ServiceInstance.java | 42 +++++++++-- .../model/AaiGetNetworkCollectionDetails/Vlan.java | 41 +++++++++++ .../model/AaiGetNetworkCollectionDetails/Vnf.java | 84 ++++++++++++++++++++++ 5 files changed, 233 insertions(+), 5 deletions(-) create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/CloudRegion.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Vlan.java create mode 100644 vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Vnf.java (limited to 'vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails') diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/CloudRegion.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/CloudRegion.java new file mode 100644 index 000000000..38dd2b128 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/CloudRegion.java @@ -0,0 +1,55 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.apache.commons.lang3.ObjectUtils; + +import java.util.List; + +import static java.util.Collections.emptyList; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class CloudRegion { + + private final String cloudOwner; + private final String cloudRegionId; + + public CloudRegion( + @JsonProperty("cloud-owner") String cloudOwner, + @JsonProperty("cloud-region-id") String cloudRegionId + ) { + this.cloudOwner = cloudOwner; + this.cloudRegionId = cloudRegionId; + } + + public String getCloudOwner() { + return cloudOwner; + } + + public String getCloudRegionId() { + return cloudRegionId; + } + + /* + This will handle container like: + { + "cloud-region": [{ + "cloud-owner": "alfi", + "cloud-region-id": "foo", + . . . + }, { + "cloud-owner": "alba", + "cloud-region-id": "bar", + */ + public static class Collection { + private final List cloudRegions; + + public Collection(@JsonProperty("cloud-region") List cloudRegions) { + this.cloudRegions = ObjectUtils.defaultIfNull(cloudRegions, emptyList()); + } + + public List getCloudRegions() { + return cloudRegions; + } + } +} 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 index 29450a8f8..41b720a4d 100644 --- 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 @@ -2,9 +2,10 @@ package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import org.onap.vid.aai.model.interfaces.AaiModelWithRelationships; @JsonIgnoreProperties(ignoreUnknown = true) -public class Network { +public class Network implements AaiModelWithRelationships { @JsonProperty("network-id") private String networkId; @JsonProperty("network-name") @@ -19,6 +20,8 @@ public class Network { private Boolean isBoundToVpn; @JsonProperty("resource-version") private String resourceVersion; + @JsonProperty("orchestration-status") + private String orchestrationStatus; @JsonProperty("is-provider-network") private Boolean isProviderNetwork; @JsonProperty("is-shared-network") @@ -99,6 +102,16 @@ public class Network { this.resourceVersion = resourceVersion; } + @JsonProperty("orchestration-status") + public String getOrchestrationStatus() { + return orchestrationStatus; + } + + @JsonProperty("orchestration-status") + public void setOrchestrationStatus(String orchestrationStatus) { + this.orchestrationStatus = orchestrationStatus; + } + @JsonProperty("is-provider-network") public Boolean getIsProviderNetwork() { return isProviderNetwork; @@ -129,6 +142,7 @@ public class Network { this.isExternalNetwork = isExternalNetwork; } + @Override @JsonProperty("relationship-list") public RelationshipList getRelationshipList() { return relationshipList; 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 index c366402e4..49b8536c1 100644 --- 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 @@ -1,17 +1,51 @@ package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import org.onap.vid.aai.model.interfaces.AaiModelWithRelationships; + +import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; @JsonIgnoreProperties(ignoreUnknown = true) -public class ServiceInstance { +public class ServiceInstance implements AaiModelWithRelationships { + + private final String serviceInstanceId; + private final String serviceInstanceName; + private final String resourceVersion; + private final RelationshipList relationshipList; + + public ServiceInstance( + @JsonProperty("service-instance-id") String serviceInstanceId, + @JsonProperty("service-instance-name") String serviceInstanceName, + @JsonProperty("resource-version") String resourceVersion, + @JsonProperty("relationship-list") RelationshipList relationshipList + ) { + this.serviceInstanceId = serviceInstanceId; + this.serviceInstanceName = serviceInstanceName; + this.resourceVersion = resourceVersion; + this.relationshipList = relationshipList; + } @JsonProperty("service-instance-id") - public String serviceInstanceId; + public String getServiceInstanceId() { + return serviceInstanceId; + } + + @JsonProperty("service-instance-name") + @JsonInclude(NON_NULL) + public String getServiceInstanceName() { + return serviceInstanceName; + } @JsonProperty("resource-version") - public String resourceVersion; + public String getResourceVersion() { + return resourceVersion; + } + @Override @JsonProperty("relationship-list") - public RelationshipList relationshipList; + public RelationshipList getRelationshipList() { + return relationshipList; + } } diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Vlan.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Vlan.java new file mode 100644 index 000000000..a18464850 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Vlan.java @@ -0,0 +1,41 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.onap.vid.aai.model.interfaces.AaiModelWithRelationships; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class Vlan implements AaiModelWithRelationships { + + public Vlan( + @JsonProperty("vlan-interface") String vlanInterface, + @JsonProperty("vlan-id-inner") String vlanIdInner, + @JsonProperty("relationship-list") RelationshipList relationshipList) { + this.vlanInterface = vlanInterface; + this.vlanIdInner = vlanIdInner; + this.relationshipList = relationshipList; + } + + @JsonProperty("vlan-interface") + private final String vlanInterface; + + @JsonProperty("vlan-id-inner") + private final String vlanIdInner; + + @JsonProperty("relationship-list") + public final RelationshipList relationshipList; + + public String getVlanInterface() { + return vlanInterface; + } + + public String getVlanIdInner() { + return vlanIdInner; + } + + @Override + public RelationshipList getRelationshipList() { + return relationshipList; + } + +} diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Vnf.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Vnf.java new file mode 100644 index 000000000..5dc6e4d3b --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetNetworkCollectionDetails/Vnf.java @@ -0,0 +1,84 @@ +package org.onap.vid.aai.model.AaiGetNetworkCollectionDetails; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.onap.vid.aai.model.interfaces.AaiModelWithRelationships; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class Vnf implements AaiModelWithRelationships { + @JsonProperty("vnf-id") + private String vnfId; + @JsonProperty("vnf-name") + private String vnfName; + @JsonProperty("vnf-type") + private String vnfType; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("orchestration-status") + private String orchestrationStatus; + @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("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonProperty("orchestration-status") + public String getOrchestrationStatus() { + return orchestrationStatus; + } + + @JsonProperty("orchestration-status") + public void setOrchestrationStatus(String orchestrationStatus) { + this.orchestrationStatus = orchestrationStatus; + } + + @Override + @JsonProperty("relationship-list") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + @JsonProperty("relationship-list") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + +} -- cgit 1.2.3-korg