diff options
author | seshukm <seshu.kumar.m@huawei.com> | 2020-03-02 20:37:26 +0530 |
---|---|---|
committer | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2020-03-02 15:15:47 +0000 |
commit | 5b6ae88036d652929fbf9e6923fc63f474a7fdaf (patch) | |
tree | 4ea432995a30098d5905d9531c9532b353a36923 | |
parent | 83663f38d21c37cff27f3986c49a4b4aca284c72 (diff) |
backend code for the SOTN
Issue-ID: USECASEUI-378
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Change-Id: I074f1a8bb4e676733e8702db7476c76d940c846f
49 files changed, 6103 insertions, 0 deletions
diff --git a/server/pom.xml b/server/pom.xml index 7a88c68f..047ce57d 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -342,6 +342,11 @@ <version>1.19</version> <scope>test</scope> </dependency> + <dependency> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + <version>1.1.1</version> + </dependency> </dependencies> <build> diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/RelationshipDatum.java b/server/src/main/java/org/onap/usecaseui/server/bean/RelationshipDatum.java new file mode 100644 index 00000000..28197c46 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/RelationshipDatum.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean; + +import com.fasterxml.jackson.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "relationship-key", + "relationship-value" +}) + +public class RelationshipDatum { + //Map<String, String> relationMap = new HashMap<>(); + + + @JsonProperty("relationship-key") + private String relationshipKey; + @JsonProperty("relationship-value") + private String relationshipValue; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<>(); + + @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; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/ComplexObj.java b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/ComplexObj.java new file mode 100644 index 00000000..a0f8445b --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/ComplexObj.java @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.activateEdge; + +import com.fasterxml.jackson.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "physical-location-id", + "resource-version", + "physical-location-type", + "street1", + "city", + "postal-code", + "country", + "region", + "latitude", + "longitude", + "relationship-list" +}) + +public class ComplexObj { + @JsonProperty("physical-location-id") + private String physicalLocationId; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("physical-location-type") + private String physicalLocationType; + @JsonProperty("street1") + private String street1; + @JsonProperty("city") + private String city; + @JsonProperty("postal-code") + private String postalCode; + @JsonProperty("country") + private String country; + @JsonProperty("region") + private String region; + @JsonProperty("latitude") + private String latitude; + @JsonProperty("longitude") + private String longitude; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("physical-location-id") + public String getPhysicalLocationId() { + return physicalLocationId; + } + + @JsonProperty("physical-location-id") + public void setPhysicalLocationId(String physicalLocationId) { + this.physicalLocationId = physicalLocationId; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonProperty("physical-location-type") + public String getPhysicalLocationType() { + return physicalLocationType; + } + + @JsonProperty("physical-location-type") + public void setPhysicalLocationType(String physicalLocationType) { + this.physicalLocationType = physicalLocationType; + } + + @JsonProperty("street1") + public String getStreet1() { + return street1; + } + + @JsonProperty("street1") + public void setStreet1(String street1) { + this.street1 = street1; + } + + @JsonProperty("city") + public String getCity() { + return city; + } + + @JsonProperty("city") + public void setCity(String city) { + this.city = city; + } + + @JsonProperty("postal-code") + public String getPostalCode() { + return postalCode; + } + + @JsonProperty("postal-code") + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + @JsonProperty("country") + public String getCountry() { + return country; + } + + @JsonProperty("country") + public void setCountry(String country) { + this.country = country; + } + + @JsonProperty("region") + public String getRegion() { + return region; + } + + @JsonProperty("region") + public void setRegion(String region) { + this.region = region; + } + + @JsonProperty("latitude") + public String getLatitude() { + return latitude; + } + + @JsonProperty("latitude") + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + @JsonProperty("longitude") + public String getLongitude() { + return longitude; + } + + @JsonProperty("longitude") + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + @JsonProperty("relationship-list") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + @JsonProperty("relationship-list") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/RelationshipDatum.java b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/RelationshipDatum.java new file mode 100644 index 00000000..cad2f861 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/RelationshipDatum.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.activateEdge; + +import com.fasterxml.jackson.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "relationship-key", + "relationship-value" +}) + +public class RelationshipDatum { + @JsonProperty("relationship-key") + private String relationshipKey; + @JsonProperty("relationship-value") + private String relationshipValue; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @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; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public String toString() { + return "{" + + "\"relationship-key\":\"" + relationshipKey + '\"' + + ", \"relationship-value\":\"" + relationshipValue + '\"' + + '}'; + } + + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/RelationshipList.java b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/RelationshipList.java new file mode 100644 index 00000000..7e8381f3 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/RelationshipList.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.activateEdge; + +import com.fasterxml.jackson.annotation.*; +import org.onap.usecaseui.server.service.lcm.domain.aai.bean.Relationship; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "relationship" +}) + +public class RelationshipList { + + @JsonProperty("relationship") + private List<Relationship> relationship = null; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("relationship") + public List<Relationship> getRelationship() { + return relationship; + } + + @JsonProperty("relationship") + public void setRelationship(List<Relationship> relationship) { + this.relationship = relationship; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public String toString() { + return "{" + + "\"relationship\":" + relationship + + '}'; + } + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/ServiceInstance.java b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/ServiceInstance.java new file mode 100644 index 00000000..bb636752 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/ServiceInstance.java @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.activateEdge; + +import com.fasterxml.jackson.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "service-instance-id", + "service-instance-name", + "service-type", + "service-role", + "resource-version", + "selflink", + "relationship-list" +}) + +public class ServiceInstance { + @JsonProperty("service-instance-id") + private String serviceInstanceId; + @JsonProperty("service-instance-name") + private String serviceInstanceName; + @JsonProperty("service-type") + private String serviceType; + @JsonProperty("service-role") + private String serviceRole; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("selflink") + private String selflink; + @JsonProperty("orchestration-status") + private String orchestrationstatus; + @JsonProperty("input-parameters") + private String inputparameters; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("service-instance-id") + public String getServiceInstanceId() { + return serviceInstanceId; + } + + @JsonProperty("service-instance-id") + public void setServiceInstanceId(String serviceInstanceId) { + this.serviceInstanceId = serviceInstanceId; + } + + @JsonProperty("service-instance-name") + public String getServiceInstanceName() { + return serviceInstanceName; + } + + @JsonProperty("service-instance-name") + public void setServiceInstanceName(String serviceInstanceName) { + this.serviceInstanceName = serviceInstanceName; + } + + @JsonProperty("service-type") + public String getServiceType() { + return serviceType; + } + + @JsonProperty("service-type") + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + @JsonProperty("service-role") + public String getServiceRole() { + return serviceRole; + } + + @JsonProperty("service-role") + public void setServiceRole(String serviceRole) { + this.serviceRole = serviceRole; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @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; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public String getOrchestrationstatus() { + return orchestrationstatus; + } + + public void setOrchestrationstatus(String orchestrationstatus) { + this.orchestrationstatus = orchestrationstatus; + } + + public String getInputparameters() { + return inputparameters; + } + + public void setInputparameters(String inputparameters) { + this.inputparameters = inputparameters; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/SiteResource.java b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/SiteResource.java new file mode 100644 index 00000000..60150d50 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/activateEdge/SiteResource.java @@ -0,0 +1,200 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.activateEdge; + +import com.fasterxml.jackson.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "site-resource-id", + "site-resource-name", + "description", + "type", + "role", + "selflink", + "operational-status", + "resource-version", + "relationship-list" +}) + +public class SiteResource { + @JsonProperty("site-resource-id") + private String siteResourceId; + @JsonProperty("site-resource-name") + private String siteResourceName; + @JsonProperty("description") + private String description; + @JsonProperty("type") + private String type; + @JsonProperty("role") + private String role; + @JsonProperty("selflink") + private String selflink; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + + + + // Added by Isaac for handling city and postal code : Begin + @JsonProperty("city") + private String city; + @JsonProperty("postal-code") + private String postalcode; + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getPostalcode() { + return postalcode; + } + + public void setPostalcode(String postalcode) { + this.postalcode = postalcode; + } + // Added by Isaac for handling city and postal code : End + + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("site-resource-id") + public String getSiteResourceId() { + return siteResourceId; + } + + @JsonProperty("site-resource-id") + public void setSiteResourceId(String siteResourceId) { + this.siteResourceId = siteResourceId; + } + + @JsonProperty("site-resource-name") + public String getSiteResourceName() { + return siteResourceName; + } + + @JsonProperty("site-resource-name") + public void setSiteResourceName(String siteResourceName) { + this.siteResourceName = siteResourceName; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("description") + public void setDescription(String description) { + this.description = description; + } + + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("type") + public void setType(String type) { + this.type = type; + } + + @JsonProperty("role") + public String getRole() { + return role; + } + + @JsonProperty("role") + public void setRole(String role) { + this.role = role; + } + + @JsonProperty("selflink") + public String getSelflink() { + return selflink; + } + + @JsonProperty("selflink") + public void setSelflink(String selflink) { + this.selflink = selflink; + } + + @JsonProperty("operational-status") + public String getOperationalStatus() { + return operationalStatus; + } + + @JsonProperty("operational-status") + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonProperty("relationship-list") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + @JsonProperty("relationship-list") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public String toString() { + return "{" + + "\"site-resource-id\":\"" + siteResourceId + '\"' + + ", \"site-resource-name\":\"" + siteResourceName + '\"' + + ", \"description\":\"" + description + '\"' + + ", \"type\":\"" + type + '\"' + + ", \"role\":\"" + role + '\"' + + ", \"selflink\":\"" + selflink + '\"' + + ", \"operational-status\":\"" + operationalStatus + '\"' + + ", \"resource-version\":\"" + resourceVersion + '\"' + + ", \"relationship-list\":" + relationshipList + + '}'; + } + + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/customer/ServiceInstance.java b/server/src/main/java/org/onap/usecaseui/server/bean/customer/ServiceInstance.java new file mode 100644 index 00000000..f955e755 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/customer/ServiceInstance.java @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.customer; + +import com.fasterxml.jackson.annotation.*; +import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; + +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "service-instance-id", + "service-instance-name", + "service-type", + "service-role", + "resource-version", + "selflink", + "relationship-list" +}) +public class ServiceInstance { + + @JsonProperty("service-instance-id") + private String serviceInstanceId; + @JsonProperty("service-instance-name") + private String serviceInstanceName; + @JsonProperty("service-type") + private String serviceType; + @JsonProperty("service-role") + private String serviceRole; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("selflink") + private String selflink; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("service-instance-id") + public String getServiceInstanceId() { + return serviceInstanceId; + } + + @JsonProperty("service-instance-id") + public void setServiceInstanceId(String serviceInstanceId) { + this.serviceInstanceId = serviceInstanceId; + } + + @JsonProperty("service-instance-name") + public String getServiceInstanceName() { + return serviceInstanceName; + } + + @JsonProperty("service-instance-name") + public void setServiceInstanceName(String serviceInstanceName) { + this.serviceInstanceName = serviceInstanceName; + } + + @JsonProperty("service-type") + public String getServiceType() { + return serviceType; + } + + @JsonProperty("service-type") + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + @JsonProperty("service-role") + public String getServiceRole() { + return serviceRole; + } + + @JsonProperty("service-role") + public void setServiceRole(String serviceRole) { + this.serviceRole = serviceRole; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @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; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + + @Override + public String toString() { + return "{" + + "\"serviceInstanceId\":\"" + serviceInstanceId + '\"' + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/customer/ServiceInstances.java b/server/src/main/java/org/onap/usecaseui/server/bean/customer/ServiceInstances.java new file mode 100644 index 00000000..489d692a --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/customer/ServiceInstances.java @@ -0,0 +1,44 @@ + +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.customer; + +import com.fasterxml.jackson.annotation.JsonProperty; + + +import java.util.ArrayList; +import java.util.List; + +public class ServiceInstances { + + @JsonProperty("service-instance") + List<ServiceInstance> serviceInstances = new ArrayList<>(); + + public List<ServiceInstance> getServiceInstances() { + return serviceInstances; + } + + public void setServiceInstances(List<ServiceInstance> serviceInstances) { + this.serviceInstances = serviceInstances; + } + + @Override + public String toString() { + return "{" + + "\"serviceInstanceList\":" + serviceInstances + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/customer/Subscription.java b/server/src/main/java/org/onap/usecaseui/server/bean/customer/Subscription.java new file mode 100644 index 00000000..99dda023 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/customer/Subscription.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.customer; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Subscription { + @JsonProperty("service-type") + private String serviceType; + + @JsonProperty("temp-ub-sub-account-id") + private String accountId; + + @JsonProperty("resource-version") + private String resourceVersion; + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @Override + public String toString() { + return "{" + + "\"serviceType\":\"" + serviceType + '\"' + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/customer/SubscriptionType.java b/server/src/main/java/org/onap/usecaseui/server/bean/customer/SubscriptionType.java new file mode 100644 index 00000000..47237145 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/customer/SubscriptionType.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.customer; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + + +public class SubscriptionType { + + @JsonProperty("service-subscription") + List<Subscription> subscriptions; + + public List<Subscription> getSubscriptions() { + return subscriptions; + } + + public void setSubscriptions(List<Subscription> subscriptions) { + this.subscriptions = subscriptions; + } + + @Override + public String toString() { + return "{" + + "\"subscriptions\":" + subscriptions + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/AllottedResource.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/AllottedResource.java new file mode 100644 index 00000000..4c3fbdd6 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/AllottedResource.java @@ -0,0 +1,227 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id", + "selflink", + "model-invariant-id", + "model-version-id", + "resource-version", + "operational-status", + "access-provider-id", + "access-client-id", + "access-topology-id", + "access-node-id", + "access-ltp-id", + "cvlan", + "vpn-name", + "relationship-list" +}) +public class AllottedResource { + + @JsonProperty("id") + private String id; + @JsonProperty("selflink") + private String selflink; + @JsonProperty("model-invariant-id") + private String modelInvariantId; + @JsonProperty("model-version-id") + private String modelVersionId; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("access-provider-id") + private String accessProviderId; + @JsonProperty("access-client-id") + private String accessClientId; + @JsonProperty("access-topology-id") + private String accessTopologyId; + @JsonProperty("access-node-id") + private String accessNodeId; + @JsonProperty("access-ltp-id") + private String accessLtpId; + @JsonProperty("cvlan") + private String cvlan; + @JsonProperty("vpn-name") + private String vpnName; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("id") + public void setId(String id) { + this.id = id; + } + + @JsonProperty("selflink") + public String getSelflink() { + return selflink; + } + + @JsonProperty("selflink") + public void setSelflink(String selflink) { + this.selflink = selflink; + } + + @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("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonProperty("operational-status") + public String getOperationalStatus() { + return operationalStatus; + } + + @JsonProperty("operational-status") + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + @JsonProperty("access-provider-id") + public String getAccessProviderId() { + return accessProviderId; + } + + @JsonProperty("access-provider-id") + public void setAccessProviderId(String accessProviderId) { + this.accessProviderId = accessProviderId; + } + + @JsonProperty("access-client-id") + public String getAccessClientId() { + return accessClientId; + } + + @JsonProperty("access-client-id") + public void setAccessClientId(String accessClientId) { + this.accessClientId = accessClientId; + } + + @JsonProperty("access-topology-id") + public String getAccessTopologyId() { + return accessTopologyId; + } + + @JsonProperty("access-topology-id") + public void setAccessTopologyId(String accessTopologyId) { + this.accessTopologyId = accessTopologyId; + } + + @JsonProperty("access-node-id") + public String getAccessNodeId() { + return accessNodeId; + } + + @JsonProperty("access-node-id") + public void setAccessNodeId(String accessNodeId) { + this.accessNodeId = accessNodeId; + } + + @JsonProperty("access-ltp-id") + public String getAccessLtpId() { + return accessLtpId; + } + + @JsonProperty("access-ltp-id") + public void setAccessLtpId(String accessLtpId) { + this.accessLtpId = accessLtpId; + } + + @JsonProperty("cvlan") + public String getCvlan() { + return cvlan; + } + + @JsonProperty("cvlan") + public void setCvlan(String cvlan) { + this.cvlan = cvlan; + } + + @JsonProperty("vpn-name") + public String getVpnName() { + return vpnName; + } + + @JsonProperty("vpn-name") + public void setVpnName(String vpnName) { + this.vpnName = vpnName; + } + + @JsonProperty("relationship-list") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + @JsonProperty("relationship-list") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Connectivity.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Connectivity.java new file mode 100644 index 00000000..74e0931a --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Connectivity.java @@ -0,0 +1,346 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "connectivity-id", + "bandwidth-profile-name", + "cir", + "eir", + "cbs", + "ebs", + "color-aware", + "coupling-flag", + "etht-svc-name", + "access-provider-id", + "access-client-id", + "access-topology-id", + "access-node-id", + "access-ltp-id", + "connectivity-selflink", + "operational-status", + "model-customization-id", + "model-invariant-id", + "model-version-id", + "resource-version" +}) + +public class Connectivity { + + @JsonProperty("connectivity-id") + private String connectivityId; + @JsonProperty("bandwidth-profile-name") + private String bandwidthProfileName; + @JsonProperty("cir") + private String cir; + @JsonProperty("eir") + private String eir; + @JsonProperty("cbs") + private String cbs; + @JsonProperty("ebs") + private String ebs; + @JsonProperty("color-aware") + private String colorAware; + @JsonProperty("coupling-flag") + private String couplingFlag; + @JsonProperty("etht-svc-name") + private String ethtSvcName; + @JsonProperty("access-provider-id") + private String accessProviderId; + @JsonProperty("access-client-id") + private String accessClientId; + @JsonProperty("access-topology-id") + private String accessTopologyId; + @JsonProperty("access-node-id") + private String accessNodeId; + @JsonProperty("access-ltp-id") + private String accessLtpId; + @JsonProperty("connectivity-selflink") + private String connectivitySelflink; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("model-customization-id") + private String modelCustomizationId; + @JsonProperty("model-invariant-id") + private String modelInvariantId; + @JsonProperty("model-version-id") + private String modelVersionId; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("connectivity-id") + public String getConnectivityId() { + return connectivityId; + } + + @JsonProperty("connectivity-id") + public void setConnectivityId(String connectivityId) { + this.connectivityId = connectivityId; + } + + @JsonProperty("bandwidth-profile-name") + public String getBandwidthProfileName() { + return bandwidthProfileName; + } + + @JsonProperty("bandwidth-profile-name") + public void setBandwidthProfileName(String bandwidthProfileName) { + this.bandwidthProfileName = bandwidthProfileName; + } + + @JsonProperty("cir") + public String getCir() { + return cir; + } + + @JsonProperty("cir") + public void setCir(String cir) { + this.cir = cir; + } + + @JsonProperty("eir") + public String getEir() { + return eir; + } + + @JsonProperty("eir") + public void setEir(String eir) { + this.eir = eir; + } + + @JsonProperty("cbs") + public String getCbs() { + return cbs; + } + + @JsonProperty("cbs") + public void setCbs(String cbs) { + this.cbs = cbs; + } + + @JsonProperty("ebs") + public String getEbs() { + return ebs; + } + + @JsonProperty("ebs") + public void setEbs(String ebs) { + this.ebs = ebs; + } + + @JsonProperty("color-aware") + public String getColorAware() { + return colorAware; + } + + @JsonProperty("color-aware") + public void setColorAware(String colorAware) { + this.colorAware = colorAware; + } + + @JsonProperty("coupling-flag") + public String getCouplingFlag() { + return couplingFlag; + } + + @JsonProperty("coupling-flag") + public void setCouplingFlag(String couplingFlag) { + this.couplingFlag = couplingFlag; + } + + @JsonProperty("etht-svc-name") + public String getEthtSvcName() { + return ethtSvcName; + } + + @JsonProperty("etht-svc-name") + public void setEthtSvcName(String ethtSvcName) { + this.ethtSvcName = ethtSvcName; + } + + @JsonProperty("access-provider-id") + public String getAccessProviderId() { + return accessProviderId; + } + + @JsonProperty("access-provider-id") + public void setAccessProviderId(String accessProviderId) { + this.accessProviderId = accessProviderId; + } + + @JsonProperty("access-client-id") + public String getAccessClientId() { + return accessClientId; + } + + @JsonProperty("access-client-id") + public void setAccessClientId(String accessClientId) { + this.accessClientId = accessClientId; + } + + @JsonProperty("access-topology-id") + public String getAccessTopologyId() { + return accessTopologyId; + } + + @JsonProperty("access-topology-id") + public void setAccessTopologyId(String accessTopologyId) { + this.accessTopologyId = accessTopologyId; + } + + @JsonProperty("access-node-id") + public String getAccessNodeId() { + return accessNodeId; + } + + @JsonProperty("access-node-id") + public void setAccessNodeId(String accessNodeId) { + this.accessNodeId = accessNodeId; + } + + @JsonProperty("access-ltp-id") + public String getAccessLtpId() { + return accessLtpId; + } + + @JsonProperty("access-ltp-id") + public void setAccessLtpId(String accessLtpId) { + this.accessLtpId = accessLtpId; + } + + @JsonProperty("connectivity-selflink") + public String getConnectivitySelflink() { + return connectivitySelflink; + } + + @JsonProperty("connectivity-selflink") + public void setConnectivitySelflink(String connectivitySelflink) { + this.connectivitySelflink = connectivitySelflink; + } + + @JsonProperty("operational-status") + public String getOperationalStatus() { + return operationalStatus; + } + + @JsonProperty("operational-status") + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + @JsonProperty("model-customization-id") + public String getModelCustomizationId() { + return modelCustomizationId; + } + + @JsonProperty("model-customization-id") + public void setModelCustomizationId(String modelCustomizationId) { + this.modelCustomizationId = modelCustomizationId; + } + + @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("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public RelationshipList getRelationshipList() { + return relationshipList; + } + + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + @Override + public String toString() { + return "{" + + "\"connectivityId\":\"" + connectivityId + '\"' + + ", \"bandwidthProfileName\":\"" + bandwidthProfileName + '\"' + + ", \"cir\":\"" + cir + '\"' + + ", \"eir\":\"" + eir + '\"' + + ", \"cbs\":\"" + cbs + '\"' + + ", \"ebs\":\"" + ebs + '\"' + + ", \"colorAware\":\"" + colorAware + '\"' + + ", \"couplingFlag\":\"" + couplingFlag + '\"' + + ", \"ethtSvcName\":\"" + ethtSvcName + '\"' + + ", \"accessProviderId\":\"" + accessProviderId + '\"' + + ", \"accessClientId\":\"" + accessClientId + '\"' + + ", \"accessTopologyId\":\"" + accessTopologyId + '\"' + + ", \"accessNodeId\":\"" + accessNodeId + '\"' + + ", \"accessLtpId\":\"" + accessLtpId + '\"' + + ", \"connectivitySelflink\":\"" + connectivitySelflink + '\"' + + ", \"operationalStatus\":\"" + operationalStatus + '\"' + + ", \"modelCustomizationId\":\"" + modelCustomizationId + '\"' + + ", \"modelInvariantId\":\"" + modelInvariantId + '\"' + + ", \"modelVersionId\":\"" + modelVersionId + '\"' + + ", \"resourceVersion\":\"" + resourceVersion + '\"' + + '}'; + } + + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EParameters.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EParameters.java new file mode 100644 index 00000000..bcaffc9e --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EParameters.java @@ -0,0 +1,76 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +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 E2EParameters { +// @JsonProperty("locationConstraints") +// List<LocationConstraint> locationConstraints; + + @JsonProperty("resources") + private List<ResourceRequest> resources; + + @JsonProperty("requestInputs") + private HashMap<String, ?> requestInputs; + + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<>(); + + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + public void setAdditionalProperties(Map<String, Object> additionalProperties) { + this.additionalProperties = additionalProperties; + } + + /** + * @return Returns the resources. + */ + public List<ResourceRequest> getResources() { + return resources; + } + + /** + * @param resources The resources to set. + */ + public void setResources(List<ResourceRequest> resources) { + this.resources = resources; + } + +// public List<LocationConstraint> getLocationConstraints() { +// return locationConstraints; +// } +// +// public void setLocationConstraints(List<LocationConstraint> locationConstraints) { +// this.locationConstraints = locationConstraints; +// } + + public HashMap<String, ?> getRequestInputs() { + return requestInputs; + } + + public void setRequestInputs(HashMap<String, ?> requestInputs) { + this.requestInputs = requestInputs; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EService.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EService.java new file mode 100644 index 00000000..58a00c76 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EService.java @@ -0,0 +1,114 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.onap.usecaseui.server.bean.lcm.sotne2eservice.E2EParameters; + +import java.util.HashMap; +import java.util.Map; + +public class E2EService { + @JsonProperty("name") + private String name; + + @JsonProperty("description") + private String description; + + @JsonProperty("serviceInvariantUuid") + private String serviceInvariantUuid; + + @JsonProperty("serviceUuid") + private String serviceUuid; + + @JsonProperty("globalSubscriberId") + private String globalSubscriberId; + + @JsonProperty("serviceType") + private String serviceType; + + @JsonProperty("parameters") + private E2EParameters parameters; + + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<>(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public E2EParameters getParameters() { + return parameters; + } + + public void setParameters(E2EParameters parameters) { + this.parameters = parameters; + } + + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + public void setAdditionalProperties(Map<String, Object> additionalProperties) { + this.additionalProperties = additionalProperties; + } + + public String getServiceInvariantUuid() { + return serviceInvariantUuid; + } + + public void setServiceInvariantUuid(String serviceInvariantUuid) { + this.serviceInvariantUuid = serviceInvariantUuid; + } + + public String getGlobalSubscriberId() { + return globalSubscriberId; + } + + public void setGlobalSubscriberId(String globalSubscriberId) { + this.globalSubscriberId = globalSubscriberId; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getServiceUuid() { + return serviceUuid; + } + + public void setServiceUuid(String serviceUuid) { + this.serviceUuid = serviceUuid; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceDelete.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceDelete.java new file mode 100644 index 00000000..7e28db5f --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceDelete.java @@ -0,0 +1,78 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "globalSubscriberId", + "serviceType" +}) +public class E2EServiceDelete { + @JsonProperty("globalSubscriberId") + private String globalSubscriberId; + @JsonProperty("serviceType") + private String serviceType; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("globalSubscriberId") + public String getGlobalSubscriberId() { + return globalSubscriberId; + } + + @JsonProperty("globalSubscriberId") + public void setGlobalSubscriberId(String globalSubscriberId) { + this.globalSubscriberId = globalSubscriberId; + } + + @JsonProperty("serviceType") + public String getServiceType() { + return serviceType; + } + + @JsonProperty("serviceType") + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public String toString() { + return "{" + + "\"globalSubscriberId\":\"" + globalSubscriberId + '\"' + + ", \"serviceType\":\"" + serviceType + '\"' + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceInstanceRequest.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceInstanceRequest.java new file mode 100644 index 00000000..17df8892 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceInstanceRequest.java @@ -0,0 +1,55 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.onap.usecaseui.server.bean.lcm.sotne2eservice.E2EService; + +import java.util.HashMap; +import java.util.Map; + +public class E2EServiceInstanceRequest { + + @JsonProperty("service") + private E2EService service; + + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<>(); + + public E2EService getService() { + return service; + } + + public void setService(E2EService service) { + this.service = service; + } + + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + + + public void setAdditionalProperties(Map<String, Object> additionalProperties) { + this.additionalProperties = additionalProperties; + } + + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Edge.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Edge.java new file mode 100644 index 00000000..d7ac2ee6 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Edge.java @@ -0,0 +1,61 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "from", + "to" +}) +public class Edge { + @JsonProperty("from") + private String from; + @JsonProperty("to") + private String to; + + @JsonProperty("from") + public String getFrom() { + return from; + } + + @JsonProperty("from") + public void setFrom(String from) { + this.from = from; + } + + @JsonProperty("to") + public String getTo() { + return to; + } + + @JsonProperty("to") + public void setTo(String to) { + this.to = to; + } + + @Override + public String toString() { + return "{" + + "\"from\":\"" + from + '\"' + + ", \"to\":\"" + to + '\"' + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileBean.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileBean.java new file mode 100644 index 00000000..63fd3d88 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileBean.java @@ -0,0 +1,39 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +public class FileBean { + + String fileName; + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + @Override + public String toString() { + + return "filename :"+ fileName; + + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileWrapper.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileWrapper.java new file mode 100644 index 00000000..d2f08cc5 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileWrapper.java @@ -0,0 +1,38 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + + +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +public class FileWrapper { + + FileBean file ; + + public FileBean getFile() { + return file; + } + + public void setFile(FileBean file) { + this.file = file; + } + + @Override + public String toString() { + return "file" + file; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/LogicalLink.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/LogicalLink.java new file mode 100644 index 00000000..dd9f86e1 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/LogicalLink.java @@ -0,0 +1,121 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "link-name", + "in-maint", + "link-type", + "resource-version", + "operational-status", + "relationship-list" +}) +public class LogicalLink { + @JsonProperty("link-name") + private String linkName; + @JsonProperty("in-maint") + private Boolean inMaint; + @JsonProperty("link-type") + private String linkType; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("link-name") + public String getLinkName() { + return linkName; + } + + @JsonProperty("link-name") + public void setLinkName(String linkName) { + this.linkName = linkName; + } + + @JsonProperty("in-maint") + public Boolean getInMaint() { + return inMaint; + } + + @JsonProperty("in-maint") + public void setInMaint(Boolean inMaint) { + this.inMaint = inMaint; + } + + @JsonProperty("link-type") + public String getLinkType() { + return linkType; + } + + @JsonProperty("link-type") + public void setLinkType(String linkType) { + this.linkType = linkType; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonProperty("operational-status") + public String getOperationalStatus() { + return operationalStatus; + } + + @JsonProperty("operational-status") + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + @JsonProperty("relationship-list") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + @JsonProperty("relationship-list") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Model.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Model.java new file mode 100644 index 00000000..9ac88dd9 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Model.java @@ -0,0 +1,77 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Model { + + @JsonProperty("resourceName") + private String resourceName; + + @JsonProperty("resourceDescription") + private String resourceDesc; + + + @JsonProperty("resourceInvariantUuid") + private String resourceInvariantUuid; + + @JsonProperty("resourceUuid") + private String resourceUuid; + + @JsonProperty("resourceCustomizationUuid") + private String resourceCustomizationUuid; + + public String getResourceName() { + return resourceName; + } + + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + public String getResourceDesc() { + return resourceDesc; + } + + public void setResourceDesc(String resourceDesc) { + this.resourceDesc = resourceDesc; + } + + public String getResourceInvariantUuid() { + return resourceInvariantUuid; + } + + public void setResourceInvariantUuid(String resourceInvariantUuid) { + this.resourceInvariantUuid = resourceInvariantUuid; + } + + public String getResourceUuid() { + return resourceUuid; + } + + public void setResourceUuid(String resourceUuid) { + this.resourceUuid = resourceUuid; + } + + public String getResourceCustomizationUuid() { + return resourceCustomizationUuid; + } + + public void setResourceCustomizationUuid(String resourceCustomizationUuid) { + this.resourceCustomizationUuid = resourceCustomizationUuid; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelConfig.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelConfig.java new file mode 100644 index 00000000..61b117fc --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelConfig.java @@ -0,0 +1,98 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.immutables.value.internal.$processor$.meta.$GsonMirrors; + +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ModelConfig { + + @JsonProperty("subscriberId") + String subscriberId; + @JsonProperty("subscriptionType") + String subscriptionType; + @JsonProperty("status") + String status; + @JsonProperty("deleteSleepTime") + String deleteSleepTime; + @JsonProperty("createSleepTime") + String createSleepTime; + @JsonProperty("servicemodelinformation") + ModelInfor serviceModel; + @JsonProperty("resourcemodelinformation") + List<ModelInfor> resourcemodelinformation; + + + public String getSubscriberId() { + return subscriberId; + } + + public void setSubscriberId(String subscriberId) { + this.subscriberId = subscriberId; + } + + public String getSubscriptionType() { + return subscriptionType; + } + + public void setSubscriptionType(String subscriptionType) { + this.subscriptionType = subscriptionType; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getDeleteSleepTime() { + return deleteSleepTime; + } + + public void setDeleteSleepTime(String deleteSleepTime) { + this.deleteSleepTime = deleteSleepTime; + } + + public String getCreateSleepTime() { + return createSleepTime; + } + + public void setCreateSleepTime(String createSleepTime) { + this.createSleepTime = createSleepTime; + } + + public ModelInfor getServiceModel() { + return serviceModel; + } + + public void setServiceModel(ModelInfor serviceModel) { + this.serviceModel = serviceModel; + } + + public List<ModelInfor> getResourcemodelinformation() { + return resourcemodelinformation; + } + + public void setResourcemodelinformation(List<ModelInfor> resourcemodelinformation) { + this.resourcemodelinformation = resourcemodelinformation; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelInfor.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelInfor.java new file mode 100644 index 00000000..d5daaadd --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelInfor.java @@ -0,0 +1,46 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.immutables.value.internal.$processor$.meta.$GsonMirrors; + + +public class ModelInfor { + + @JsonProperty("modelType") + private String modelType; + + @JsonProperty("model") + private Model model; + + + public String getModelType() { + return modelType; + } + + public void setModelType(String modelType) { + this.modelType = modelType; + } + + public Model getModel() { + return model; + } + + public void setModel(Model model) { + this.model = model; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Node.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Node.java new file mode 100644 index 00000000..a70cf954 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Node.java @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +//import org.onap.usecaseui.server.bean.orderservice.DataNode; + +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id", + "shape", + "image", + "label", + "color", + "dataNode" +}) +public class Node { + @JsonProperty("id") + private String id; + @JsonProperty("shape") + private String shape; + @JsonProperty("image") + private String image; + @JsonProperty("label") + private String label; + @JsonProperty("color") + private String color; + @JsonProperty("dataNode") + private String dataNode; + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("id") + public void setId(String id) { + this.id = id; + } + + @JsonProperty("shape") + public String getShape() { + return shape; + } + + @JsonProperty("shape") + public void setShape(String shape) { + this.shape = shape; + } + + @JsonProperty("image") + public String getImage() { + return image; + } + + @JsonProperty("image") + public void setImage(String image) { + this.image = image; + } + + @JsonProperty("label") + public String getLabel() { + return label; + } + + @JsonProperty("label") + public void setLabel(String label) { + this.label = label; + } + + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("color") + public void setColor(String color) { + this.color = color; + } + + public String getDataNode() { + return dataNode; + } + + public void setDataNode(String dataNode) { + this.dataNode = dataNode; + } + + @Override + public String toString() { + return "{"+ + "\"id\":\"" + id + '\"' + + ", \"shape\":\"" + shape + '\"' + + ", \"image\":\"" + image + '\"' + + ", \"label\":\"" + label + '\"' + + ", \"color\":\"" + color + '\"' + + ", \"dataNode\":" + dataNode + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pinterface.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pinterface.java new file mode 100644 index 00000000..23889fc3 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pinterface.java @@ -0,0 +1,148 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "interface-name", + "speed-value", + "equipment-identifier", + "resource-version", + "in-maint", + "network-ref", + "transparent", + "operational-status" +}) + +public class Pinterface { + @JsonProperty("interface-name") + private String interfaceName; + @JsonProperty("speed-value") + private String speedValue; + @JsonProperty("equipment-identifier") + private String equipmentIdentifier; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("in-maint") + private Boolean inMaint; + @JsonProperty("network-ref") + private String networkRef; + @JsonProperty("transparent") + private String transparent; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + + + @JsonProperty("interface-name") + public String getInterfaceName() { + return interfaceName; + } + + @JsonProperty("interface-name") + public void setInterfaceName(String interfaceName) { + this.interfaceName = interfaceName; + } + + @JsonProperty("speed-value") + public String getSpeedValue() { + return speedValue; + } + + @JsonProperty("speed-value") + public void setSpeedValue(String speedValue) { + this.speedValue = speedValue; + } + + @JsonProperty("equipment-identifier") + public String getEquipmentIdentifier() { + return equipmentIdentifier; + } + + @JsonProperty("equipment-identifier") + public void setEquipmentIdentifier(String equipmentIdentifier) { + this.equipmentIdentifier = equipmentIdentifier; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonProperty("in-maint") + public Boolean getInMaint() { + return inMaint; + } + + @JsonProperty("in-maint") + public void setInMaint(Boolean inMaint) { + this.inMaint = inMaint; + } + + @JsonProperty("network-ref") + public String getNetworkRef() { + return networkRef; + } + + @JsonProperty("network-ref") + public void setNetworkRef(String networkRef) { + this.networkRef = networkRef; + } + + @JsonProperty("transparent") + public String getTransparent() { + return transparent; + } + + @JsonProperty("transparent") + public void setTransparent(String transparent) { + this.transparent = transparent; + } + + @JsonProperty("operational-status") + public String getOperationalStatus() { + return operationalStatus; + } + + @JsonProperty("operational-status") + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + public RelationshipList getRelationshipList() { + return relationshipList; + } + + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pnf.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pnf.java new file mode 100644 index 00000000..070d8883 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/Pnf.java @@ -0,0 +1,134 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "pnf-name", + "pnf-id", + "in-maint", + "resource-version", + "admin-status", + "operational-status", + "relationship-list" +}) +public class Pnf { + @JsonProperty("pnf-name") + private String pnfName; + @JsonProperty("pnf-id") + private String pnfId; + @JsonProperty("in-maint") + private Boolean inMaint; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("admin-status") + private String adminStatus; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("pnf-name") + public String getPnfName() { + return pnfName; + } + + @JsonProperty("pnf-name") + public void setPnfName(String pnfName) { + this.pnfName = pnfName; + } + + @JsonProperty("pnf-id") + public String getPnfId() { + return pnfId; + } + + @JsonProperty("pnf-id") + public void setPnfId(String pnfId) { + this.pnfId = pnfId; + } + + @JsonProperty("in-maint") + public Boolean getInMaint() { + return inMaint; + } + + @JsonProperty("in-maint") + public void setInMaint(Boolean inMaint) { + this.inMaint = inMaint; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonProperty("admin-status") + public String getAdminStatus() { + return adminStatus; + } + + @JsonProperty("admin-status") + public void setAdminStatus(String adminStatus) { + this.adminStatus = adminStatus; + } + + @JsonProperty("operational-status") + public String getOperationalStatus() { + return operationalStatus; + } + + @JsonProperty("operational-status") + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + @JsonProperty("relationship-list") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + @JsonProperty("relationship-list") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceRequest.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceRequest.java new file mode 100644 index 00000000..42884f56 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceRequest.java @@ -0,0 +1,100 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.onap.usecaseui.server.bean.lcm.sotne2eservice.E2EParameters; + +import java.util.HashMap; +import java.util.Map; + +public class ResourceRequest { + @JsonProperty("resourceName") + private String resourceName; + + @JsonProperty("resourceInvariantUuid") + private String resourceInvariantUuid; + + @JsonProperty("resourceUuid") + private String resourceUuid; + + @JsonProperty("resourceCustomizationUuid") + private String resourceCustomizationUuid; + + + @JsonProperty("parameters") + private E2EParameters parameters; + + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<>(); + + /** + * @return Returns the resourceName. + */ + public String getResourceName() { + return resourceName; + } + + /** + * @param resourceName The resourceName to set. + */ + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + public void setAdditionalProperties(Map<String, Object> additionalProperties) { + this.additionalProperties = additionalProperties; + } + + public String getResourceInvariantUuid() { + return resourceInvariantUuid; + } + + public void setResourceInvariantUuid(String resourceInvariantUuid) { + this.resourceInvariantUuid = resourceInvariantUuid; + } + + public String getResourceUuid() { + return resourceUuid; + } + + public void setResourceUuid(String resourceUuid) { + this.resourceUuid = resourceUuid; + } + + public String getResourceCustomizationUuid() { + return resourceCustomizationUuid; + } + + public void setResourceCustomizationUuid(String resourceCustomizationUuid) { + this.resourceCustomizationUuid = resourceCustomizationUuid; + } + + public E2EParameters getParameters() { + return parameters; + } + + public void setParameters(E2EParameters parameters) { + this.parameters = parameters; + } + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceResponse.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceResponse.java new file mode 100644 index 00000000..b4ab61a3 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceResponse.java @@ -0,0 +1,52 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class ResourceResponse { + + @JsonProperty("nodes") + List<Node> nodes; + @JsonProperty("edges") + List<Edge> edges; + + public List<Node> getNodes() { + return nodes; + } + + public void setNodes(List<Node> nodes) { + this.nodes = nodes; + } + + public List<Edge> getEdges() { + return edges; + } + + public void setEdges(List<Edge> edges) { + this.edges = edges; + } + + @Override + public String toString() { + return "{" + + "\"nodes\":" + nodes + + ", \"edges\":" + edges + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnBinding.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnBinding.java new file mode 100644 index 00000000..32de1dc1 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnBinding.java @@ -0,0 +1,44 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "vpn-binding" +}) +public class VpnBinding { + @JsonProperty("vpn-binding") + private List<VpnInformation> vpnBinding = null; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + public List<VpnInformation> getVpnBinding() { + return vpnBinding; + } + + public void setVpnBinding(List<VpnInformation> vpnBinding) { + this.vpnBinding = vpnBinding; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnInformation.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnInformation.java new file mode 100644 index 00000000..b8f1676e --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnInformation.java @@ -0,0 +1,223 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.onap.usecaseui.server.bean.activateEdge.RelationshipList; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "vpn-id", + "vpn-name", + "vpn-type", + "vpn-region", + "access-provider-id", + "access-client-id", + "access-topology-id", + "src-access-node-id", + "src-access-ltp-id", + "dst-access-node-id", + "dst-access-ltp-id", + "operational-status", + "resource-version" +}) +public class VpnInformation { + @JsonProperty("vpn-id") + private String vpnId; + @JsonProperty("vpn-name") + private String vpnName; + @JsonProperty("vpn-type") + private String vpnType; + @JsonProperty("vpn-region") + private String vpnRegion; + @JsonProperty("access-provider-id") + private String accessProviderId; + @JsonProperty("access-client-id") + private String accessClientId; + @JsonProperty("access-topology-id") + private String accessTopologyId; + @JsonProperty("src-access-node-id") + private String srcAccessNodeId; + @JsonProperty("src-access-ltp-id") + private String srcAccessLtpId; + @JsonProperty("dst-access-node-id") + private String dstAccessNodeId; + @JsonProperty("dst-access-ltp-id") + private String dstAccessLtpId; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("relationship-list") + private RelationshipList relationshipList; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + @JsonProperty("vpn-id") + public String getVpnId() { + return vpnId; + } + + @JsonProperty("vpn-id") + public void setVpnId(String vpnId) { + this.vpnId = vpnId; + } + + @JsonProperty("vpn-name") + public String getVpnName() { + return vpnName; + } + + @JsonProperty("vpn-name") + public void setVpnName(String vpnName) { + this.vpnName = vpnName; + } + + @JsonProperty("vpn-type") + public String getVpnType() { + return vpnType; + } + + @JsonProperty("vpn-type") + public void setVpnType(String vpnType) { + this.vpnType = vpnType; + } + + @JsonProperty("vpn-region") + public String getVpnRegion() { + return vpnRegion; + } + + @JsonProperty("vpn-region") + public void setVpnRegion(String vpnRegion) { + this.vpnRegion = vpnRegion; + } + + @JsonProperty("access-provider-id") + public String getAccessProviderId() { + return accessProviderId; + } + + @JsonProperty("access-provider-id") + public void setAccessProviderId(String accessProviderId) { + this.accessProviderId = accessProviderId; + } + + @JsonProperty("access-client-id") + public String getAccessClientId() { + return accessClientId; + } + + @JsonProperty("access-client-id") + public void setAccessClientId(String accessClientId) { + this.accessClientId = accessClientId; + } + + @JsonProperty("access-topology-id") + public String getAccessTopologyId() { + return accessTopologyId; + } + + @JsonProperty("access-topology-id") + public void setAccessTopologyId(String accessTopologyId) { + this.accessTopologyId = accessTopologyId; + } + + @JsonProperty("src-access-node-id") + public String getSrcAccessNodeId() { + return srcAccessNodeId; + } + + @JsonProperty("src-access-node-id") + public void setSrcAccessNodeId(String srcAccessNodeId) { + this.srcAccessNodeId = srcAccessNodeId; + } + + @JsonProperty("src-access-ltp-id") + public String getSrcAccessLtpId() { + return srcAccessLtpId; + } + + @JsonProperty("src-access-ltp-id") + public void setSrcAccessLtpId(String srcAccessLtpId) { + this.srcAccessLtpId = srcAccessLtpId; + } + + @JsonProperty("dst-access-node-id") + public String getDstAccessNodeId() { + return dstAccessNodeId; + } + + @JsonProperty("dst-access-node-id") + public void setDstAccessNodeId(String dstAccessNodeId) { + this.dstAccessNodeId = dstAccessNodeId; + } + + @JsonProperty("dst-access-ltp-id") + public String getDstAccessLtpId() { + return dstAccessLtpId; + } + + @JsonProperty("dst-access-ltp-id") + public void setDstAccessLtpId(String dstAccessLtpId) { + this.dstAccessLtpId = dstAccessLtpId; + } + + @JsonProperty("operational-status") + public String getOperationalStatus() { + return operationalStatus; + } + + @JsonProperty("operational-status") + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public RelationshipList getRelationshipList() { + return relationshipList; + } + + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/resourcemodelinformation.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/resourcemodelinformation.java new file mode 100644 index 00000000..0e722621 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/resourcemodelinformation.java @@ -0,0 +1,33 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservice; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class resourcemodelinformation { + + ModelInfor resourceModel; + + public ModelInfor getResourceModel() { + return resourceModel; + } + + public void setResourceModel(ModelInfor resourceModel) { + this.resourceModel = resourceModel; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ResponseServiceInstanceWrapper.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ResponseServiceInstanceWrapper.java new file mode 100644 index 00000000..6d556218 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ResponseServiceInstanceWrapper.java @@ -0,0 +1,38 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor; + +import java.util.List; + +public class ResponseServiceInstanceWrapper { + + List<ServiceInstanceList> serviceInstanceListList; + + public List<ServiceInstanceList> getServiceInstanceListList() { + return serviceInstanceListList; + } + + public void setServiceInstanceListList(List<ServiceInstanceList> serviceInstanceListList) { + this.serviceInstanceListList = serviceInstanceListList; + } + + @Override + public String toString() { + return "{" + + "\"serviceInstanceList\":" + serviceInstanceListList + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceList.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceList.java new file mode 100644 index 00000000..00148fbd --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceList.java @@ -0,0 +1,57 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "service-instance-id" +}) +public class ServiceInstanceList { + + @JsonProperty("service-instance-id") + String serviceInstance; + @JsonProperty("service-instance-name") + + String serviceInstancename; + public String getServiceInstance() { + return serviceInstance; + } + + public void setServiceInstance(String serviceInstance) { + this.serviceInstance = serviceInstance; + } + + public String getServiceInstancename() { + return serviceInstancename; + } + + public void setServiceInstancename(String serviceInstancename) { + this.serviceInstancename = serviceInstancename; + } + + @Override + public String toString() { + return "{" + + "\"serviceInstance\":\"" + serviceInstance + '\"' + + ",\"serviceInstancename\":\"" + serviceInstancename + '\"' + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceListWrapper.java b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceListWrapper.java new file mode 100644 index 00000000..57867bf7 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceListWrapper.java @@ -0,0 +1,42 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.onap.usecaseui.server.bean.activateEdge.ServiceInstance; + +import java.util.List; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "service-instance" +}) +public class ServiceInstanceListWrapper { + + @JsonProperty("service-instance") + List<ServiceInstance> serviceIntances; + + public List<ServiceInstance> getServiceIntances() { + return serviceIntances; + } + + public void setServiceIntances(List<ServiceInstance> serviceIntances) { + this.serviceIntances = serviceIntances; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/orderservice/ServiceEstimationBean.java b/server/src/main/java/org/onap/usecaseui/server/bean/orderservice/ServiceEstimationBean.java new file mode 100644 index 00000000..c5ab000c --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/orderservice/ServiceEstimationBean.java @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.usecaseui.server.bean.orderservice; + + + +import java.util.List; + +public class ServiceEstimationBean { + + private String bandWidth; + private List<String> wlanAccess; + private String serviceCost; + private String bandwidthCost; + private String cameraCost; + private String vpnCost; + private List<VpnInformation> vpnInformations; + + public String getBandWidth() { + return bandWidth; + } + + public void setBandWidth(String bandWidth) { + this.bandWidth = bandWidth; + } + + public List<String> getWlanAccess() { + return wlanAccess; + } + + public void setWlanAccess(List<String> wlanAccess) { + this.wlanAccess = wlanAccess; + } + + public String getServiceCost() { + return serviceCost; + } + + public void setServiceCost(String serviceCost) { + this.serviceCost = serviceCost; + } + + public String getCameraCost() { + return cameraCost; + } + + public void setCameraCost(String cameraCost) { + this.cameraCost = cameraCost; + } + + public String getVpnCost() { + return vpnCost; + } + + public void setVpnCost(String vpnCost) { + this.vpnCost = vpnCost; + } + + public List<VpnInformation> getVpnInformations() { + return vpnInformations; + } + + public void setVpnInformations(List<VpnInformation> vpnInformations) { + this.vpnInformations = vpnInformations; + } + + public String getBandwidthCost() { + return bandwidthCost; + } + + public void setBandwidthCost(String bandwidthCost) { + this.bandwidthCost = bandwidthCost; + } + + @Override + public String toString() { + return "ServiceEstimationBean{" + + "bandWidth='" + bandWidth + '\'' + + ", wlanAccess=" + wlanAccess + + ", serviceCost='" + serviceCost + '\'' + + ", cameraCost='" + cameraCost + '\'' + + ", vpnCost='" + vpnCost + '\'' + + ", vpnInformations=" + vpnInformations + + '}'; + } +} + + /* + + public ServiceEstimationBean ServiceEstimationBean(ServiceEstimationBuilder serviceEstimationBuilder) + { + this.bandwidth=serviceEstimationBuilder.bandwidth; + this.wlanAccess=serviceEstimationBuilder.wlanAccess; + this.serviceCost=serviceEstimationBuilder.serviceCost; + this.cameraCost=serviceEstimationBuilder.cameraCost; + this.vpnCostInfoList=serviceEstimationBuilder.vpnCostInfoList; + return this; + } + + + // Builder for service estimation bean + + public static class ServiceEstimationBuilder + { + private String bandwidth; + private List<String> wlanAccess; + private String serviceCost; + private String cameraCost; + private List<VpnCostInfo> vpnCostInfoList; + + public String getBandwidth() { + return bandwidth; + } + + public void setBandwidth(String bandwidth) { + this.bandwidth = bandwidth; + } + + public List<String> getWlanAccess() { + return wlanAccess; + } + + public void setWlanAccess(List<String> wlanAccess) { + this.wlanAccess = wlanAccess; + } + + public String getServiceCost() { + return serviceCost; + } + + public void setServiceCost(String serviceCost) { + this.serviceCost = serviceCost; + } + + public String getCameraCost() { + return cameraCost; + } + + public void setCameraCost(String cameraCost) { + this.cameraCost = cameraCost; + } + + public List<VpnCostInfo> getVpnCostInfoList() { + return vpnCostInfoList; + } + + public void setVpnCostInfoList(List<VpnCostInfo> vpnCostInfoList) { + this.vpnCostInfoList = vpnCostInfoList; + } + + public ServiceEstimationBean Build() + { + return new ServiceEstimationBean(this); + } + } + */ + + diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/orderservice/Site.java b/server/src/main/java/org/onap/usecaseui/server/bean/orderservice/Site.java new file mode 100644 index 00000000..a390790d --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/orderservice/Site.java @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.usecaseui.server.bean.orderservice; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Site { + + @JsonProperty("siteId") + private String siteId; + + @JsonProperty("siteName") + private String siteName; + + @JsonProperty("isCloudSite") + private String isCloudSite; + + @JsonProperty("location") + private String location; + + @JsonProperty("zipCode") + private String zipCode; + + @JsonProperty("role") + private String role; + + @JsonProperty("capacity") + private String capacity; + + @JsonProperty("interface") + private String siteinterface; + + @JsonProperty("subnet") + private String subnet; + + @JsonProperty("price") + private String price; + + @JsonProperty("siteStatus") + private String siteStatus; + + @JsonProperty("description") + private String description; + + @JsonProperty("site_address") + private String address; + + @JsonProperty("site_email") + private String email; + + @JsonProperty("site_type") + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public String getSiteId() { + return siteId; + } + + public void setSiteId(String siteId) { + this.siteId = siteId; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getIsCloudSite() { + return isCloudSite; + } + + public void setIsCloudSite(String isCloudSite) { + this.isCloudSite = isCloudSite; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getZipCode() { + return zipCode; + } + + public void setZipCode(String zipCode) { + this.zipCode = zipCode; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public String getCapacity() { + return capacity; + } + + public void setCapacity(String capacity) { + this.capacity = capacity; + } + + public String getSiteinterface() { + return siteinterface; + } + + public void setSiteinterface(String siteinterface) { + this.siteinterface = siteinterface; + } + + public String getSubnet() { + return subnet; + } + + public void setSubnet(String subnet) { + this.subnet = subnet; + } + + public String getSiteStatus() { + return siteStatus; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public void setSiteStatus(String siteStatus) { + this.siteStatus = siteStatus; + } + + + + @Override + public String toString() { + return "Site{" + + "siteId='" + siteId + '\'' + + ", siteName='" + siteName + '\'' + + ", isCloudSite='" + isCloudSite + '\'' + + ", location='" + location + '\'' + + ", zipCode='" + zipCode + '\'' + + ", role='" + role + '\'' + + ", capacity='" + capacity + '\'' + + ", siteinterface='" + siteinterface + '\'' + + ", subnet='" + subnet + '\'' + + ", price='" + price + '\'' + + ", siteStatus='" + siteStatus + '\'' + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/bean/orderservice/VpnInformation.java b/server/src/main/java/org/onap/usecaseui/server/bean/orderservice/VpnInformation.java new file mode 100644 index 00000000..b2afa94b --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/bean/orderservice/VpnInformation.java @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.usecaseui.server.bean.orderservice; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class VpnInformation { + + @JsonProperty("vpnName") + private String vpnName; + + @JsonProperty("vpnId") + private String vpnId; + + @JsonProperty("vpnType") + private String vpnType; + + @JsonProperty("vpnBandwidth") + private String vpnBandwidth; + + @JsonProperty("vpnThreshold") + private String vpnThreshold; + + @JsonProperty("cameras") + private String cameras; + + @JsonProperty("sites") + private List<Site> sites; + + @JsonProperty("cost") + private String cost; + + public String getVpnName() { + return vpnName; + } + + public void setVpnName(String vpnName) { + this.vpnName = vpnName; + } + + public String getVpnId() { + return vpnId; + } + + public void setVpnId(String vpnId) { + this.vpnId = vpnId; + } + + public String getVpnType() { + return vpnType; + } + + public void setVpnType(String vpnType) { + this.vpnType = vpnType; + } + + public String getVpnBandwidth() { + return vpnBandwidth; + } + + public void setVpnBandwidth(String vpnBandwidth) { + this.vpnBandwidth = vpnBandwidth; + } + + public String getVpnThreshold() { + return vpnThreshold; + } + + public void setVpnThreshold(String vpnThreshold) { + this.vpnThreshold = vpnThreshold; + } + + public String getCameras() { + return cameras; + } + + public void setCameras(String cameras) { + this.cameras = cameras; + } + + public List<Site> getSites() { + return sites; + } + + public void setSites(List<Site> sites) { + this.sites = sites; + } + + public String getCost() { + return cost; + } + + public void setCost(String cost) { + this.cost = cost; + } + + @Override + public String toString() { + return "VpnInformation{" + + "vpnName='" + vpnName + '\'' + + ", vpnId='" + vpnId + '\'' + + ", vpnType='" + vpnType + '\'' + + ", vpnBandwidth='" + vpnBandwidth + '\'' + + ", vpnThreshold='" + vpnThreshold + '\'' + + ", cameras='" + cameras + '\'' + + ", sites=" + sites + + ", cost='" + cost + '\'' + + '}'; + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/constant/Constant.java b/server/src/main/java/org/onap/usecaseui/server/constant/Constant.java new file mode 100644 index 00000000..f1babd68 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/constant/Constant.java @@ -0,0 +1,35 @@ +/**
+ * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.constant;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.onap.usecaseui.server.bean.lcm.ServiceTemplateInput;
+
+public final class Constant
+{
+
+ public static final String DATE_FORMAT= "yyyy-MM-dd HH:mm:ss";
+
+ public static final String RegEX_DATE_FORMAT = "[^0-9-:]";
+
+ public static Map<String,ServiceTemplateInput> netWorkMap = new HashMap<String,ServiceTemplateInput>();
+
+ public static final String CONSTANT_SUCCESS="{\"status\":\"SUCCESS\"}";
+
+ public static final String CONSTANT_FAILED="{\"status\":\"FAILED\"}";
+}
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceLcmController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceLcmController.java new file mode 100644 index 00000000..f31947bc --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceLcmController.java @@ -0,0 +1,85 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.controller.lcm; + + +//import org.onap.usecaseui.server.bean.lcm.sotne2eservice.SotnServiceTemplateInput; +import org.onap.usecaseui.server.service.lcm.SotnServiceTemplateService; +import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp; +import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation; + import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; + +@Controller +@CrossOrigin(origins="*") +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +public class SotnServiceLcmController { + private static final Logger logger = LoggerFactory.getLogger(ServiceLcmController.class); + + @Resource(name = "SotnLcmService") + private SotnServiceTemplateService sotnServiceTemplateService; + private DeleteOperationRsp deleteOperationRsp; + + + public void setServiceLcmService(SotnServiceTemplateService sotnServiceTemplateService) { + this.sotnServiceTemplateService = sotnServiceTemplateService; + } + + @ResponseBody + @RequestMapping(value = {"/uui-lcm/Sotnservices/servicesubscription/{subscriptionType}/serviceinstance/{instanceid}"}, method = RequestMethod.GET, produces = "application/json") + // @RequestMapping(value = {"ccvpncustomer/servicesubscriptions/uui-lcm/Sotnservices/servicesubscription/{subscriptionType}/serviceinstance/{instanceid}"}, method = RequestMethod.GET, produces = "application/json") + public String getSotnService(@PathVariable("subscriptionType") String subscriptionType, @PathVariable("instanceid") String instanceid) { + + return sotnServiceTemplateService.getService(subscriptionType, instanceid); + + //return serviceOperation; + } + + @ResponseBody + @RequestMapping(value = {"/uui-lcm/Sotnservices_unni"}, method = RequestMethod.POST, produces = "application/json") + public ServiceOperation instantiateService_sotnunni(HttpServletRequest request,@RequestBody HashMap<String, Object> mp) { + System.out.println("request body == "+mp); + //ServiceOperation serviceOperation = sotnServiceTemplateService.instantiateService_sotnunni(mp); + + ServiceOperation serviceOperation = sotnServiceTemplateService.instantiate_CCVPN_Service(mp); + + return serviceOperation; + } + + + + @ResponseBody + @RequestMapping(value = {"/uui-lcm/Sotnservices/topology/service/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{serviceInstanceId}"}, method = RequestMethod.GET, produces = "application/json") + public String getSiteInformationTopology(@PathVariable("service-type") String servicetype, @PathVariable("serviceInstanceId") String serviceInstanceId) throws Exception { + return sotnServiceTemplateService.getSOTNSiteInformationTopology( servicetype, serviceInstanceId); + } + + @ResponseBody + @RequestMapping(value = {"/uui-lcm/Sotnservices/resourceTopology/service/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{serviceInstanceId}"}, method = RequestMethod.GET, produces = "application/json") + public String getResourceInformationTopology(@PathVariable("service-type") String servicetype, @PathVariable("serviceInstanceId") String serviceInstanceId) throws Exception { + return sotnServiceTemplateService.getSOTNResourceInformationTopology( servicetype, serviceInstanceId); + } + + +}
\ No newline at end of file diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java new file mode 100644 index 00000000..0100d216 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java @@ -0,0 +1,73 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.controller.lcm; + +import org.onap.usecaseui.server.service.customer.CcvpnCustomerService; +import org.onap.usecaseui.server.service.lcm.CustomerService; +import org.onap.usecaseui.server.service.lcm.SotnServiceQryService; +import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAIServiceSubscription; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.stereotype.Controller; +import org.onap.usecaseui.server.service.lcm.ServiceLcmService; +import org.onap.usecaseui.server.util.UuiCommonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +@Controller +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +public class SotnServiceQryController { + private static final Logger logger = LoggerFactory.getLogger(SotnServiceQryController.class); + + @Resource(name="SotnServiceQry") + private SotnServiceQryService sotnServiceQryService; + + @Resource(name="CcvpnCustomerService") + public CcvpnCustomerService ccvpnCustomerService; + + @Resource(name="CustomerService") + private CustomerService customerService; + + public void setServiceLcmService(SotnServiceQryService sotnServiceQryService, CcvpnCustomerService ccvpnCustomerService) { + this.sotnServiceQryService = sotnServiceQryService; + this.ccvpnCustomerService = ccvpnCustomerService; + } + + @ResponseBody + @RequestMapping(value = {"/uui-lcm/Sotnservices/ServiceInstances/{serviceType}"}, method = RequestMethod.GET , produces = "application/json") + public String getSotnServiceInstances(@PathVariable(value="serviceType") String serviceType){ + + String response = sotnServiceQryService.getServiceInstances(serviceType); + + return response; + } + + @ResponseBody + @RequestMapping(value = {"/uui-lcm/customers/service-subscriptions"}, method = RequestMethod.GET , produces = "application/json") + public String getServiceSubscriptions(){ + String customerId=""; + return ccvpnCustomerService.querySubscriptionType(customerId); + } + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java b/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java new file mode 100644 index 00000000..6758a722 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.service.customer; + +import org.onap.usecaseui.server.bean.customer.ServiceInstance; +import org.onap.usecaseui.server.bean.customer.ServiceInstances; + +import java.util.List; + +public interface CcvpnCustomerService { + + public ServiceInstances getServiceInstances(String customerId, String serviceType); + //public String getServiceInformation(String serviceInstanceId) throws Exception; + public String querySubscriptionType(String customerId); +} + diff --git a/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java new file mode 100644 index 00000000..3e39c0a4 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java @@ -0,0 +1,480 @@ + +/* + * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.service.customer.impl; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.type.TypeReference; +import okhttp3.ResponseBody; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + +import org.onap.usecaseui.server.bean.customer.ServiceInstance; +import org.onap.usecaseui.server.bean.customer.ServiceInstances; +import org.onap.usecaseui.server.bean.customer.SubscriptionType; +import org.onap.usecaseui.server.bean.lcm.sotne2eservice.Model; +import org.onap.usecaseui.server.bean.lcm.sotne2eservice.ModelConfig; + +import org.onap.usecaseui.server.constant.Constant; +import org.onap.usecaseui.server.service.customer.CcvpnCustomerService; +import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService; +import org.onap.usecaseui.server.util.RestfulServices; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import retrofit2.Response; + +import java.io.FileReader; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + + +@Service("CcvpnCustomerService") +public class CcvpnCustomerServiceImpl implements CcvpnCustomerService { + + private static final Logger logger = LoggerFactory.getLogger(CcvpnCustomerServiceImpl.class); + + private AAIService aaiService; + + public CcvpnCustomerServiceImpl() { + this(RestfulServices.create(AAIService.class)); + } + + public CcvpnCustomerServiceImpl(AAIService aaiService) { + this.aaiService = aaiService; + } + + @Override + public ServiceInstances getServiceInstances(String customerId, String serviceType) { + + List<ServiceInstance> serviceInstanceList = new ArrayList<>(); + ModelConfig modelConfig = readFile(); + Map<String, Model> modelInfo = readConfigToMap(modelConfig); + customerId = modelConfig.getSubscriberId(); + List<ServiceInstance> ccvpnServiceInstance = new ArrayList<>(); + ServiceInstances serviceInstance = getAllServiceInstances(customerId, serviceType); + return serviceInstance; + } + + + public ServiceInstances getAllServiceInstances(String customerId, String serviceType) { + logger.info("Execute get all service for customer : Begin"); + ModelConfig modelConfig = readFile(); + Map<String, Model> modelInfo = readConfigToMap(modelConfig); + customerId = modelConfig.getSubscriberId(); + ObjectMapper mapper = new ObjectMapper(); + ServiceInstances serviceInstances = null; + try { + Response<ResponseBody> response = this.aaiService.getAllServiceInformation(customerId, serviceType).execute(); + if (response.isSuccessful()) { + logger.info("Execute get all service for customer : End"); + String result = new String(response.body().bytes()); + serviceInstances = mapper.readValue(result, new TypeReference<ServiceInstances>() { + }); + return serviceInstances; + //System.out.println("Response received : "+response.body().bytes()); + } else { + logger.info("Execute get all service for customer : Failed"); + + } + } catch (Exception e) + { + logger.info("Execute get all service for customer : Failed"); + } + return null; + } + + + public String querySubscriptionType(String customerId) { + SubscriptionType subscriptions = new SubscriptionType(); + String result = ""; + ModelConfig modelConfig = readFile(); + Map<String, Model> modelInfo = readConfigToMap(modelConfig); + customerId = modelConfig.getSubscriberId(); + ObjectMapper mapper = new ObjectMapper(); + try { + logger.info("aai querySubscriptionType is starting!"); + + Response<ResponseBody> response = this.aaiService.getServiceSubscription(customerId).execute(); + logger.info("aai querySubscriptionType has finished!"); + if (response.isSuccessful()) { + result = new String(response.body().bytes()); + subscriptions = mapper.readValue(result, SubscriptionType.class); + + } else { + // logger.info(String.format("Failed to get data from AAI[code=%s, message=%s]", response.code(), response.message())); + result = Constant.CONSTANT_FAILED; + throw new NullPointerException("Failed to get data from AAI"); + } + + } catch (Exception ex) { + + logger.error("getServiceSubscription exception occured:" + ex); + result = Constant.CONSTANT_FAILED; + } + return "{\"subscriptions\":[{\"serviceType\":\"SOTN\"}]}"; + //return subscriptions.toString(); + } + + + + private Map<String, Model> readConfigToMap(ModelConfig modelConfig) + { + + //ModelConfig modelConfig = readFile(); +// Map<String, Model> modelinfo = modelConfig.getModels().stream() +// .collect(Collectors.toMap(ModelInfor::getModelType, ModelInfor::getModel)); + return null; + } + + public ModelConfig readFile() + { + JSONParser parser = new JSONParser(); + String jsonPath="/home/root1/Desktop/modelconfig.json"; + String jsonString = null; + ObjectMapper mapper = new ObjectMapper(); + + try { + + Object object = parser.parse(new FileReader(jsonPath)); + //System.out.println(object.toString()); + ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() { + }); + + return modelInformation; + }catch (ParseException | IOException ex) + { + logger.error("Exception occured while reading configuration file:"+ex); + return null; + } + } + + +/* + @Override + public String getServiceInformation(String serviceInstanceId) throws Exception{ + //serviceInstanceId = "106"; + String result = ""; + ObjectMapper mapper = new ObjectMapper(); + List<SiteTopologyBean> beanList = new ArrayList<>(); + CostInformation costInformation = getCostInformation(); + List<SiteCost> siteCost = costInformation.getSiteCost(); + + String path ="/home/root1/Desktop/SystemConfiguration.json"; + StaticConfiguration staticConfig = ReadStaticConfiguration(path); + + String customerId = staticConfig.getSystemInformation().getCustomerName(); + String serviceType = staticConfig.getSystemInformation().getServiceType(); + + + + List<Relationship> perfectrelationship = new ArrayList<>(); + + ServiceInstance serviceInstance=null; + + //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : BEGIN --------------------------------------- + try{ + serviceInstance=getServiceInstancesForEdge(customerId, serviceType, serviceInstanceId); + if(serviceInstance == null) + return null; + }catch (Exception e) + { + logger.info("Query Service Instance information failed. No service information found for customer " + +customerId+" and Service Type "+serviceType); + return null; + } + //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : END ----------------------------------------- + + //----------------------------- Get the detailed information of Generic VNF from the service instance and filter the site resource : BEGIN --------------------------------------- + + RelationshipList genericvnfrelationshipList = serviceInstance.getRelationshipList(); + if(genericvnfrelationshipList == null) + { + logger.info("No VNF associated with the service instance : "+serviceInstanceId); + return null; + } + List<Relationship> genericRelationship = genericvnfrelationshipList.getRelationship(); + List<String> resourceurl = new ArrayList<>(); + for(Relationship tempRelation : genericRelationship) { + String relatedLink = tempRelation.getRelatedLink(); + resourceurl.add(tempRelation.getRelatedLink()); + } + + + // Need a code change here to identify VPN VNF and Site resource VNF. + + String vnfID = new String(resourceurl.get(0).substring(resourceurl.get(0).lastIndexOf("/")+1)); + + + + GenericVnf genericVnf = getGenericVnfInfo(vnfID); + + RelationshipList newrelationshipList = genericVnf.getRelationshipList(); + + perfectrelationship = newrelationshipList.getRelationship().stream().filter(x -> x.getRelatedTo() + .equalsIgnoreCase("site-resource") + || x.getRelatedTo().equalsIgnoreCase("device") + ||x.getRelatedTo().equalsIgnoreCase("edge-camera")).collect(Collectors.toList()); + + + + //----------------------------- Get the detailed information of Generic VNF from the service instance and filter the site resource : END --------------------------------------- + + + //----------------------------- Get the VNF information from the service instance and filter the site resource : END --------------------------------------- + + + for (Relationship relationship :perfectrelationship) + { + SiteTopologyBean bean = new SiteTopologyBean(); + bean.setEdgeStatus("Offline"); + //Relationship relationship = itr.next(); + if (relationship.getRelatedTo().equalsIgnoreCase("site-resource")) { + // String relatedLink = relationship.getRelatedLink(); + String siteResourceId = relationship.getRelationshipData().get(0).getRelationshipValue(); + Response<ResponseBody> rsp = this.aaiService.getSiteResourceInfo(siteResourceId).execute(); + if (rsp.isSuccessful()) { + result = new String(rsp.body().bytes()); + + SiteResource siteResource = mapper.readValue(result, SiteResource.class); + String siteResourceName = siteResource.getSiteResourceName(); + bean.setSiteStatus(siteResource.getOperationalStatus()); + String role = siteResource.getRole(); + bean.setRole(role); + String desc = siteResource.getDescription(); + bean.setDescription(desc); + bean.setSiteName(siteResourceName); + bean.setSiteId(siteResourceId); + bean.setZipCode(siteResource.getPostalcode()); + bean.setLocation(siteResource.getCity()); + /* + List<Relationship> rList = siteResource.getRelationshipList().getRelationship(); + ListIterator<Relationship> itr1 = rList.listIterator(); + while (itr1.hasNext()) { + Relationship relationship1 = itr1.next(); + if (relationship1.getRelatedTo().equalsIgnoreCase("complex")) { + String complexId = relationship1.getRelationshipData().get(0).getRelationshipValue(); + Response<ResponseBody> compResp = this.aaiService.getComplexObject(complexId).execute(); + if (compResp.isSuccessful()) { + result = new String(compResp.body().bytes()); + ComplexObj complexObj = mapper.readValue(result, ComplexObj.class); + String zipCode = complexObj.getPostalCode(); + bean.setZipCode(zipCode); + String location = complexObj.getCity(); + bean.setLocation(location); + } + } + } + */ + /*} + } + + if (relationship.getRelatedTo().equalsIgnoreCase("device")) { + String deviceId = relationship.getRelationshipData().get(0).getRelationshipValue(); + Map<String,String> resultMaps = getDeviceStatus(deviceId); + String deviceDesc = resultMaps.get("deviceDesc"); + String deviceName = resultMaps.get("deviceName"); + bean.setDeviceName(deviceName); + bean.setStatus(resultMaps.get("status")); + bean.setDeviceDesc(deviceDesc); + } + + if (relationship.getRelatedTo().equalsIgnoreCase("edge-camera")) { + String edgeCamId = relationship.getRelationshipData().get(0).getRelationshipValue(); + Response<ResponseBody> edgeRsp = this.aaiService.getEdgeInfo(edgeCamId).execute(); + if(edgeRsp.isSuccessful()) + { + result = new String(edgeRsp.body().bytes()); + EdgeCamera edgeInfo = mapper.readValue(result, EdgeCamera.class); + String edgeName = edgeInfo.getEdgeCameraName(); + String edgeIP = edgeInfo.getIpAddress(); + bean.setEdgeName(edgeName); + bean.setEdgeIP(edgeIP); + bean.setEdgeStatus("Online"); + } + } + if(bean.getStatus()!=null && bean.getEdgeStatus()!=null) { + Enum value = generateEnumValue(bean.getStatus(), bean.getEdgeStatus()); + String enumVal = value.name(); + bean.setStatEnum(enumVal); + } + + if(bean.getRole()!=null) { + if (bean.getRole().toLowerCase().contains("hub")) { + String price = siteCost.stream().filter(cost -> cost.getSiteType().equalsIgnoreCase("1")) + .map(SiteCost::getSiteCost).collect(Collectors.toList()).get(0); + bean.setPrice(price); + + } else { + String price = siteCost.stream().filter(cost -> cost.getSiteType().equalsIgnoreCase("0")) + .map(SiteCost::getSiteCost).collect(Collectors.toList()).get(0); + bean.setPrice(price); + } + bean.setSiteinterface(staticConfig.getSiteInformation().getSiteInterface()); + bean.setSubnet(staticConfig.getSiteInformation().getSubnetMask()); + beanList.add(bean); + } + } + return beanList.toString(); + } + + + public CostInformation getCostInformation() { + JSONParser parser = new JSONParser(); + String jsonPath = "/home/root1/Desktop/costconfig.json"; + String jsonString = null; + ObjectMapper mapper = new ObjectMapper(); + + try { + + Object object = parser.parse(new FileReader(jsonPath)); + //System.out.println(object.toString()); + CostInformation costInformation = mapper.readValue(object.toString(), new TypeReference<CostInformation>() { + }); + + return costInformation; + } catch (ParseException | IOException ex) { + logger.error("getDataMonitorInfo exception occured:" + ex); + return null; + } + } + + + public StaticConfiguration ReadStaticConfiguration(String path) + { + JSONParser parser = new JSONParser(); + + String jsonString = null; + ObjectMapper mapper = new ObjectMapper(); + + try { + + Object object = parser.parse(new FileReader(path)); + //System.out.println(object.toString()); + StaticConfiguration staticConfiguration = mapper.readValue(object.toString(), new TypeReference<StaticConfiguration>() { + }); + + return staticConfiguration; + }catch (ParseException | IOException ex) + { + logger.error("Reading static information from configuration file (StaticConfiguration.json) failed:"+ex.getMessage()); + return null; + } + } + + public ServiceInstance getServiceInstancesForEdge(String customerId, String serviceType, String serviceInstanceId) throws Exception + { + logger.info("Fire getServiceInstancesForEdge : Begin"); + ObjectMapper mapper = new ObjectMapper(); + + Response<ResponseBody> response = this.aaiService.getServiceInstancesForEdge(customerId, serviceType, serviceInstanceId).execute(); + if (response.isSuccessful()) { + logger.info("Fire getServiceInstancesForEdge : End"); + String result = new String(response.body().bytes()); + ServiceInstance serviceInstance = mapper.readValue(result, ServiceInstance.class); + return serviceInstance; + //System.out.println("Response received : "+response.body().bytes()); + } + else + { + logger.info("Fire getServiceInstancesForEdge : Failed"); + + } + + return null; + } + + public GenericVnf getGenericVnfInfo(String vnfID) throws Exception + { + ObjectMapper mapper = new ObjectMapper(); + logger.info("Fire GetGenericVnfInfo : Begin for vnfID"+vnfID); + Response<ResponseBody> deviceResponse = this.aaiService.getGenericVnfInformation(vnfID).execute(); + if (deviceResponse.isSuccessful()) { + String result = new String(deviceResponse.body().bytes()); + logger.info("Response received GetGenericVnfInfo"); + //result = result.substring(10, result.length() - 1); + GenericVnf genericVnf = mapper.readValue(result, new TypeReference<GenericVnf>() { + }); + return genericVnf; + + } else { + logger.info("Fire GetGenericVnfInfo : Failed"); + } + return null; + } + + private Map<String,String> getDeviceStatus(String deviceId) { + String result = ""; + String status = ""; + Map<String,String> resultMap = new HashMap<>(); + String deviceDesc = ""; + String deviceName = ""; + ObjectMapper mapper = new ObjectMapper(); + + try { + logger.info("aai getDeviceStatus is starting!"); + + Response<ResponseBody> response = this.aaiService.getDeviceInfo(deviceId).execute(); + + + logger.info("aai getDeviceStatus has finished!"); + if (response.isSuccessful()) { + result = new String(response.body().bytes()); + DeviceInfo deviceInfo = mapper.readValue(result, new TypeReference<DeviceInfo>() { + }); + status = deviceInfo.getOperationalStatus(); + deviceDesc = deviceInfo.getDescription(); + deviceName = deviceInfo.getDeviceName(); + if (status.isEmpty()) { + status = "activate"; + } + resultMap.put("status",status); + resultMap.put("deviceDesc",deviceDesc); + resultMap.put("deviceName",deviceName); + } else { + logger.info(String.format("Can not get getDeviceStatus[code=%s, message=%s]", response.code(), response.message())); + result = Constant.CONSTANT_FAILED; + } + } catch (IOException e) { + + logger.error("getDeviceStatus exception occured:" + e); + result = Constant.CONSTANT_FAILED; + } + return resultMap; + } + + private Enum generateEnumValue(String deviceStatus, String edgeStatus) { + StatusEnum value = null; + if(edgeStatus.equalsIgnoreCase("Online") && deviceStatus.equalsIgnoreCase("Online")) + { + value = StatusEnum.GREEN_GREEN; + } + else if(edgeStatus.equalsIgnoreCase("Offline") && deviceStatus.equalsIgnoreCase("Online")) + { + value = StatusEnum.GREEN_GREY; + } + else + { + value = StatusEnum.GREY_GREY; + } + return value; + } + + */ + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceQryService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceQryService.java new file mode 100644 index 00000000..ad1dd36b --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceQryService.java @@ -0,0 +1,22 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.service.lcm; + +public interface SotnServiceQryService { + + String getServiceInstances(String serviceType); + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceTemplateService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceTemplateService.java new file mode 100644 index 00000000..355939fb --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/SotnServiceTemplateService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.service.lcm; + +import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp; +import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation; + +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; + +public interface SotnServiceTemplateService { + + public String getSOTNSiteInformationTopology(String subscriptionType, String instanceid); + public ServiceOperation instantiate_CCVPN_Service(HashMap<String, Object> reqt); + //public DeleteOperationRsp deleteService(String serviceId, String subscriptionType, HttpServletRequest request); + public String getSOTNResourceInformationTopology(String subscriptionType, String instanceid) throws Exception; + public String getService(String subscriptionType, String instanceid); +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java index 460f7f0a..cdc5dd11 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java @@ -354,6 +354,87 @@ public interface AAIService { }) @PUT("/api/aai-query/v16?format=resource") Call<ResponseBody> querynNetworkResourceList(@Body RequestBody body); + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-business/v14/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}") + Call<ResponseBody> getServiceInstancesForEdge(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType, + @Path("service-instance-id") String serviceinstanceid); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-network/v14/connectivities/connectivity") + Call<ResponseBody> getConnectivityInformation(@Query("connectivity-id") String connectivityId); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-network/v14/pnfs/pnf/{pnfName}/p-interfaces/p-interface/{tp-id}") + Call<ResponseBody> getTerminationPoint(@Path("pnfName") String pnfName,@Path("tp-id") String tpId); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-business/v16/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}/allotted-resources/allotted-resource/{allotted-resource-id}") + Call<ResponseBody> getAllotedResourceFor5G(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType, + @Path("service-instance-id") String serviceinstanceid,@Path("allotted-resource-id") String allottedResourceId); + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-network/v14/site-resources/site-resource/{site-resource-id}") + Call<ResponseBody> getSiteResourceInfo(@Path("site-resource-id") String siteResourceId); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-cloudInfrastructure/v14/complexes/complex/{complex-id}") + Call<ResponseBody> getComplexObject(@Path("complex-id") String complexId); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + + @GET("/api/aai-business/v14/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances") + Call<ResponseBody> getAllServiceInformation(@Path("global-customer-id") String customerId, @Path("service-type") String serviceType); +// @Headers({ +// "X-TransactionId: 7777", +// "X-FromAppId: uui", +// "Authorization: Basic QUFJOkFBSQ==", +// "Accept: application/json" +// }) +// @GET("/api/aai-network/v14/pnfs/pnf/{pnfName}") +// Call<ResponseBody> getPnfInfo(@Path("pnfName") String pnfName); + + @Headers({ + "X-TransactionId: 7777", + "X-FromAppId: uui", + "Authorization: Basic QUFJOkFBSQ==", + "Accept: application/json" + }) + @GET("/api/aai-business/v13/customers/customer/{global-customer-id}/service-subscriptions") + Call<ResponseBody> getServiceSubscription(@Path("global-customer-id") String customerID); } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java index 494647ac..d417e7e1 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java @@ -16,6 +16,7 @@ package org.onap.usecaseui.server.service.lcm.domain.so; import okhttp3.RequestBody; +import org.onap.usecaseui.server.bean.lcm.sotne2eservice.E2EServiceInstanceRequest; import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp; import org.onap.usecaseui.server.service.lcm.domain.so.bean.OperationProgressInformation; import org.onap.usecaseui.server.service.lcm.domain.so.bean.SaveOrUpdateOperationRsp; @@ -60,4 +61,12 @@ public interface SOService { }) @PUT("/api/so-serviceInstances/v3/{serviceId}") Call<SaveOrUpdateOperationRsp> updateService(@Path("serviceId") String serviceId, @Body RequestBody body); + + @Headers({ + "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==", + "Accept: application/json" + }) + //@POST("/onap/so/infra/e2eServiceInstances/v3") + @POST("/api/so-serviceInstances/v5") + Call<ServiceOperation> instantiateSOTNService(@Body E2EServiceInstanceRequest body); } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java new file mode 100644 index 00000000..203a07d7 --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java @@ -0,0 +1,122 @@ +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.service.lcm.impl; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.ResponseBody; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +import org.onap.usecaseui.server.bean.activateEdge.ServiceInstance; +import org.onap.usecaseui.server.bean.lcm.sotne2eservice.ModelConfig; +import org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor.ResponseServiceInstanceWrapper; +import org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor.ServiceInstanceList; +import org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor.ServiceInstanceListWrapper; +//import org.onap.usecaseui.server.bean.lcm.sotne2eservicemonitor.ServiceSubscriptionWrapper; +import org.onap.usecaseui.server.service.lcm.SotnServiceQryService; +import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService; +import org.onap.usecaseui.server.util.RestfulServices; +import org.onap.usecaseui.server.util.UuiCommonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.stereotype.Service; +import retrofit2.Response; + +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@Service("SotnServiceQry") +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +public class SotnServiceQryServiceImpl implements SotnServiceQryService { + + private static final Logger logger = LoggerFactory.getLogger(SotnServiceQryServiceImpl.class); + + private AAIService aaiService; + + public SotnServiceQryServiceImpl() { + this(RestfulServices.create(AAIService.class)); + } + + public SotnServiceQryServiceImpl(AAIService aaiService) { + this.aaiService = aaiService; + } + + @Override + public String getServiceInstances(String serviceType) { + ModelConfig modelConfig = readFile(); + String customerid = modelConfig.getSubscriberId(); + List<String> result = new ArrayList<>(); + + //serviceType = "generic"; + ObjectMapper mapper = new ObjectMapper(); + JSONParser parser = new JSONParser(); + + try { + Response<ResponseBody> response = aaiService.listServiceInstances(customerid, serviceType).execute(); + if (response.isSuccessful()) { + String resultStr=new String(response.body().bytes()); + ServiceInstanceListWrapper serviceInstances = mapper.readValue(resultStr, new TypeReference<ServiceInstanceListWrapper>() { + }); + List<ServiceInstanceList> serviceIntances = new ArrayList<>(); + for(ServiceInstance ServiceInstance : serviceInstances.getServiceIntances()) { + if(!ServiceInstance.getServiceInstanceName().contains("Site_Service_")){ + ServiceInstanceList serviceInstanceList = new ServiceInstanceList(); + serviceInstanceList.setServiceInstance(ServiceInstance.getServiceInstanceId()); + serviceInstanceList.setServiceInstancename(ServiceInstance.getServiceInstanceName()); + serviceIntances.add(serviceInstanceList); + } + } + ResponseServiceInstanceWrapper responseServiceInstanceWrapper= new ResponseServiceInstanceWrapper(); + responseServiceInstanceWrapper.setServiceInstanceListList(serviceIntances); + return responseServiceInstanceWrapper.toString(); + } + + else { + logger.info(String.format("Can not get service instances[code=%s, message=%s]", response.code(), response.message())); + return null; + } + } catch (IOException e) { + logger.error("list services instances occur exception"+e.getMessage()); + return null; + } + } + + public ModelConfig readFile() { + JSONParser parser = new JSONParser(); + String jsonPath = "/home/root1/Desktop/modelconfig.json"; + String jsonString = null; + ObjectMapper mapper = new ObjectMapper(); + + try { + + Object object = parser.parse(new FileReader(jsonPath)); + //System.out.println(object.toString()); + ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() { + }); + + return modelInformation; + } catch (ParseException | IOException ex) { + logger.error("Exception occured while reading configuration file:" + ex); + return null; + } + } +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java new file mode 100644 index 00000000..226330df --- /dev/null +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java @@ -0,0 +1,1231 @@ +package org.onap.usecaseui.server.service.lcm.impl; + + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import okhttp3.ResponseBody; +//import org.onap.usecaseui.server.bean.lcm.sotne2eservice.*; +//import org.onap.usecaseui.server.bean.lcm.sotne2eservice.Connectivity; +//import org.onap.usecaseui.server.bean.sotn.Pinterface; +import org.onap.usecaseui.server.bean.orderservice.ServiceEstimationBean; +import org.onap.usecaseui.server.service.lcm.SotnServiceTemplateService; +import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService; +import org.onap.usecaseui.server.service.lcm.domain.aai.bean.Relationship; +//import org.onap.usecaseui.server.service.lcm.domain.aai.bean.ServiceInstance; +import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation; +import org.onap.usecaseui.server.service.lcm.domain.so.SOService; +import org.onap.usecaseui.server.service.lcm.domain.so.bean.Operation; +import org.onap.usecaseui.server.service.lcm.domain.so.exceptions.SOException; +import org.onap.usecaseui.server.bean.lcm.sotne2eservice.*; +import org.onap.usecaseui.server.bean.activateEdge.*; +import retrofit2.Response; +import org.onap.usecaseui.server.service.lcm.domain.aai.bean.RelationshipData; + +import javax.servlet.ServletInputStream; +import java.io.FileReader; +import java.io.IOException; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * Copyright 2016-2017 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + +public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateService { + + private SOService soService; + private AAIService aaiService; + + + + + private Map<String, Model> readConfigToMap(ModelConfig modelConfig) { + + //ModelConfig modelConfig = readFile(); +// Map<String, Model> modelinfo = modelConfig.getResourcemodelinformation().stream() +// .collect(Collectors.toMap(ModelInfor::getModelType, ModelInfor::getModel)); + return null; + } + + public ModelConfig readFile() { + JSONParser parser = new JSONParser(); + String jsonPath = "/home/modelconfig.json"; + String jsonPath_2 = ""; + String jsonString = null; + ObjectMapper mapper = new ObjectMapper(); + + try { + + Object object = parser.parse(new FileReader(jsonPath)); + // System.out.println("mukesh"+object.toString()); + ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() { + }); + + return modelInformation; + } catch (ParseException | IOException ex) { + // logger.error("Exception occured while reading configuration file:" + ex); + return null; + } + } + + public ModelConfig readFile_unni(){ + JSONParser parser = new JSONParser(); + String jsonPath = "/home/modelconfigunni.json"; + String jsonPath_2 = ""; + String jsonString = null; + ObjectMapper mapper = new ObjectMapper(); + + try { + + Object object = parser.parse(new FileReader(jsonPath)); + // System.out.println("mukesh"+object.toString()); + ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() { + }); + + return modelInformation; + } catch (ParseException | IOException ex) { + // logger.error("Exception occured while reading configuration file:" + ex); + return null; + } + } + + public ServiceOperation instantiate_CCVPN_Service(HashMap<String, Object> reqt) { + ServletInputStream inStream = null; + E2EServiceInstanceRequest requestBody = null; + Response<ServiceOperation> sotnserviceresponse = null; + Operation sotnservice = null; + ModelConfig modelConfig = readFile_unni(); + Model servicemodel = modelConfig.getServiceModel().getModel(); + //Map<String, Model> modelInfo = readConfigToMap(modelConfig); + List<ModelInfor> resourceModel = modelConfig.getResourcemodelinformation(); + +// try { +// inStream = request.getInputStream(); +// BufferedReader reader = new BufferedReader(new InputStreamReader(inStream)); +// String requestJson = IOUtils.read(reader); +// logger.info("The request body content is: " + requestJson); +// } catch (IOException e) { +// logger.info("The request body parsing failed." + e.getMessage()); +// return null; +// } finally { +// if (inStream != null) { +// try { +// inStream.close(); +// } catch (IOException e) { +// +// } +// } +// } + + String customerid = modelConfig.getSubscriberId(); + String subscriptionType = modelConfig.getSubscriptionType(); + + requestBody = create_CCVPN_Request_Body(reqt, resourceModel, customerid, subscriptionType, servicemodel); + try { + System.out.println("SO request formed : " + new ObjectMapper().writeValueAsString(requestBody)); + } catch (IOException e) { + + } + + ServiceOperation sotnserviceoperation = createSotnService(requestBody); + sotnservice = sotnserviceoperation.getService(); + //logger.info("Began to sleep for "); + try { + Thread.sleep(1); + } catch (Exception e) { + // logger.info("sleep Interrupted"); + } + + // logger.info("wokeup to sleep "); + + + return sotnserviceoperation; + //return null; + } + public ServiceOperation createSotnService(E2EServiceInstanceRequest requestBody) { + Operation result = new Operation(); + try { + // logger.info("SO instantiate SOTN service is starting"); + Response<ServiceOperation> sotnserviceresponse = soService.instantiateSOTNService(requestBody).execute(); + // logger.info("SO instantiate SOTN service has finished"); + if (sotnserviceresponse.isSuccessful()) { + // logger.info("SO instantiate SOTN service is successful"); + //result=sotnserviceresponse.body().getService(); + return sotnserviceresponse.body(); + } else { + // logger.error(String.format("Can not instantiate SOTN service[code=%s, message=%s]", sotnserviceresponse.code(), sotnserviceresponse.message())); + throw new SOException("SO instantiate SOTN service failed!"); + } + } catch (Exception e) { + throw new SOException("SO Service is not available!", e); + } + + } + + private E2EServiceInstanceRequest create_CCVPN_Request_Body(Map request, List<ModelInfor> resourceModel, + String customerid, String subscriptionType, Model servicemodel ) { + + E2EServiceInstanceRequest e2eServiceInstanceRequest = new E2EServiceInstanceRequest(); + E2EService e2eService = new E2EService(); + E2EParameters parameters = new E2EParameters(); + e2eServiceInstanceRequest.setService(e2eService); + e2eService.setName(request.get("name").toString()); + e2eService.setDescription(request.get("description").toString()); + + e2eService.setServiceInvariantUuid(servicemodel.getResourceInvariantUuid()); //Need to get from SDC or Configuration + e2eService.setServiceUuid(servicemodel.getResourceUuid()); + e2eService.setGlobalSubscriberId(customerid); + e2eService.setServiceType(subscriptionType); + e2eService.setParameters(parameters); + + + // modelInfo.forEach ((k,v) - + + // Iterator<Map.Entry<String, Model>> it = modelInfo.entrySet().iterator(); + // + // while (it.hasNext()) { + + //List<Object> ResourceModelList = modelInfo.get("resourcemodelinformation"); + List<ResourceRequest> resourceList = new LinkedList<ResourceRequest>(); + ResourceRequest resource = null; + + for (ModelInfor singleresourceModel : resourceModel) { + + + resource = new ResourceRequest(); + resource.setResourceName(singleresourceModel.getModel().getResourceName()); + resource.setResourceInvariantUuid(singleresourceModel.getModel().getResourceInvariantUuid()); + resource.setResourceCustomizationUuid(singleresourceModel.getModel().getResourceCustomizationUuid()); + resource.setResourceUuid(singleresourceModel.getModel().getResourceInvariantUuid()); + resource.setParameters(new E2EParameters()); + System.out.println(resource); + + resourceList.add(resource); + System.out.println("listaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); + System.out.println(resourceList); + e2eService.getParameters().setResources(resourceList); + + } + //List<ResourceRequest> resourceList = new LinkedList<ResourceRequest>() + + // System.out.println("listaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); + // System.out.println(resourceList); + // e2eService.getParameters().setResources(resourceList); + + // List<ResourceRequest> resourceList = new LinkedList<ResourceRequest>(); + // resourceList.add(resource); + // e2eService.getParameters().setResources(resourceList); + + HashMap<String, Object> requestInputsmap = new HashMap(); + requestInputsmap.put("l2vpn", request.get("l2vpn")); + requestInputsmap.put("sotnUni", request.get("sotnUni")); + e2eService.getParameters().setRequestInputs(requestInputsmap); + e2eServiceInstanceRequest.setService(e2eService); + return e2eServiceInstanceRequest; + } + + + public ServiceInstance getServiceInstancesInfo(String customerId, String serviceType, String serviceInstanceId) throws Exception { + //logger.info("Fire getServiceInstances : Begin"); + ObjectMapper mapper = new ObjectMapper(); + + Response<ResponseBody> response = this.aaiService.getServiceInstancesForEdge(customerId, serviceType, serviceInstanceId).execute(); + if (response.isSuccessful()) { + // logger.info("Fire getServiceInstances : End"); + String result = new String(response.body().bytes()); + ServiceInstance serviceInstance = mapper.readValue(result, ServiceInstance.class); + return serviceInstance; + //System.out.println("Response received : "+response.body().bytes()); + } else { + // logger.info("Fire getServiceInstances : Failed"); + + } + return null; + } + + private Connectivity getConnectivityInfo(String connectivityinstanceid) throws IOException { + //logger.info("Fire getServiceInstancesForEdge : Begin"); + ObjectMapper mapper = new ObjectMapper(); + Response<ResponseBody> response = this.aaiService.getConnectivityInformation(connectivityinstanceid).execute(); + if (response.isSuccessful()) { + // logger.info("Fire getServiceInstancesForEdge : End"); + String result = new String(response.body().bytes()); + Connectivity connectivity = mapper.readValue(result, Connectivity.class); + return connectivity; + //System.out.println("Response received : "+response.body().bytes()); + } else { + // logger.info("Fire getServiceInstancesForEdge : Failed"); + + } + + + return null; + } + + public Pinterface getTerminationPoint(String pnfName, String tpId) throws Exception { + //logger.info("Fire getTerminationPoint : Begin"); + ObjectMapper mapper = new ObjectMapper(); + //Response<ResponseBody> response = this.aaiService.getPinterfaceByPnfName(pnfName,tpId).execute(); + Response<ResponseBody> response = this.aaiService.getTerminationPoint(pnfName, tpId).execute(); + if (response.isSuccessful()) { + // logger.info("Fire getTerminationPoint : End"); + String result = new String(response.body().bytes()); + Pinterface pinterface = mapper.readValue(result, Pinterface.class); + return pinterface; + //System.out.println("Response received : "+response.body().bytes()); + } else { + //logger.info("Fire getTerminationPoint : Failed"); + + } + + return null; + } + private AllottedResource getAllottedResource(String globalCustomerId, String serviceType, String siteserviceinstanceid, String allottedResourceId) throws IOException { + // logger.info("Fire getServiceInstancesForEdge : Begin"); + ObjectMapper mapper = new ObjectMapper(); + Response<ResponseBody> response = this.aaiService.getAllotedResourceFor5G(globalCustomerId, serviceType, siteserviceinstanceid, allottedResourceId).execute(); + if (response.isSuccessful()) { + //logger.info("Fire getServiceInstancesForEdge : End"); + String result = new String(response.body().bytes()); + AllottedResource allottedResource = mapper.readValue(result, AllottedResource.class); + return allottedResource; + //System.out.println("Response received : "+response.body().bytes()); + } else { + //logger.info("Fire getServiceInstancesForEdge : Failed"); + + } + + + return null; + } + + private SiteResource getSiteResource(String siteResourceID) throws IOException { + //logger.info("Fire get site resource : Begin"); + ObjectMapper mapper = new ObjectMapper(); + Response<ResponseBody> response = this.aaiService.getSiteResourceInfo(siteResourceID).execute(); + if (response.isSuccessful()) { + // logger.info("Fire get site resource : End"); + String result = new String(response.body().bytes()); + SiteResource resource = mapper.readValue(result, SiteResource.class); + return resource; + //System.out.println("Response received : "+response.body().bytes()); + } else { + // logger.info("Fire get site resource : Failed"); + + } + + return null; + } + + private ComplexObj getComplexData(String complexID) throws IOException { + // logger.info("Fire get complex Object : Begin"); + ObjectMapper mapper = new ObjectMapper(); + Response<ResponseBody> response = this.aaiService.getComplexObject(complexID).execute(); + if (response.isSuccessful()) { + // logger.info("Fire get complex Object : End"); + String result = new String(response.body().bytes()); + ComplexObj complexObj = mapper.readValue(result, ComplexObj.class); + return complexObj; + //System.out.println("Response received : "+response.body().bytes()); + } else { + // logger.info("Fire get complex Object : Failed"); + + } + + + return null; + } + + + public String getSOTNSiteInformationTopology(String subscriptionType, String instanceid) { + + ModelConfig modelConfig = readFile(); + Map<String, Model> modelInfo = readConfigToMap(modelConfig); + String customerId = modelConfig.getSubscriberId(); + + ServiceInstance serviceInstance = null; + ServiceInstance siteservice = null; + Map<String, Object> connectivityparams; + List<String> vpnparams = new ArrayList<String>(Arrays.asList("cir", "eir", "cbs", "ebs", "colorAware", "couplingFlag", "ethtSvcName")); + List<Map<String, Object>> sites = new LinkedList<Map<String, Object>>(); + String jsonresponse = ""; + String pnfname = ""; + String allottedpinterfaceid = ""; + String linkstatus = ""; + AllottedResource allottedResource = new AllottedResource(); + + //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : BEGIN --------------------------------------- + try { + serviceInstance = getServiceInstancesInfo(customerId, subscriptionType, instanceid); + if (serviceInstance == null) + return null; + } catch (Exception e) { +// logger.info("Query Service Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType); + return null; + } + + List<Relationship> relationship = serviceInstance.getRelationshipList().getRelationship().stream().filter(relation -> relation.getRelatedTo() + .equalsIgnoreCase("allotted-resource")).collect(Collectors.toList()); + if (relationship.size() > 0 && relationship != null) { + // This is SOTN service + connectivityparams = new HashMap<String, Object>(); + relationship = serviceInstance.getRelationshipList().getRelationship(); + Relationship relation = relationship.stream() + .filter(relate -> "connectivity".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + try { + String connectivityinstanceid = relation.getRelatedLink().substring(relation.getRelatedLink().lastIndexOf("/") + 1); + Connectivity connectivity = getConnectivityInfo(connectivityinstanceid); + connectivityparams = new ObjectMapper().readValue(connectivity.toString(), HashMap.class); + } catch (IOException e) { + // logger.info("IO Exception occured " + e.getMessage()); + } + //nodeId-10.10.10.10-ltpId-147 + allottedpinterfaceid = "nodeId-" + connectivityparams.get("accessNodeId").toString() + "-ltpId-" + connectivityparams.get("accessLtpId").toString(); + pnfname = connectivityparams.get("accessNodeId").toString(); + try { + Pinterface pinterface = getTerminationPoint(pnfname, allottedpinterfaceid); + linkstatus = pinterface.getOperationalStatus(); + if (linkstatus.equalsIgnoreCase("overloaded")) + linkstatus = "up"; + } catch (Exception e) { + + } + + List<Relationship> servicerelationList = relationship.stream() + .filter(relate -> "service-instance".equalsIgnoreCase(relate.getRelatedTo())).collect(Collectors.toList()); + for (Relationship servicerelation : servicerelationList) { + String siteserviceinstanceid = servicerelation.getRelatedLink().substring(servicerelation.getRelatedLink().lastIndexOf("/") + 1); + String cvlan = ""; + String externalltp = ""; + Map<String, Object> site; + try { + siteservice = getServiceInstancesInfo(customerId, subscriptionType, siteserviceinstanceid); + if (siteservice == null) + return null; + } catch (Exception e) { +// logger.info("Query Service Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType); + return null; + } + List<Relationship> ssrelationship = siteservice.getRelationshipList().getRelationship().stream() + .filter(siterelation -> siterelation.getRelatedTo().equalsIgnoreCase("site-resource") || + siterelation.getRelatedTo().equalsIgnoreCase("allotted-resource")).collect(Collectors.toList()); + + if (ssrelationship.size() > 0) { + Relationship allotrel = ssrelationship.stream() + .filter(relate -> "allotted-resource".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + String allottedResourceId = allotrel.getRelatedLink().substring(allotrel.getRelatedLink().lastIndexOf("/") + 1); + try { + allottedResource = getAllottedResource(customerId, subscriptionType, siteserviceinstanceid, allottedResourceId); + cvlan = allottedResource.getCvlan(); + externalltp = allottedResource.getAccessLtpId(); + + } catch (Exception e) { + // logger.info("Query Allotted resource for site service" + siteserviceinstanceid + " allotted resource Id " + allottedResourceId); + } + + + Relationship siterel = ssrelationship.stream() + .filter(relate -> "site-resource".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + String siteResourceID = siterel.getRelatedLink().substring(siterel.getRelatedLink().lastIndexOf("/") + 1); + try { + SiteResource resource = getSiteResource(siteResourceID); + site = new HashMap<String, Object>(); + site.put("siteId", resource.getSiteResourceId()); + site.put("siteName", resource.getSiteResourceName()); + site.put("description", resource.getDescription()); + site.put("role", "dsvpn-hub"); + List<Relationship> complexRelationship = resource.getRelationshipList().getRelationship() + .stream().filter(rel -> rel.getRelatedTo().equalsIgnoreCase("complex")) + .collect(Collectors.toList()); + for (Relationship complexrelation : complexRelationship) { + String complexID = complexrelation.getRelatedLink().substring(complexrelation.getRelatedLink().lastIndexOf("/") + 1); + ComplexObj complex = getComplexData(complexID); //getSiteResourceInfo + site.put("address", complex.getCity()); + site.put("location", complex.getCity()); + site.put("zipCode", complex.getPostalCode()); + } + Map<String, Object> attr = new HashMap<String, Object>(); + attr.put("cvlan", cvlan); + attr.put("Access node Id", connectivityparams.get("accessNodeId").toString()); + attr.put("Access LTP Id", externalltp); + attr.put("Location", site.get("location")); + attr.put("Site Name", site.get("siteName")); + attr.put("Zip Code", site.get("zipCode")); + attr.put("Link Status", linkstatus); + attr.put("Inter-Domain LTP Id", connectivityparams.get("accessLtpId").toString()); + site.put("attribute", attr); + sites.add(site); + } catch (Exception e) { +// logger.info("Query Service Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType); + return null; + } + } else { + String requestinput = siteservice.getInputparameters(); + E2EServiceInstanceRequest e2eserviceRequest = new E2EServiceInstanceRequest(); + ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + try { + e2eserviceRequest = mapper.readValue(requestinput.toString(), new TypeReference<E2EServiceInstanceRequest>() { + }); + } catch (IOException e) { + } + + HashMap<String, ?> requestInputs = e2eserviceRequest.getService().getParameters().getRequestInputs(); + site = new HashMap<String, Object>(); + Map<String, Object> attr = new HashMap<String, Object>(); + for (Map.Entry<String, ?> e : requestInputs.entrySet()) { + if (e.getKey().contains("name")) { + site.put("siteName", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("description")) { + site.put("description", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("role")) { + site.put("role", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("address")) { + site.put("location", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("postcode")) { + site.put("zipCode", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("cVLAN")) { + attr.put("cvlan", (String) requestInputs.get(e.getKey())); + + } + } + attr.put("Location", site.get("location")); + attr.put("Site Name", site.get("siteName")); + attr.put("Zip Code", site.get("zipCode")); + attr.put("Link Status", linkstatus); + site.put("attribute", attr); + sites.add(site); + } + } + try { + jsonresponse = new ObjectMapper().writeValueAsString(sites); + System.out.println(jsonresponse); + } catch (IOException e) { + + } + + } + //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : END ----------------------------------------- + return jsonresponse; + } + + + + + + + + + + + + + + + + + +// public DeleteOperationRsp deleteService(String serviceId, String subscriptionType, HttpServletRequest request) +// { +// +// } + + + + + + public VpnBinding getSOTNPinterfaceByVpnId(String vpnId) throws Exception { + + // logger.info("Fire getSOTNPinterfaceByVpnId : Begin"); + ObjectMapper mapper = new ObjectMapper(); + Response<ResponseBody> response = this.aaiService.getPinterfaceByVpnId(vpnId).execute(); + + //Response<ResponseBody> response = this.aaiService.getSOTNPinterfaceByVpnId(vpnId).execute(); + if (response.isSuccessful()) { + // logger.info("Fire getSOTNPinterfaceByVpnId : End"); + String result = new String(response.body().bytes()); + VpnBinding vpnBinding = mapper.readValue(result, VpnBinding.class); + return vpnBinding; + //System.out.println("Response received : "+response.body().bytes()); + } else { + // logger.info("Fire getSOTNPinterfaceByVpnId : Failed"); + + } + + return null; + + + } + + + public Pnf getSOTNPnf(String pnfname) throws Exception { + + // logger.info("Fire get SOTN PnF by Name : Begin"); + ObjectMapper mapper = new ObjectMapper(); + Response<ResponseBody> response = this.aaiService.getPnfInfo(pnfname).execute(); + if (response.isSuccessful()) { + // logger.info("Fire getSOTNLinkbyName : End"); + String result = new String(response.body().bytes()); + Pnf pnf = mapper.readValue(result, Pnf.class); + return pnf; + //System.out.println("Response received : "+response.body().bytes()); + } else { + // logger.info("Fire get SOTN PnF by Name : Failed" + pnfname); + + } + + return null; + } + + public LogicalLink getSOTNLinkbyName(String linkName) throws Exception { + + // logger.info("Fire getSOTNLinkbyName : Begin"); + ObjectMapper mapper = new ObjectMapper(); + Response<ResponseBody> response = this.aaiService.getSpecificLogicalLink(linkName).execute(); + if (response.isSuccessful()) { + // logger.info("Fire getSOTNLinkbyName : End"); + String result = new String(response.body().bytes()); + LogicalLink logicalLink = mapper.readValue(result, LogicalLink.class); + return logicalLink; + //System.out.println("Response received : "+response.body().bytes()); + } else { + // logger.info("Fire getSOTNLinkbyName : Failed"); + + } + + return null; + } + + @Override + public String getSOTNResourceInformationTopology(String subscriptionType, String instanceid) throws Exception { + + //-------------------------------------------------------------------------------------------------------------------------- + ModelConfig modelConfig = readFile(); + Map<String, Model> modelInfo = readConfigToMap(modelConfig); + String customerId = modelConfig.getSubscriberId(); + ResourceResponse resourceResponse = new ResourceResponse(); + List<Node> nodes = new ArrayList<Node>(); + List<Edge> edges = new ArrayList<Edge>(); + List<String> vpnparams = new ArrayList<String>(Arrays.asList("cir", "eir", "cbs", "ebs", "colorAware", "couplingFlag", "ethtSvcName")); + List<String> tpparams = new ArrayList<String>(Arrays.asList("ethtSvcName", "accessProviderId", "accessClientId", "accessTopologyId", "accessNodeId", "accessLtpId")); + ServiceInstance serviceInstance = null; + ServiceInstance siteservice = null; + Map<String, Object> connectivityparams; + String jsonresponse = ""; + AllottedResource allottedResource = new AllottedResource(); + Connectivity connectivity = new Connectivity(); + Node allottednode = new Node(); + Node connode = new Node(); + + String allottedpinterfaceid = ""; + ObjectMapper jsonmapper = new ObjectMapper(); + List<Relationship> tpinterface = new ArrayList<>(); + LogicalLink logicallink = new LogicalLink(); + Pnf extpnf = new Pnf(); + String logicallinkparentid = ""; + boolean ext_tp_found = false; + //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : BEGIN --------------------------------------- + try { + serviceInstance = getServiceInstancesInfo(customerId, subscriptionType, instanceid); + if (serviceInstance == null) + return null; + } catch (Exception e) { +// logger.info("Query Service Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType); + return null; + } + + + List<Relationship> relationship = serviceInstance.getRelationshipList().getRelationship().stream().filter(relation -> relation.getRelatedTo() + .equalsIgnoreCase("allotted-resource")).collect(Collectors.toList()); + if (relationship.size() > 0 && relationship != null) { + // This is SOTN service + //Query Connectivity : Begin + connectivityparams = new HashMap<String, Object>(); + relationship = serviceInstance.getRelationshipList().getRelationship(); + Relationship relation = relationship.stream() + .filter(relate -> "connectivity".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + try { + String connectivityinstanceid = relation.getRelatedLink().substring(relation.getRelatedLink().lastIndexOf("/") + 1); + connectivity = getConnectivityInfo(connectivityinstanceid); + connectivityparams = new ObjectMapper().readValue(connectivity.toString(), HashMap.class); + + connode.setId(connectivityparams.get("connectivityId").toString()); + connode.setShape("circularImage"); + connode.setImage("./assets/treeTopology/connectivity.png"); + connode.setLabel("Connectivity"); + connode.setColor("Green"); + Map<String, Object> datanode = new HashMap<String, Object>(); + for (String key : vpnparams) { + if (key.equalsIgnoreCase("ebs")) + datanode.put("Service Type", connectivityparams.get(key)); + else + datanode.put(key, connectivityparams.get(key)); + } + + connode.setDataNode(new ObjectMapper().writeValueAsString(datanode)); + nodes.add(connode); + + } catch (IOException e) { + // logger.info("IO Exception occured " + e.getMessage()); + } + //Query Connectivity : End + + + //Query VPN : Begin + Relationship vpnrelation = connectivity.getRelationshipList().getRelationship().stream() + .filter(relate -> "vpn-binding".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + String vpnid = vpnrelation.getRelatedLink().substring(vpnrelation.getRelatedLink().lastIndexOf("/") + 1); + VpnBinding vpnBinding = new VpnBinding(); + VpnInformation vpnInformation = new VpnInformation(); + try { + vpnBinding = getSOTNPinterfaceByVpnId(vpnid); + vpnInformation = vpnBinding.getVpnBinding().get(0); + } catch (Exception e) { + } + Node vpn = new Node(); + vpn.setId(vpnInformation.getVpnId()); + vpn.setShape("circularImage"); + vpn.setImage("./assets/treeTopology/vpnbinding.png"); + vpn.setLabel("VPN Binding"); + vpn.setColor("Green"); + ObjectMapper mapper = new ObjectMapper(); + Map<String, Object> props = mapper.convertValue(vpnInformation, Map.class); + props.remove("relationship-list"); + props.remove("resource-version"); + props.remove("vpn-region"); + props.remove("vpn-id"); + vpn.setDataNode(new ObjectMapper().writeValueAsString(props)); + nodes.add(vpn); + Edge connectivitytovpnedge = new Edge(); + connectivitytovpnedge.setFrom(connode.getId()); + connectivitytovpnedge.setTo(vpn.getId()); + edges.add(connectivitytovpnedge); + + //Query VPN : End + + //Query access node : Begin + + String srcnodeid = vpnInformation.getSrcAccessNodeId(); + Pnf srcpnf = new Pnf(); + srcpnf = getSOTNPnf(srcnodeid); + Node srcpnfnode = new Node(); + Node dstpnfnode = new Node(); + srcpnfnode.setId(srcpnf.getPnfId()); + srcpnfnode.setShape("circularImage"); + srcpnfnode.setImage("./assets/treeTopology/accessnode.png"); + srcpnfnode.setLabel("Abstract Node"); + srcpnfnode.setColor("Green"); + ObjectMapper srcpnfmapper = new ObjectMapper(); + Map<String, Object> srcpnfprop = srcpnfmapper.convertValue(srcpnf, Map.class); + srcpnfprop.remove("relationship-list"); + srcpnfprop.remove("resource-version"); + srcpnfprop.remove("in-maint"); + srcpnfprop.remove("admin-status"); + srcpnfnode.setDataNode(new ObjectMapper().writeValueAsString(srcpnfprop)); + nodes.add(srcpnfnode); + + String dstnodeid = vpnInformation.getDstAccessNodeId(); + boolean foundnode = false; + for (Node node : nodes) { + if (node.getId().equalsIgnoreCase(dstnodeid)) { + foundnode = true; + break; + } + } + if (!foundnode) { + Pnf dstpnf = new Pnf(); + dstpnf = getSOTNPnf(dstnodeid); + + dstpnfnode.setId(dstpnf.getPnfId()); + dstpnfnode.setShape("circularImage"); + dstpnfnode.setImage("./assets/treeTopology/accessnode.png"); + dstpnfnode.setLabel("Abstract Node"); + dstpnfnode.setColor("Green"); + ObjectMapper dstpnfmapper = new ObjectMapper(); + Map<String, Object> dstpnfprop = dstpnfmapper.convertValue(dstpnf, Map.class); + dstpnfprop.remove("relationship-list"); + dstpnfprop.remove("resource-version"); + dstpnfprop.remove("in-maint"); + dstpnfnode.setDataNode(new ObjectMapper().writeValueAsString(srcpnfprop)); + nodes.add(dstpnfnode); + } + + //Query P Interfaces + + + List<Relationship> vpnpinterfacerelation = vpnInformation.getRelationshipList().getRelationship().stream() + .filter(relate -> "p-interface".equalsIgnoreCase(relate.getRelatedTo())).collect(Collectors.toList()); + for (Relationship temprel : vpnpinterfacerelation) { + String pinterfaceid = temprel.getRelatedLink().substring(temprel.getRelatedLink().lastIndexOf("/") + 1); + String parentaccessnode = ""; + + + RelationshipData[] pnfrelatedprop = temprel.getRelationshipData(); + for (RelationshipData temp : pnfrelatedprop) { + if ("pnf.pnf-name".equalsIgnoreCase(temp.getRelationshipKey())) { + parentaccessnode = temp.getRelationshipValue(); + break; + } + } + try { + Pinterface pinterface = new Pinterface(); + pinterface = getTerminationPoint(parentaccessnode, pinterfaceid); + Node vpnpinterface = new Node(); + vpnpinterface.setId(pinterface.getInterfaceName()); + vpnpinterface.setShape("circularImage"); + vpnpinterface.setImage("./assets/treeTopology/tpoint.png"); + vpnpinterface.setLabel("Termination Point"); + vpnpinterface.setColor("Green"); + ObjectMapper vpnpintmapper = new ObjectMapper(); + Map<String, Object> vpnpintprops = vpnpintmapper.convertValue(pinterface, Map.class); + vpnpintprops.remove("relationship-list"); + vpnpintprops.remove("resource-version"); + vpnpintprops.remove("in-maint"); + vpnpinterface.setDataNode(new ObjectMapper().writeValueAsString(vpnpintprops)); + nodes.add(vpnpinterface); + Edge iallotedtopnfedge = new Edge(); + iallotedtopnfedge.setFrom(vpn.getId()); + iallotedtopnfedge.setTo(vpnpinterface.getId()); + edges.add(iallotedtopnfedge); + String toedge = ""; + for (Node node : nodes) { + if (node.getId().equalsIgnoreCase(parentaccessnode)) { + toedge = node.getId(); + break; + } + } + Edge tptopnfedge = new Edge(); + tptopnfedge.setFrom(toedge); + tptopnfedge.setTo(vpnpinterface.getId()); + edges.add(tptopnfedge); + int logicallinkcount = 0; + logicallinkcount = pinterface.getRelationshipList().getRelationship().stream().filter(prelation -> prelation.getRelatedTo() + .equalsIgnoreCase("logical-link")).collect(Collectors.toList()).size(); + if (logicallinkcount > 0) { + tpinterface = pinterface.getRelationshipList().getRelationship().stream().filter(prelation -> prelation.getRelatedTo() + .equalsIgnoreCase("logical-link")).collect(Collectors.toList()); + logicallinkparentid = pinterface.getInterfaceName(); + } + + } catch (Exception e) { + } + } + //Query logical Link : Begin + + Relationship logicallinkrelation = tpinterface.get(0); + String linkname = logicallinkrelation.getRelatedLink().substring(logicallinkrelation.getRelatedLink().lastIndexOf("/") + 1); + try { + logicallink = getSOTNLinkbyName(linkname); + Node logiclink = new Node(); + logiclink.setId(logicallink.getLinkName()); + logiclink.setShape("circularImage"); + logiclink.setImage("./assets/treeTopology/logicallink.png"); + logiclink.setLabel("Logical Link"); + logiclink.setColor("Green"); + ObjectMapper linkmapper = new ObjectMapper(); + Map<String, Object> linkpropprops = linkmapper.convertValue(logicallink, Map.class); + linkpropprops.remove("relationship-list"); + linkpropprops.remove("resource-version"); + linkpropprops.remove("in-maint"); + logiclink.setDataNode(new ObjectMapper().writeValueAsString(linkpropprops)); + nodes.add(logiclink); + Edge tptologicallinkedge = new Edge(); + tptologicallinkedge.setFrom(logicallinkparentid); + tptologicallinkedge.setTo(logiclink.getId()); + edges.add(tptologicallinkedge); + } catch (Exception e) { + } + + List<Relationship> llrelationlist = logicallink.getRelationshipList().getRelationship().stream().filter(llrelation -> llrelation.getRelatedTo() + .equalsIgnoreCase("p-interface")).collect(Collectors.toList()); + + + String externalnode = ""; + for (Relationship llrel : llrelationlist) { + externalnode = ""; + RelationshipData[] llrelatedprop = llrel.getRelationshipData(); + for (RelationshipData temp : llrelatedprop) { + if ("pnf.pnf-name".equalsIgnoreCase(temp.getRelationshipKey())) { + externalnode = temp.getRelationshipValue(); + break; + } + } + if (!dstnodeid.equalsIgnoreCase(externalnode)) { + Pinterface extpinterface = new Pinterface(); + String pinterfaceid = llrel.getRelatedLink().substring(llrel.getRelatedLink().lastIndexOf("/") + 1); + extpinterface = getTerminationPoint(externalnode, pinterfaceid); + Node extpinterfacenode = new Node(); + extpinterfacenode.setId(extpinterface.getInterfaceName()); + extpinterfacenode.setShape("circularImage"); + extpinterfacenode.setImage("./assets/treeTopology/tpoint.png"); + extpinterfacenode.setLabel("Termination Point"); + extpinterfacenode.setColor("Green"); + ObjectMapper vpnpintmapper = new ObjectMapper(); + Map<String, Object> vpnpintprops = vpnpintmapper.convertValue(extpinterface, Map.class); + vpnpintprops.remove("relationship-list"); + vpnpintprops.remove("resource-version"); + vpnpintprops.remove("in-maint"); + extpinterfacenode.setDataNode(new ObjectMapper().writeValueAsString(vpnpintprops)); + nodes.add(extpinterfacenode); + Edge iallotedtopnfedge = new Edge(); + iallotedtopnfedge.setFrom(logicallink.getLinkName()); + iallotedtopnfedge.setTo(extpinterfacenode.getId()); + edges.add(iallotedtopnfedge); + for (Node node : nodes) { + if (node.getId().equalsIgnoreCase(externalnode)) { + ext_tp_found = true; + break; + } + } + + if (!ext_tp_found) { + extpnf = getSOTNPnf(externalnode); + Node extpnfnode = new Node(); + extpnfnode.setId(extpnf.getPnfId()); + extpnfnode.setShape("circularImage"); + extpnfnode.setImage("./assets/treeTopology/accessnode.png"); + extpnfnode.setLabel("External Abstract Node"); + extpnfnode.setColor("Green"); + ObjectMapper linkmapper = new ObjectMapper(); + Map<String, Object> exttpprops = linkmapper.convertValue(extpnf, Map.class); + exttpprops.remove("relationship-list"); + exttpprops.remove("resource-version"); + exttpprops.remove("in-maint"); + exttpprops.remove("admin-status"); + extpnfnode.setDataNode(new ObjectMapper().writeValueAsString(exttpprops)); + nodes.add(extpnfnode); + Edge exttpedge = new Edge(); + exttpedge.setFrom(extpinterface.getInterfaceName()); + exttpedge.setTo(extpnf.getPnfId()); + edges.add(exttpedge); + } + } + } + + + Relationship externalaairel = logicallink.getRelationshipList().getRelationship().stream() + .filter(relate -> "ext-aai-network".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + if (null != externalaairel) { + Node externalaai = new Node(); + externalaai.setId("EXT_AAI"); + externalaai.setShape("circularImage"); + externalaai.setImage("./assets/treeTopology/extaai.png"); + externalaai.setLabel("External AAI"); + externalaai.setColor("Green"); + Map<String, Object> extaaiprops = new HashMap<>(); + String extaainame = externalaairel.getRelatedLink().substring(externalaairel.getRelatedLink().lastIndexOf("/") + 1); + extaaiprops.put("Name", extaainame); + externalaai.setDataNode(new ObjectMapper().writeValueAsString(extaaiprops)); + nodes.add(externalaai); + Edge extaaiedge = new Edge(); + extaaiedge.setFrom(extpnf.getPnfId()); + extaaiedge.setTo(externalaai.getId()); + edges.add(extaaiedge); + } + //Query logical Link : End + } + resourceResponse.setNodes(nodes); + resourceResponse.setEdges(edges); + System.out.println(jsonresponse); + return resourceResponse.toString(); + } + + + @Override + public String getService(String subscriptionType, String instanceid) { + ServiceEstimationBean serviceEstimationBean = new ServiceEstimationBean(); + ServiceInstance serviceInstance = null; + ServiceInstance siteservice = null; + ModelConfig modelConfig = readFile(); + Map<String, Model> modelInfo = readConfigToMap(modelConfig); + String customerId = modelConfig.getSubscriberId(); + Map<String, Object> connectivityparams; + List<String> vpnparams = new ArrayList<String>(Arrays.asList("cir", "eir", "ebs", "ethtSvcName")); + List<Map<String, Object>> sites = new LinkedList<Map<String, Object>>(); + List<Map<String, Object>> vpnmap = new LinkedList<Map<String, Object>>(); + Map<String, Object> vpninformation = new HashMap<String, Object>(); + String jsonresponse = ""; + //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : BEGIN --------------------------------------- + try { + serviceInstance = getServiceInstancesInfo(customerId, subscriptionType, instanceid); + if (serviceInstance == null) + return null; + } catch (Exception e) { +// logger.info("Query Service Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType); + return null; + } + + List<Relationship> relationship = serviceInstance.getRelationshipList().getRelationship().stream().filter(relation -> relation.getRelatedTo().equalsIgnoreCase("allotted-resource")).collect(Collectors.toList()); + if (relationship.size() > 0 && relationship != null) { + // This is SOTN service + connectivityparams = new HashMap<String, Object>(); + relationship = serviceInstance.getRelationshipList().getRelationship(); + for (Relationship relation : relationship) { + String strRelationship = relation.getRelatedTo().toLowerCase(); + switch (strRelationship) { + case "connectivity": + try { + String connectivityinstanceid = relation.getRelatedLink().substring(relation.getRelatedLink().lastIndexOf("/") + 1); + Connectivity connectivity = getConnectivityInfo(connectivityinstanceid); + connectivityparams = new ObjectMapper().readValue(connectivity.toString(), HashMap.class); + + } catch (IOException e) { + //logger.info("IO Exception occured " + e.getMessage()); + } + + break; + //case "allotted-resource": + case "service-instance": + String siteserviceinstanceid = relation.getRelatedLink().substring(relation.getRelatedLink().lastIndexOf("/") + 1); + String cvlan = ""; + Map<String, Object> site; + try { + siteservice = getServiceInstancesInfo(customerId, subscriptionType, siteserviceinstanceid); + if (siteservice == null) { +// logger.info("Query site Service Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType); + return null; + } + } catch (Exception e) { +// logger.info("Query site Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType); + return null; + } + List<Relationship> ssrelationship = siteservice.getRelationshipList().getRelationship().stream() + .filter(siterelation -> siterelation.getRelatedTo().equalsIgnoreCase("site-resource") || + siterelation.getRelatedTo().equalsIgnoreCase("allotted-resource")).collect(Collectors.toList()); + + if (ssrelationship.size() > 0) { + Relationship allotrel = ssrelationship.stream() + .filter(relate -> "allotted-resource".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + String allottedResourceId = allotrel.getRelatedLink().substring(allotrel.getRelatedLink().lastIndexOf("/") + 1); + try { + AllottedResource allottedResource = getAllottedResource(customerId, subscriptionType, siteserviceinstanceid, allottedResourceId); + cvlan = allottedResource.getCvlan(); + } catch (Exception e) { + } + + Relationship siterel = ssrelationship.stream() + .filter(relate -> "site-resource".equalsIgnoreCase(relate.getRelatedTo())) + .findAny() + .orElse(null); + String siteResourceID = siterel.getRelatedLink().substring(siterel.getRelatedLink().lastIndexOf("/") + 1); + try { + SiteResource resource = getSiteResource(siteResourceID); + site = new HashMap<String, Object>(); + site.put("siteId", resource.getSiteResourceId()); + site.put("siteName", resource.getSiteResourceName()); + site.put("description", resource.getDescription()); + site.put("role", "dsvpn-hub"); + site.put("cvlan", cvlan); + List<Relationship> complexRelationship = resource.getRelationshipList().getRelationship() + .stream().filter(rel -> rel.getRelatedTo().equalsIgnoreCase("complex")) + .collect(Collectors.toList()); + for (Relationship complexrelation : complexRelationship) { + String complexID = complexrelation.getRelatedLink().substring(complexrelation.getRelatedLink().lastIndexOf("/") + 1); + ComplexObj complex = getComplexData(complexID); //getSiteResourceInfo + site.put("address", complex.getCity()); + site.put("location", complex.getCity()); + site.put("zipCode", complex.getPostalCode()); + } +// Map<String, String> attr = new HashMap<String, String>(); +// attr.put("cvlan",cvlan); +// attr.put("accessnodeid",connectivityparams.get("accessNodeId").toString()); +// attr.put("accessltpid",connectivityparams.get("accessLtpId").toString()); +// site.put("attribute", attr); + sites.add(site); + } catch (Exception e) { + // logger.info("Query Service Instance information failed. No service information found for customer " + // + customerId + " and Service Type " + subscriptionType); + return null; + } + } else { + String requestinput = siteservice.getInputparameters(); + E2EServiceInstanceRequest e2eserviceRequest = new E2EServiceInstanceRequest(); + ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + try { + e2eserviceRequest = mapper.readValue(requestinput.toString(), new TypeReference<E2EServiceInstanceRequest>() { + }); + } catch (IOException e) { + // logger.info("Query remove Service Instance information failed" + e.getMessage()); + } + + HashMap<String, ?> requestInputs = e2eserviceRequest.getService().getParameters().getRequestInputs(); + site = new HashMap<String, Object>(); + //Map<String, Object> attr = new HashMap<String, Object>(); + for (Map.Entry<String, ?> e : requestInputs.entrySet()) { + if (e.getKey().contains("name")) { + site.put("siteName", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("description")) { + site.put("description", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("role")) { + site.put("role", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("address")) { + site.put("location", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("postcode")) { + site.put("zipCode", (String) requestInputs.get(e.getKey())); + + } else if (e.getKey().contains("cVLAN")) { + site.put("cvlan", (String) requestInputs.get(e.getKey())); + + } + } + //site.put("attribute", attr); + sites.add(site); + } + + +// //------------------------------------------------------------- Old logic begin -------------- +// try +// { +// String allottedResourceId = relation.getRelatedLink().substring(relation.getRelatedLink().lastIndexOf("/") + 1); +// String siteserviceintanceid = ""; +// List<RelationshipDatum> relationshipDataum = relation.getRelationshipData(); +// for(RelationshipDatum datum : relationshipDataum) +// { +// if(datum.getRelationshipKey().equalsIgnoreCase("service-instance.service-instance-id")){ +// siteserviceintanceid=datum.getRelationshipValue(); +// break; +// } +// } +// AllottedResource allottedResource = getAllottedResource(customerId,subscriptionType,siteserviceintanceid, allottedResourceId); +// List<Relationship> allottedRelationship = allottedResource.getRelationshipList().getRelationship(); +// for(Relationship allrelation : allottedRelationship) +// { +// String strAllRelationship = allrelation.getRelatedTo().toLowerCase(); +// if("service-instance".equalsIgnoreCase(strAllRelationship)) +// { +// String allottedServiceId = allrelation.getRelatedLink().substring(allrelation.getRelatedLink().lastIndexOf("/") + 1); +// if(!allottedServiceId.equalsIgnoreCase(instanceid)) +// { +// try { +// ServiceInstance allottedserviceInstance = getServiceInstancesInfo(customerId, subscriptionType, allottedServiceId); +// if (serviceInstance != null) +// { +// List<Relationship> siteRelationship = allottedserviceInstance.getRelationshipList() +// .getRelationship().stream().filter(siterelation -> siterelation.getRelatedTo() +// .equalsIgnoreCase("site-resource")).collect(Collectors.toList()); +// for(Relationship siterelation : siteRelationship) { +// String siteResourceID = siterelation.getRelatedLink().substring(siterelation.getRelatedLink().lastIndexOf("/") + 1); +// SiteResource resource = getSiteResource(siteResourceID); //getSiteResourceInfo +// Map<String, String> site = new HashMap<String, String>(); +// site.put("siteId",resource.getSiteResourceId()); +// site.put("siteName",resource.getSiteResourceName()); +// site.put("description",resource.getDescription()); +// +// List<Relationship> complexRelationship = resource.getRelationshipList().getRelationship(); +// for(Relationship complexrelation : siteRelationship) { +// String complexID = complexrelation.getRelatedLink().substring(complexrelation.getRelatedLink().lastIndexOf("/") + 1); +// ComplexObj complex = getComplexData(complexID); //getSiteResourceInfo +// site.put("address",complex.getCity()); +// site.put("zipCode",complex.getPostalCode()); +// } +// sites.add(site); +// } +// +// } +// +// } catch (Exception e) { +// logger.info("Query Service Instance information failed. No service information found for customer " +// + customerId + " and Service Type " + subscriptionType + "and Service Instance ID "+instanceid); +// } +// } +// } +// } +// connectivityparams = new ObjectMapper().readValue(allottedResource.toString(), HashMap.class); +// }catch (IOException e) +// { +// +// } +// +// //-------------------------------------------------------- old logic end here.-------------------------------------------- + + break; + default: + break; + + } + } + + //create response bean + //connectivityparams.remove() + Map<String, Object> response = new HashMap<String, Object>(); + for (String key : vpnparams) { + if (key.equalsIgnoreCase("ebs")) + response.put("Service Type", connectivityparams.get(key)); + else if (key.equalsIgnoreCase("ethtSvcName")) + response.put("Service Name", connectivityparams.get(key)); + else + response.put(key, connectivityparams.get(key)); + } + vpninformation.put("vpnName", connectivityparams.get("ethtSvcName")); + vpninformation.put("vpnId", connectivityparams.get("connectivityId")); + vpninformation.put("vpnType", "Hub-Spoke"); + vpninformation.put("vpnBandwidth", connectivityparams.get("cbs")); + vpninformation.put("vpnThreshold", connectivityparams.get("eir")); + vpninformation.put("sites", sites); + vpnmap.add(vpninformation); + response.put("vpnInformations", vpnmap); + + try { + + jsonresponse = new ObjectMapper().writeValueAsString(response); + System.out.println(jsonresponse); + } catch (IOException e) { + + } + + } else { + //This is DWAN service + } + + //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : END ----------------------------------------- + return jsonresponse; + } + +} |