summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/SdncConfiguration.java21
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/exception/AuditError.java26
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/exception/AuditException.java7
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/GenericResourceApiHandler.java6
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java109
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/AvailabilityZone.java89
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/NetworkIp.java89
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/NetworkIpV6.java89
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/OperStatus.java125
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelatedToProperty.java92
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/Relationship.java122
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelationshipDatum.java92
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelationshipList.java82
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RequestInformation.java125
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/SdncRequestHeader.java125
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceData.java197
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceEntity.java9
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceInformation.java143
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceInstance.java212
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceStatus.java197
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VfModule.java211
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VfModules.java82
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmName.java89
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java181
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/Vnf.java126
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfAssignments.java127
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfInstance.java438
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfList.java110
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfNetwork.java161
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfParameter.java107
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfRequestInformation.java233
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfTopologyIdentifier.java161
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfTopologyInformation.java127
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java146
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringService.java3
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringServiceImpl.java69
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestService.java33
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestServiceImpl.java19
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java334
39 files changed, 4621 insertions, 93 deletions
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/SdncConfiguration.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/SdncConfiguration.java
index 71c3502..7180c0b 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/SdncConfiguration.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/SdncConfiguration.java
@@ -21,10 +21,10 @@ package org.onap.pomba.contextbuilder.sdnc;
import java.util.Base64;
import javax.ws.rs.ApplicationPath;
import org.eclipse.jetty.util.security.Password;
+import org.onap.aai.restclient.client.RestClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
-import org.onap.aai.restclient.client.RestClient;
@Component
@ApplicationPath("/")
@@ -54,16 +54,24 @@ public class SdncConfiguration {
@Value("${sdnc.genericResourcePath}")
private String genericResourcePath;
+ @Value("${sdnc.vnfPath}")
+ private String vnfPath;
+
@Bean(name="sdncBaseUrl")
public String getURL() {
return httpProtocol + "://" + serviceName + ":" + servicePort;
}
@Bean(name="sdncGenericResourcePath")
- public String getgenericResourcePath() {
+ public String getGenericResourcePath() {
return genericResourcePath;
}
+ @Bean(name="sdncVnfPath")
+ public String getVnfPath() {
+ return vnfPath;
+ }
+
@Bean(name = "sdncBasicAuthorization")
public String getSdncBasicAuth() {
String auth = this.user + ":"+ Password.deobfuscate(this.password);
@@ -98,6 +106,10 @@ public class SdncConfiguration {
@Value("${aai.customerQuery}")
private String aaiCustomerQuery;
+ @Value("${aai.serviceInstancePath}")
+ private String serviceInstancePath;
+
+
@Bean(name="aaiHttpBasicAuthorization")
public String getHttpBasicAuth() {
String auth = new String(this.aaiHttpUserId + ":" + Password.deobfuscate(this.aaiHttpPassword));
@@ -138,4 +150,9 @@ public class SdncConfiguration {
return aaiCustomerQuery.trim();
}
+ @Bean(name="aaiServiceInstancePath")
+ public String getserviceInstancePathL() {
+ return serviceInstancePath;
+ }
+
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/exception/AuditError.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/exception/AuditError.java
new file mode 100644
index 0000000..f4caafe
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/exception/AuditError.java
@@ -0,0 +1,26 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.exception;
+
+public class AuditError {
+
+ public static final String INTERNAL_SERVER_ERROR = "Internal Server Error";
+ public static final String JSON_PARSE_ERROR = "Json Parse Error ";
+ public static final String JSON_EMPTY_RESPONSE = "Json Empty Response ";
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/exception/AuditException.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/exception/AuditException.java
index 63137a1..9c7348f 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/exception/AuditException.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/exception/AuditException.java
@@ -26,7 +26,6 @@ public class AuditException extends Exception {
private Status httpStatus;
-
public AuditException(String message) {
super(message);
}
@@ -36,6 +35,10 @@ public class AuditException extends Exception {
this.setHttpStatus(httpStatus);
}
+ public AuditException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
public Status getHttpStatus() {
return httpStatus;
}
@@ -43,4 +46,6 @@ public class AuditException extends Exception {
public void setHttpStatus(Status httpStatus) {
this.httpStatus = httpStatus;
}
+
+
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/GenericResourceApiHandler.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/GenericResourceApiHandler.java
index 885c923..09e1d6b 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/GenericResourceApiHandler.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/GenericResourceApiHandler.java
@@ -43,11 +43,11 @@ public class GenericResourceApiHandler {
@Autowired
private String sdncGenericResourcePath;
-
+ private String specPath = "config/sdncgenericresource.spec";
public ModelContext process(Exchange exchange) throws Exception {
- ModelContext context;
+ ModelContext context = new ModelContext();
log.info("in GENERIC-RESOURCE-API HANDLER: ");
ServiceEntity serviceEntity = (ServiceEntity)exchange.getIn().getBody();
@@ -55,7 +55,7 @@ public class GenericResourceApiHandler {
try {
String sdncResponse = RestUtil.getSdncGenericResource(jerseyClient, sdncBaseUrl, sdncBasicAuthorization, sdncGenericResourcePath, serviceInstanceId);
- context = RestUtil.transform(sdncResponse);
+ context = RestUtil.transformGenericResource(sdncResponse, specPath);
} catch (AuditException ae) {
throw ae;
} catch (Exception e) {
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java
index bfedf69..bdc08d0 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java
@@ -18,35 +18,134 @@
package org.onap.pomba.contextbuilder.sdnc.handlers;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.core.MediaType;
import org.apache.camel.Exchange;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.onap.aai.restclient.client.RestClient;
import org.onap.pomba.common.datatypes.ModelContext;
import org.onap.pomba.common.datatypes.Service;
+import org.onap.pomba.contextbuilder.sdnc.exception.AuditError;
+import org.onap.pomba.contextbuilder.sdnc.exception.AuditException;
import org.onap.pomba.contextbuilder.sdnc.model.ServiceEntity;
+import org.onap.pomba.contextbuilder.sdnc.model.Vnf;
+import org.onap.pomba.contextbuilder.sdnc.model.VnfInstance;
+import org.onap.pomba.contextbuilder.sdnc.util.RestUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class VnfApiHandler {
private static Logger log = LoggerFactory.getLogger(VnfApiHandler.class);
+ @Autowired
+ private String aaiBasicAuthorization;
+ @Autowired
+ private RestClient aaiClient;
+ @Autowired
+ private String aaiBaseUrl;
+ @Autowired
+ private String aaiServiceInstancePath;
+ @Autowired
+ private Client jerseyClient;
+ @Autowired
+ private String sdncBaseUrl;
+ @Autowired
+ private String sdncBasicAuthorization;
+ @Autowired
+ private String sdncVnfPath;
+
+ private static final String JSON_RELATIONSHIP_LIST = "relationship-list";
+ private static final String JSON_RELATIONSHIP = "relationship";
+ private static final String JSON_RELATED_TO = "related-to";
+ private static final String JSON_RELATED_LINK = "related-link";
+ private static final String JSON_GENERIC_VNF = "generic-vnf";
+ private static final String EMPTY_JSON_STRING = "{}";
public ModelContext process(Exchange exchange) throws Exception {
log.info("in VNF-API HANDLER: ");
-
-// dummy population of the model context
-// The following lines should be replaced with the logic of calling to SDN-C VNF-API
-// and transforming the response into common model
ModelContext context = new ModelContext();
Service service = new Service();
ServiceEntity serviceEntity = (ServiceEntity)exchange.getIn().getBody();
+ service.setUuid(serviceEntity.getServiceInstanceId());
service.setName( serviceEntity.getServiceType() + " service instance");
+
+ // GET the list of VNF related-to links from AAI
+ String url= aaiBaseUrl+generateServiceInstanceURL(aaiServiceInstancePath, serviceEntity.getCustomerId(), serviceEntity.getServiceType(), serviceEntity.getServiceInstanceId());
+ String serviceInstancePayload = RestUtil.getAaiResource(aaiClient, url, aaiBasicAuthorization, serviceEntity.getTransactionId(), MediaType.valueOf(MediaType.APPLICATION_JSON));
+ List<String> genericVnfLinks = extractGenericVnfRelatedLink(serviceInstancePayload);
+
+ // GET the VNF list (module-id) from AAI
+ List <VnfInstance> vnfList = retrieveAaiVnfList(aaiClient, aaiBaseUrl, aaiBasicAuthorization, serviceEntity.getTransactionId(), genericVnfLinks);
+
+
+ // GET the module-id from SDNC using VNF-API
+ Map<String,List<Vnf>> sdncVnfMap = RestUtil.getSdncVnfList(jerseyClient, sdncBaseUrl, sdncVnfPath,
+ sdncBasicAuthorization, vnfList);
+
+ // Transform the AAI and SDNC models to the audit common model
+ context = RestUtil.transformVnfList(vnfList, sdncVnfMap);
+
context.setService(service);
-// end dummy code
return context;
}
+ private static String generateServiceInstanceURL(String siPath, String customerId, String serviceType, String serviceInstanceId) {
+ return MessageFormat.format(siPath, customerId, serviceType, serviceInstanceId);
+ }
+
+ /*
+ * Extract the generic-vnf related-linkfrom Json payload. For example
+ * {
+ * "related-to": "generic-vnf",
+ * "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/d94daff6-7d5b-4d2e-bc99-c9af0754b59d",
+ * }
+ */
+ private static List<String> extractGenericVnfRelatedLink(String serviceInstancePayload) throws AuditException {
+ List<String> genericVnfLinks = new ArrayList<String>();;
+ try {
+ JSONObject relationshipList = new JSONObject(serviceInstancePayload).getJSONObject(JSON_RELATIONSHIP_LIST);
+ JSONArray relationship = relationshipList.getJSONArray(JSON_RELATIONSHIP);
+ if (relationship != null) {
+ for (int i = 0; i < relationship.length(); i++) {
+ JSONObject relationshipInstance = relationship.optJSONObject(i);
+ if (relationshipInstance.has(JSON_RELATED_TO) && (relationshipInstance.getString(JSON_RELATED_TO).equals(JSON_GENERIC_VNF))) {
+ genericVnfLinks.add(relationshipInstance.getString(JSON_RELATED_LINK));
+ }
+ }
+ }
+ } catch (JSONException e) {
+ log.error(e.getMessage());
+ throw new AuditException(AuditError.JSON_PARSE_ERROR + e.getMessage());
+ }
+ return genericVnfLinks;
+ }
+
+ private static List<VnfInstance> retrieveAaiVnfList(RestClient aaiClient, String aaiBaseUrl, String aaiBasicAuthorization, String transactionId, List <String>genericVnfLinks) throws AuditException {
+ List<VnfInstance> vnfList = new ArrayList<VnfInstance>();
+ for (String genericVnfLink : genericVnfLinks) {
+ String genericVnfUrl = RestUtil.generateAaiUrl(aaiBaseUrl, genericVnfLink, null);
+ String genericVnfPayload = RestUtil.getAaiResource(aaiClient, genericVnfUrl, aaiBasicAuthorization, transactionId, MediaType.valueOf(MediaType.APPLICATION_JSON));
+ if (genericVnfPayload.equals(EMPTY_JSON_STRING)) {
+ log.info("retrieveAaiVnfList "+ genericVnfPayload +" is not found, " + "return empty Json ");
+ } else {
+ // Create the AAI VnfInstance from the AAI generic-vnf json
+ VnfInstance vnfInstance = VnfInstance.fromJson(genericVnfPayload);
+ vnfList.add(vnfInstance);
+ }
+ }
+ log.debug("The size of vnfList:"+ vnfList.size());
+ return vnfList;
+ }
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/AvailabilityZone.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/AvailabilityZone.java
new file mode 100644
index 0000000..6cd70e6
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/AvailabilityZone.java
@@ -0,0 +1,89 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class AvailabilityZone {
+
+ @SerializedName("availability-zone")
+ @Expose
+ private String availabilityZone;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public AvailabilityZone() {
+ }
+
+ /**
+ *
+ * @param availabilityZone
+ */
+ public AvailabilityZone(String availabilityZone) {
+ super();
+ this.availabilityZone = availabilityZone;
+ }
+
+ public String getAvailabilityZone() {
+ return availabilityZone;
+ }
+
+ public void setAvailabilityZone(String availabilityZone) {
+ this.availabilityZone = availabilityZone;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(AvailabilityZone.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("availabilityZone");
+ sb.append('=');
+ sb.append(((this.availabilityZone == null)?"<null>":this.availabilityZone));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.availabilityZone == null)? 0 :this.availabilityZone.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof AvailabilityZone) == false) {
+ return false;
+ }
+ AvailabilityZone rhs = ((AvailabilityZone) other);
+ return ((this.availabilityZone == rhs.availabilityZone)||((this.availabilityZone!= null)&&this.availabilityZone.equals(rhs.availabilityZone)));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/NetworkIp.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/NetworkIp.java
new file mode 100644
index 0000000..dca49f6
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/NetworkIp.java
@@ -0,0 +1,89 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class NetworkIp {
+
+ @SerializedName("ip-address")
+ @Expose
+ private String ipAddress;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public NetworkIp() {
+ }
+
+ /**
+ *
+ * @param ipAddress
+ */
+ public NetworkIp(String ipAddress) {
+ super();
+ this.ipAddress = ipAddress;
+ }
+
+ public String getIpAddress() {
+ return ipAddress;
+ }
+
+ public void setIpAddress(String ipAddress) {
+ this.ipAddress = ipAddress;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(NetworkIp.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("ipAddress");
+ sb.append('=');
+ sb.append(((this.ipAddress == null)?"<null>":this.ipAddress));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.ipAddress == null)? 0 :this.ipAddress.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof NetworkIp) == false) {
+ return false;
+ }
+ NetworkIp rhs = ((NetworkIp) other);
+ return ((this.ipAddress == rhs.ipAddress)||((this.ipAddress!= null)&&this.ipAddress.equals(rhs.ipAddress)));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/NetworkIpV6.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/NetworkIpV6.java
new file mode 100644
index 0000000..bb0245a
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/NetworkIpV6.java
@@ -0,0 +1,89 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class NetworkIpV6 {
+
+ @SerializedName("ip-address-ipv6")
+ @Expose
+ private String ipAddressIpV6;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public NetworkIpV6() {
+ }
+
+ /**
+ *
+ * @param ipAddressIpV6
+ */
+ public NetworkIpV6(String ipAddressIpV6) {
+ super();
+ this.ipAddressIpV6 = ipAddressIpV6;
+ }
+
+ public String getIpAddressIpV6() {
+ return ipAddressIpV6;
+ }
+
+ public void setIpAddressIpV6(String ipAddressIpV6) {
+ this.ipAddressIpV6 = ipAddressIpV6;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(NetworkIpV6 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("ipAddressIpV6");
+ sb.append('=');
+ sb.append(((this.ipAddressIpV6 == null)?"<null>":this.ipAddressIpV6));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.ipAddressIpV6 == null)? 0 :this.ipAddressIpV6 .hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof NetworkIpV6) == false) {
+ return false;
+ }
+ NetworkIpV6 rhs = ((NetworkIpV6) other);
+ return ((this.ipAddressIpV6 == rhs.ipAddressIpV6)||((this.ipAddressIpV6 != null)&&this.ipAddressIpV6 .equals(rhs.ipAddressIpV6)));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/OperStatus.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/OperStatus.java
new file mode 100644
index 0000000..127b521
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/OperStatus.java
@@ -0,0 +1,125 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class OperStatus {
+
+ @SerializedName("last-action")
+ @Expose
+ private String lastAction;
+ @SerializedName("order-status")
+ @Expose
+ private String orderStatus;
+ @SerializedName("last-order-status")
+ @Expose
+ private String lastOrderStatus;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public OperStatus() {
+ }
+
+ /**
+ *
+ * @param orderStatus
+ * @param lastAction
+ * @param lastOrderStatus
+ */
+ public OperStatus(String lastAction, String orderStatus, String lastOrderStatus) {
+ super();
+ this.lastAction = lastAction;
+ this.orderStatus = orderStatus;
+ this.lastOrderStatus = lastOrderStatus;
+ }
+
+ public String getLastAction() {
+ return lastAction;
+ }
+
+ public void setLastAction(String lastAction) {
+ this.lastAction = lastAction;
+ }
+
+ public String getOrderStatus() {
+ return orderStatus;
+ }
+
+ public void setOrderStatus(String orderStatus) {
+ this.orderStatus = orderStatus;
+ }
+
+ public String getLastOrderStatus() {
+ return lastOrderStatus;
+ }
+
+ public void setLastOrderStatus(String lastOrderStatus) {
+ this.lastOrderStatus = lastOrderStatus;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(OperStatus.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("lastAction");
+ sb.append('=');
+ sb.append(((this.lastAction == null)?"<null>":this.lastAction));
+ sb.append(',');
+ sb.append("orderStatus");
+ sb.append('=');
+ sb.append(((this.orderStatus == null)?"<null>":this.orderStatus));
+ sb.append(',');
+ sb.append("lastOrderStatus");
+ sb.append('=');
+ sb.append(((this.lastOrderStatus == null)?"<null>":this.lastOrderStatus));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.orderStatus == null)? 0 :this.orderStatus.hashCode()));
+ result = ((result* 31)+((this.lastAction == null)? 0 :this.lastAction.hashCode()));
+ result = ((result* 31)+((this.lastOrderStatus == null)? 0 :this.lastOrderStatus.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof OperStatus) == false) {
+ return false;
+ }
+ OperStatus rhs = ((OperStatus) other);
+ return ((((this.orderStatus == rhs.orderStatus)||((this.orderStatus!= null)&&this.orderStatus.equals(rhs.orderStatus)))&&((this.lastAction == rhs.lastAction)||((this.lastAction!= null)&&this.lastAction.equals(rhs.lastAction))))&&((this.lastOrderStatus == rhs.lastOrderStatus)||((this.lastOrderStatus!= null)&&this.lastOrderStatus.equals(rhs.lastOrderStatus))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelatedToProperty.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelatedToProperty.java
new file mode 100644
index 0000000..f64d2a3
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelatedToProperty.java
@@ -0,0 +1,92 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+public class RelatedToProperty {
+
+ @SerializedName("property-key")
+ @Expose
+ private String propertyKey;
+ @SerializedName("property-value")
+ @Expose
+ private String propertyValue;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public RelatedToProperty() {
+ }
+
+ /**
+ *
+ * @param propertyKey
+ * @param propertyValue
+ */
+ public RelatedToProperty(String propertyKey, String propertyValue) {
+ super();
+ this.propertyKey = propertyKey;
+ this.propertyValue = propertyValue;
+ }
+
+ public String getPropertyKey() {
+ return propertyKey;
+ }
+
+ public void setPropertyKey(String propertyKey) {
+ this.propertyKey = propertyKey;
+ }
+
+ public String getPropertyValue() {
+ return propertyValue;
+ }
+
+ public void setPropertyValue(String propertyValue) {
+ this.propertyValue = propertyValue;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("propertyKey", propertyKey).append("propertyValue", propertyValue).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(propertyKey).append(propertyValue).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof RelatedToProperty) == false) {
+ return false;
+ }
+ RelatedToProperty rhs = ((RelatedToProperty) other);
+ return new EqualsBuilder().append(propertyKey, rhs.propertyKey).append(propertyValue, rhs.propertyValue).isEquals();
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/Relationship.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/Relationship.java
new file mode 100644
index 0000000..74637b5
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/Relationship.java
@@ -0,0 +1,122 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import java.util.List;
+import javax.validation.Valid;
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+public class Relationship {
+
+ @SerializedName("related-to")
+ @Expose
+ private String relatedTo;
+ @SerializedName("related-link")
+ @Expose
+ private String relatedLink;
+ @SerializedName("relationship-data")
+ @Expose
+ @Valid
+ private List<RelationshipDatum> relationshipData = null;
+ @SerializedName("related-to-property")
+ @Expose
+ @Valid
+ private List<RelatedToProperty> relatedToProperty = null;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public Relationship() {
+ }
+
+ /**
+ *
+ * @param relatedToProperty
+ * @param relatedLink
+ * @param relationshipData
+ * @param relatedTo
+ */
+ public Relationship(String relatedTo, String relatedLink, List<RelationshipDatum> relationshipData, List<RelatedToProperty> relatedToProperty) {
+ super();
+ this.relatedTo = relatedTo;
+ this.relatedLink = relatedLink;
+ this.relationshipData = relationshipData;
+ this.relatedToProperty = relatedToProperty;
+ }
+
+ public String getRelatedTo() {
+ return relatedTo;
+ }
+
+ public void setRelatedTo(String relatedTo) {
+ this.relatedTo = relatedTo;
+ }
+
+ public String getRelatedLink() {
+ return relatedLink;
+ }
+
+ public void setRelatedLink(String relatedLink) {
+ this.relatedLink = relatedLink;
+ }
+
+ public List<RelationshipDatum> getRelationshipData() {
+ return relationshipData;
+ }
+
+ public void setRelationshipData(List<RelationshipDatum> relationshipData) {
+ this.relationshipData = relationshipData;
+ }
+
+ public List<RelatedToProperty> getRelatedToProperty() {
+ return relatedToProperty;
+ }
+
+ public void setRelatedToProperty(List<RelatedToProperty> relatedToProperty) {
+ this.relatedToProperty = relatedToProperty;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("relatedTo", relatedTo).append("relatedLink", relatedLink).append("relationshipData", relationshipData).append("relatedToProperty", relatedToProperty).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(relatedToProperty).append(relatedLink).append(relationshipData).append(relatedTo).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof Relationship) == false) {
+ return false;
+ }
+ Relationship rhs = ((Relationship) other);
+ return new EqualsBuilder().append(relatedToProperty, rhs.relatedToProperty).append(relatedLink, rhs.relatedLink).append(relationshipData, rhs.relationshipData).append(relatedTo, rhs.relatedTo).isEquals();
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelationshipDatum.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelationshipDatum.java
new file mode 100644
index 0000000..5a0756d
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelationshipDatum.java
@@ -0,0 +1,92 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+public class RelationshipDatum {
+
+ @SerializedName("relationship-key")
+ @Expose
+ private String relationshipKey;
+ @SerializedName("relationship-value")
+ @Expose
+ private String relationshipValue;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public RelationshipDatum() {
+ }
+
+ /**
+ *
+ * @param relationshipValue
+ * @param relationshipKey
+ */
+ public RelationshipDatum(String relationshipKey, String relationshipValue) {
+ super();
+ this.relationshipKey = relationshipKey;
+ this.relationshipValue = relationshipValue;
+ }
+
+ public String getRelationshipKey() {
+ return relationshipKey;
+ }
+
+ public void setRelationshipKey(String relationshipKey) {
+ this.relationshipKey = relationshipKey;
+ }
+
+ public String getRelationshipValue() {
+ return relationshipValue;
+ }
+
+ public void setRelationshipValue(String relationshipValue) {
+ this.relationshipValue = relationshipValue;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("relationshipKey", relationshipKey).append("relationshipValue", relationshipValue).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(relationshipValue).append(relationshipKey).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof RelationshipDatum) == false) {
+ return false;
+ }
+ RelationshipDatum rhs = ((RelationshipDatum) other);
+ return new EqualsBuilder().append(relationshipValue, rhs.relationshipValue).append(relationshipKey, rhs.relationshipKey).isEquals();
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelationshipList.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelationshipList.java
new file mode 100644
index 0000000..a57e02c
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RelationshipList.java
@@ -0,0 +1,82 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import java.util.List;
+import javax.validation.Valid;
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+public class RelationshipList {
+
+ @SerializedName("relationship")
+ @Expose
+ @Valid
+ private List<Relationship> relationship = null;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public RelationshipList() {
+ }
+
+ /**
+ *
+ * @param relationship
+ */
+ public RelationshipList(List<Relationship> relationship) {
+ super();
+ this.relationship = relationship;
+ }
+
+ public List<Relationship> getRelationship() {
+ return relationship;
+ }
+
+ public void setRelationship(List<Relationship> relationship) {
+ this.relationship = relationship;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("relationship", relationship).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(relationship).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof RelationshipList) == false) {
+ return false;
+ }
+ RelationshipList rhs = ((RelationshipList) other);
+ return new EqualsBuilder().append(relationship, rhs.relationship).isEquals();
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RequestInformation.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RequestInformation.java
new file mode 100644
index 0000000..f556845
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/RequestInformation.java
@@ -0,0 +1,125 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class RequestInformation {
+
+ @SerializedName("request-id")
+ @Expose
+ private String requestId;
+ @SerializedName("source")
+ @Expose
+ private String source;
+ @SerializedName("request-action")
+ @Expose
+ private String requestAction;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public RequestInformation() {
+ }
+
+ /**
+ *
+ * @param requestAction
+ * @param source
+ * @param requestId
+ */
+ public RequestInformation(String requestId, String source, String requestAction) {
+ super();
+ this.requestId = requestId;
+ this.source = source;
+ this.requestAction = requestAction;
+ }
+
+ public String getRequestId() {
+ return requestId;
+ }
+
+ public void setRequestId(String requestId) {
+ this.requestId = requestId;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public String getRequestAction() {
+ return requestAction;
+ }
+
+ public void setRequestAction(String requestAction) {
+ this.requestAction = requestAction;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(RequestInformation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("requestId");
+ sb.append('=');
+ sb.append(((this.requestId == null)?"<null>":this.requestId));
+ sb.append(',');
+ sb.append("source");
+ sb.append('=');
+ sb.append(((this.source == null)?"<null>":this.source));
+ sb.append(',');
+ sb.append("requestAction");
+ sb.append('=');
+ sb.append(((this.requestAction == null)?"<null>":this.requestAction));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.requestAction == null)? 0 :this.requestAction.hashCode()));
+ result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode()));
+ result = ((result* 31)+((this.requestId == null)? 0 :this.requestId.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof RequestInformation) == false) {
+ return false;
+ }
+ RequestInformation rhs = ((RequestInformation) other);
+ return ((((this.requestAction == rhs.requestAction)||((this.requestAction!= null)&&this.requestAction.equals(rhs.requestAction)))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.requestId == rhs.requestId)||((this.requestId!= null)&&this.requestId.equals(rhs.requestId))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/SdncRequestHeader.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/SdncRequestHeader.java
new file mode 100644
index 0000000..b483da4
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/SdncRequestHeader.java
@@ -0,0 +1,125 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class SdncRequestHeader {
+
+ @SerializedName("svc-notification-url")
+ @Expose
+ private String svcNotificationUrl;
+ @SerializedName("svc-request-id")
+ @Expose
+ private String svcRequestId;
+ @SerializedName("svc-action")
+ @Expose
+ private String svcAction;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public SdncRequestHeader() {
+ }
+
+ /**
+ *
+ * @param svcRequestId
+ * @param svcNotificationUrl
+ * @param svcAction
+ */
+ public SdncRequestHeader(String svcNotificationUrl, String svcRequestId, String svcAction) {
+ super();
+ this.svcNotificationUrl = svcNotificationUrl;
+ this.svcRequestId = svcRequestId;
+ this.svcAction = svcAction;
+ }
+
+ public String getSvcNotificationUrl() {
+ return svcNotificationUrl;
+ }
+
+ public void setSvcNotificationUrl(String svcNotificationUrl) {
+ this.svcNotificationUrl = svcNotificationUrl;
+ }
+
+ public String getSvcRequestId() {
+ return svcRequestId;
+ }
+
+ public void setSvcRequestId(String svcRequestId) {
+ this.svcRequestId = svcRequestId;
+ }
+
+ public String getSvcAction() {
+ return svcAction;
+ }
+
+ public void setSvcAction(String svcAction) {
+ this.svcAction = svcAction;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(SdncRequestHeader.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("svcNotificationUrl");
+ sb.append('=');
+ sb.append(((this.svcNotificationUrl == null)?"<null>":this.svcNotificationUrl));
+ sb.append(',');
+ sb.append("svcRequestId");
+ sb.append('=');
+ sb.append(((this.svcRequestId == null)?"<null>":this.svcRequestId));
+ sb.append(',');
+ sb.append("svcAction");
+ sb.append('=');
+ sb.append(((this.svcAction == null)?"<null>":this.svcAction));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.svcNotificationUrl == null)? 0 :this.svcNotificationUrl.hashCode()));
+ result = ((result* 31)+((this.svcAction == null)? 0 :this.svcAction.hashCode()));
+ result = ((result* 31)+((this.svcRequestId == null)? 0 :this.svcRequestId.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof SdncRequestHeader) == false) {
+ return false;
+ }
+ SdncRequestHeader rhs = ((SdncRequestHeader) other);
+ return ((((this.svcNotificationUrl == rhs.svcNotificationUrl)||((this.svcNotificationUrl!= null)&&this.svcNotificationUrl.equals(rhs.svcNotificationUrl)))&&((this.svcAction == rhs.svcAction)||((this.svcAction!= null)&&this.svcAction.equals(rhs.svcAction))))&&((this.svcRequestId == rhs.svcRequestId)||((this.svcRequestId!= null)&&this.svcRequestId.equals(rhs.svcRequestId))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceData.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceData.java
new file mode 100644
index 0000000..0f745fc
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceData.java
@@ -0,0 +1,197 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class ServiceData {
+
+ @SerializedName("request-information")
+ @Expose
+ private RequestInformation requestInformation;
+ @SerializedName("service-information")
+ @Expose
+ private ServiceInformation serviceInformation;
+ @SerializedName("vnf-id")
+ @Expose
+ private String vnfId;
+ @SerializedName("sdnc-request-header")
+ @Expose
+ private SdncRequestHeader sdncRequestHeader;
+ @SerializedName("vnf-request-information")
+ @Expose
+ private VnfRequestInformation vnfRequestInformation;
+ @SerializedName("oper-status")
+ @Expose
+ private OperStatus operStatus;
+ @SerializedName("vnf-topology-information")
+ @Expose
+ private VnfTopologyInformation vnfTopologyInformation;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public ServiceData() {
+ }
+
+ /**
+ *
+ * @param vnfRequestInformation
+ * @param vnfTopologyInformation
+ * @param erviceInformation
+ * @param sdncRequestHeader
+ * @param vnfId
+ * @param requestInformation
+ * @param operStatus
+ */
+ public ServiceData(RequestInformation requestInformation, ServiceInformation serviceInformation, String vnfId, SdncRequestHeader sdncRequestHeader, VnfRequestInformation vnfRequestInformation, OperStatus operStatus, VnfTopologyInformation vnfTopologyInformation) {
+ super();
+ this.requestInformation = requestInformation;
+ this.serviceInformation = serviceInformation;
+ this.vnfId = vnfId;
+ this.sdncRequestHeader = sdncRequestHeader;
+ this.vnfRequestInformation = vnfRequestInformation;
+ this.operStatus = operStatus;
+ this.vnfTopologyInformation = vnfTopologyInformation;
+ }
+
+ public RequestInformation getRequestInformation() {
+ return requestInformation;
+ }
+
+ public void setRequestInformation(RequestInformation requestInformation) {
+ this.requestInformation = requestInformation;
+ }
+
+ public ServiceInformation getServiceInformation() {
+ return serviceInformation;
+ }
+
+ public void setServiceInformation(ServiceInformation serviceInformation) {
+ this.serviceInformation = serviceInformation;
+ }
+
+ public String getVnfId() {
+ return vnfId;
+ }
+
+ public void setVnfId(String vnfId) {
+ this.vnfId = vnfId;
+ }
+
+ public SdncRequestHeader getSdncRequestHeader() {
+ return sdncRequestHeader;
+ }
+
+ public void setSdncRequestHeader(SdncRequestHeader sdncRequestHeader) {
+ this.sdncRequestHeader = sdncRequestHeader;
+ }
+
+ public VnfRequestInformation getVnfRequestInformation() {
+ return vnfRequestInformation;
+ }
+
+ public void setVnfRequestInformation(VnfRequestInformation vnfRequestInformation) {
+ this.vnfRequestInformation = vnfRequestInformation;
+ }
+
+ public OperStatus getOperStatus() {
+ return operStatus;
+ }
+
+ public void setOperStatus(OperStatus operStatus) {
+ this.operStatus = operStatus;
+ }
+
+ public VnfTopologyInformation getVnfTopologyInformation() {
+ return vnfTopologyInformation;
+ }
+
+ public void setVnfTopologyInformation(VnfTopologyInformation vnfTopologyInformation) {
+ this.vnfTopologyInformation = vnfTopologyInformation;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(ServiceData.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("requestInformation");
+ sb.append('=');
+ sb.append(((this.requestInformation == null)?"<null>":this.requestInformation));
+ sb.append(',');
+ sb.append("erviceInformation");
+ sb.append('=');
+ sb.append(((this.serviceInformation == null)?"<null>":this.serviceInformation));
+ sb.append(',');
+ sb.append("vnfId");
+ sb.append('=');
+ sb.append(((this.vnfId == null)?"<null>":this.vnfId));
+ sb.append(',');
+ sb.append("sdncRequestHeader");
+ sb.append('=');
+ sb.append(((this.sdncRequestHeader == null)?"<null>":this.sdncRequestHeader));
+ sb.append(',');
+ sb.append("vnfRequestInformation");
+ sb.append('=');
+ sb.append(((this.vnfRequestInformation == null)?"<null>":this.vnfRequestInformation));
+ sb.append(',');
+ sb.append("operStatus");
+ sb.append('=');
+ sb.append(((this.operStatus == null)?"<null>":this.operStatus));
+ sb.append(',');
+ sb.append("vnfTopologyInformation");
+ sb.append('=');
+ sb.append(((this.vnfTopologyInformation == null)?"<null>":this.vnfTopologyInformation));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.vnfRequestInformation == null)? 0 :this.vnfRequestInformation.hashCode()));
+ result = ((result* 31)+((this.vnfTopologyInformation == null)? 0 :this.vnfTopologyInformation.hashCode()));
+ result = ((result* 31)+((this.serviceInformation == null)? 0 :this.serviceInformation.hashCode()));
+ result = ((result* 31)+((this.sdncRequestHeader == null)? 0 :this.sdncRequestHeader.hashCode()));
+ result = ((result* 31)+((this.vnfId == null)? 0 :this.vnfId.hashCode()));
+ result = ((result* 31)+((this.requestInformation == null)? 0 :this.requestInformation.hashCode()));
+ result = ((result* 31)+((this.operStatus == null)? 0 :this.operStatus.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof ServiceData) == false) {
+ return false;
+ }
+ ServiceData rhs = ((ServiceData) other);
+ return ((((((((this.vnfRequestInformation == rhs.vnfRequestInformation)||((this.vnfRequestInformation!= null)&&this.vnfRequestInformation.equals(rhs.vnfRequestInformation)))&&((this.vnfTopologyInformation == rhs.vnfTopologyInformation)||((this.vnfTopologyInformation!= null)&&this.vnfTopologyInformation.equals(rhs.vnfTopologyInformation))))&&((this.serviceInformation == rhs.serviceInformation)||((this.serviceInformation!= null)&&this.serviceInformation.equals(rhs.serviceInformation))))&&((this.sdncRequestHeader == rhs.sdncRequestHeader)||((this.sdncRequestHeader!= null)&&this.sdncRequestHeader.equals(rhs.sdncRequestHeader))))&&((this.vnfId == rhs.vnfId)||((this.vnfId!= null)&&this.vnfId.equals(rhs.vnfId))))&&((this.requestInformation == rhs.requestInformation)||((this.requestInformation!= null)&&this.requestInformation.equals(rhs.requestInformation))))&&((this.operStatus == rhs.operStatus)||((this.operStatus!= null)&&this.operStatus.equals(rhs.operStatus))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceEntity.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceEntity.java
index 2f08533..6af0746 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceEntity.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceEntity.java
@@ -25,6 +25,7 @@ public class ServiceEntity {
private String apiName;
private String serviceInstanceId;
private String customerId;
+ private String transactionId;
public String getCustomerId() {
return customerId;
@@ -70,4 +71,12 @@ public class ServiceEntity {
this.apiName = apiName;
}
+ public String getTransactionId() {
+ return transactionId;
+ }
+
+ public void setTransactionId(String transactionId) {
+ this.transactionId = transactionId;
+ }
+
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceInformation.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceInformation.java
new file mode 100644
index 0000000..f289f76
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceInformation.java
@@ -0,0 +1,143 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class ServiceInformation {
+
+ @SerializedName("service-id")
+ @Expose
+ private String serviceId;
+ @SerializedName("service-type")
+ @Expose
+ private String serviceType;
+ @SerializedName("subscriber-name")
+ @Expose
+ private String subscriberName;
+ @SerializedName("serviceInstanceId")
+ @Expose
+ private String serviceInstanceId;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public ServiceInformation() {
+ }
+
+ /**
+ *
+ * @param serviceType
+ * @param serviceId
+ * @param subscriberName
+ * @param serviceInstanceId
+ */
+ public ServiceInformation(String serviceId, String serviceType, String subscriberName, String serviceInstanceId) {
+ super();
+ this.serviceId = serviceId;
+ this.serviceType = serviceType;
+ this.subscriberName = subscriberName;
+ this.serviceInstanceId = serviceInstanceId;
+ }
+
+ public String getServiceId() {
+ return serviceId;
+ }
+
+ public void setServiceId(String serviceId) {
+ this.serviceId = serviceId;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getSubscriberName() {
+ return subscriberName;
+ }
+
+ public void setSubscriberName(String subscriberName) {
+ this.subscriberName = subscriberName;
+ }
+
+ public String getServiceInstanceId() {
+ return serviceInstanceId;
+ }
+
+ public void setServiceInstanceId(String serviceInstanceId) {
+ this.serviceInstanceId = serviceInstanceId;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(ServiceInformation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("serviceId");
+ sb.append('=');
+ sb.append(((this.serviceId == null)?"<null>":this.serviceId));
+ sb.append(',');
+ sb.append("serviceType");
+ sb.append('=');
+ sb.append(((this.serviceType == null)?"<null>":this.serviceType));
+ sb.append(',');
+ sb.append("subscriberName");
+ sb.append('=');
+ sb.append(((this.subscriberName == null)?"<null>":this.subscriberName));
+ sb.append(',');
+ sb.append("serviceInstanceId");
+ sb.append('=');
+ sb.append(((this.serviceInstanceId == null)?"<null>":this.serviceInstanceId));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.serviceType == null)? 0 :this.serviceType.hashCode()));
+ result = ((result* 31)+((this.subscriberName == null)? 0 :this.subscriberName.hashCode()));
+ result = ((result* 31)+((this.serviceInstanceId == null)? 0 :this.serviceInstanceId.hashCode()));
+ result = ((result* 31)+((this.serviceId == null)? 0 :this.serviceId.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof ServiceInformation) == false) {
+ return false;
+ }
+ ServiceInformation rhs = ((ServiceInformation) other);
+ return (((((this.serviceType == rhs.serviceType)||((this.serviceType!= null)&&this.serviceType.equals(rhs.serviceType)))&&((this.subscriberName == rhs.subscriberName)||((this.subscriberName!= null)&&this.subscriberName.equals(rhs.subscriberName))))&&((this.serviceInstanceId == rhs.serviceInstanceId)||((this.serviceInstanceId!= null)&&this.serviceInstanceId.equals(rhs.serviceInstanceId))))&&((this.serviceId == rhs.serviceId)||((this.serviceId!= null)&&this.serviceId.equals(rhs.serviceId))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceInstance.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceInstance.java
new file mode 100644
index 0000000..2844814
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceInstance.java
@@ -0,0 +1,212 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import javax.validation.Valid;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+public class ServiceInstance {
+
+ @SerializedName("service-instance-id")
+ @Expose
+ private String serviceInstanceId;
+ @SerializedName("service-instance-name")
+ @Expose
+ private String serviceInstanceName;
+ @SerializedName("service-type")
+ @Expose
+ private String serviceType;
+ @SerializedName("service-role")
+ @Expose
+ private String serviceRole;
+ @SerializedName("environment-context")
+ @Expose
+ private String environmentContext;
+ @SerializedName("workload-context")
+ @Expose
+ private String workloadContext;
+ @SerializedName("model-invariant-id")
+ @Expose
+ private String modelInvariantId;
+ @SerializedName("model-version-id")
+ @Expose
+ private String modelVersionId;
+ @SerializedName("resource-version")
+ @Expose
+ private String resourceVersion;
+ @SerializedName("orchestration-status")
+ @Expose
+ private String orchestrationStatus;
+ @SerializedName("relationship-list")
+ @Expose
+ @Valid
+ private RelationshipList relationshipList;
+
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public ServiceInstance() {
+ }
+
+ /**
+ *
+ * @param serviceRole
+ * @param serviceInstanceName
+ * @param orchestrationStatus
+ * @param serviceType
+ * @param modelInvariantId
+ * @param workloadContext
+ * @param environmentContext
+ * @param resourceVersion
+ * @param relationshipList
+ * @param modelVersionId
+ * @param serviceInstanceId
+ */
+ public ServiceInstance(String serviceInstanceId, String serviceInstanceName, String serviceType, String serviceRole, String environmentContext, String workloadContext, String modelInvariantId, String modelVersionId, String resourceVersion, String orchestrationStatus, RelationshipList relationshipList) {
+ super();
+ this.serviceInstanceId = serviceInstanceId;
+ this.serviceInstanceName = serviceInstanceName;
+ this.serviceType = serviceType;
+ this.serviceRole = serviceRole;
+ this.environmentContext = environmentContext;
+ this.workloadContext = workloadContext;
+ this.modelInvariantId = modelInvariantId;
+ this.modelVersionId = modelVersionId;
+ this.resourceVersion = resourceVersion;
+ this.orchestrationStatus = orchestrationStatus;
+ this.relationshipList = relationshipList;
+ }
+
+ public String getServiceInstanceId() {
+ return serviceInstanceId;
+ }
+
+ public void setServiceInstanceId(String serviceInstanceId) {
+ this.serviceInstanceId = serviceInstanceId;
+ }
+
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
+ }
+
+ public void setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceRole() {
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ }
+
+ public String getEnvironmentContext() {
+ return environmentContext;
+ }
+
+ public void setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ }
+
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ public String getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+
+ public void setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ }
+
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("serviceInstanceId", serviceInstanceId).append("serviceInstanceName", serviceInstanceName).append("serviceType", serviceType).append("serviceRole", serviceRole).append("environmentContext", environmentContext).append("workloadContext", workloadContext).append("modelInvariantId", modelInvariantId).append("modelVersionId", modelVersionId).append("resourceVersion", resourceVersion).append("orchestrationStatus", orchestrationStatus).append("relationshipList", relationshipList).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(serviceRole).append(serviceInstanceName).append(orchestrationStatus).append(serviceType).append(modelInvariantId).append(workloadContext).append(environmentContext).append(resourceVersion).append(relationshipList).append(modelVersionId).append(serviceInstanceId).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof ServiceInstance) == false) {
+ return false;
+ }
+ ServiceInstance rhs = ((ServiceInstance) other);
+ return new EqualsBuilder().append(serviceRole, rhs.serviceRole).append(serviceInstanceName, rhs.serviceInstanceName).append(orchestrationStatus, rhs.orchestrationStatus).append(serviceType, rhs.serviceType).append(modelInvariantId, rhs.modelInvariantId).append(workloadContext, rhs.workloadContext).append(environmentContext, rhs.environmentContext).append(resourceVersion, rhs.resourceVersion).append(relationshipList, rhs.relationshipList).append(modelVersionId, rhs.modelVersionId).append(serviceInstanceId, rhs.serviceInstanceId).isEquals();
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceStatus.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceStatus.java
new file mode 100644
index 0000000..a60dd61
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/ServiceStatus.java
@@ -0,0 +1,197 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class ServiceStatus {
+
+ @SerializedName("response-timestamp")
+ @Expose
+ private String responseTimestamp;
+ @SerializedName("vnfsdn-action")
+ @Expose
+ private String vnfsdnAction;
+ @SerializedName("rpc-action")
+ @Expose
+ private String rpcAction;
+ @SerializedName("rpc-name")
+ @Expose
+ private String rpcName;
+ @SerializedName("response-code")
+ @Expose
+ private String responseCode;
+ @SerializedName("final-indicator")
+ @Expose
+ private String finalIndicator;
+ @SerializedName("request-status")
+ @Expose
+ private String requestStatus;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public ServiceStatus() {
+ }
+
+ /**
+ *
+ * @param requestStatus
+ * @param responseTimestamp
+ * @param responseCode
+ * @param vnfsdnAction
+ * @param rpcAction
+ * @param rpcName
+ * @param finalIndicator
+ */
+ public ServiceStatus(String responseTimestamp, String vnfsdnAction, String rpcAction, String rpcName, String responseCode, String finalIndicator, String requestStatus) {
+ super();
+ this.responseTimestamp = responseTimestamp;
+ this.vnfsdnAction = vnfsdnAction;
+ this.rpcAction = rpcAction;
+ this.rpcName = rpcName;
+ this.responseCode = responseCode;
+ this.finalIndicator = finalIndicator;
+ this.requestStatus = requestStatus;
+ }
+
+ public String getResponseTimestamp() {
+ return responseTimestamp;
+ }
+
+ public void setResponseTimestamp(String responseTimestamp) {
+ this.responseTimestamp = responseTimestamp;
+ }
+
+ public String getVnfsdnAction() {
+ return vnfsdnAction;
+ }
+
+ public void setVnfsdnAction(String vnfsdnAction) {
+ this.vnfsdnAction = vnfsdnAction;
+ }
+
+ public String getRpcAction() {
+ return rpcAction;
+ }
+
+ public void setRpcAction(String rpcAction) {
+ this.rpcAction = rpcAction;
+ }
+
+ public String getRpcName() {
+ return rpcName;
+ }
+
+ public void setRpcName(String rpcName) {
+ this.rpcName = rpcName;
+ }
+
+ public String getResponseCode() {
+ return responseCode;
+ }
+
+ public void setResponseCode(String responseCode) {
+ this.responseCode = responseCode;
+ }
+
+ public String getFinalIndicator() {
+ return finalIndicator;
+ }
+
+ public void setFinalIndicator(String finalIndicator) {
+ this.finalIndicator = finalIndicator;
+ }
+
+ public String getRequestStatus() {
+ return requestStatus;
+ }
+
+ public void setRequestStatus(String requestStatus) {
+ this.requestStatus = requestStatus;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(ServiceStatus.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("responseTimestamp");
+ sb.append('=');
+ sb.append(((this.responseTimestamp == null)?"<null>":this.responseTimestamp));
+ sb.append(',');
+ sb.append("vnfsdnAction");
+ sb.append('=');
+ sb.append(((this.vnfsdnAction == null)?"<null>":this.vnfsdnAction));
+ sb.append(',');
+ sb.append("rpcAction");
+ sb.append('=');
+ sb.append(((this.rpcAction == null)?"<null>":this.rpcAction));
+ sb.append(',');
+ sb.append("rpcName");
+ sb.append('=');
+ sb.append(((this.rpcName == null)?"<null>":this.rpcName));
+ sb.append(',');
+ sb.append("responseCode");
+ sb.append('=');
+ sb.append(((this.responseCode == null)?"<null>":this.responseCode));
+ sb.append(',');
+ sb.append("finalIndicator");
+ sb.append('=');
+ sb.append(((this.finalIndicator == null)?"<null>":this.finalIndicator));
+ sb.append(',');
+ sb.append("requestStatus");
+ sb.append('=');
+ sb.append(((this.requestStatus == null)?"<null>":this.requestStatus));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.requestStatus == null)? 0 :this.requestStatus.hashCode()));
+ result = ((result* 31)+((this.responseTimestamp == null)? 0 :this.responseTimestamp.hashCode()));
+ result = ((result* 31)+((this.responseCode == null)? 0 :this.responseCode.hashCode()));
+ result = ((result* 31)+((this.vnfsdnAction == null)? 0 :this.vnfsdnAction.hashCode()));
+ result = ((result* 31)+((this.rpcAction == null)? 0 :this.rpcAction.hashCode()));
+ result = ((result* 31)+((this.rpcName == null)? 0 :this.rpcName.hashCode()));
+ result = ((result* 31)+((this.finalIndicator == null)? 0 :this.finalIndicator.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof ServiceStatus) == false) {
+ return false;
+ }
+ ServiceStatus rhs = ((ServiceStatus) other);
+ return ((((((((this.requestStatus == rhs.requestStatus)||((this.requestStatus!= null)&&this.requestStatus.equals(rhs.requestStatus)))&&((this.responseTimestamp == rhs.responseTimestamp)||((this.responseTimestamp!= null)&&this.responseTimestamp.equals(rhs.responseTimestamp))))&&((this.responseCode == rhs.responseCode)||((this.responseCode!= null)&&this.responseCode.equals(rhs.responseCode))))&&((this.vnfsdnAction == rhs.vnfsdnAction)||((this.vnfsdnAction!= null)&&this.vnfsdnAction.equals(rhs.vnfsdnAction))))&&((this.rpcAction == rhs.rpcAction)||((this.rpcAction!= null)&&this.rpcAction.equals(rhs.rpcAction))))&&((this.rpcName == rhs.rpcName)||((this.rpcName!= null)&&this.rpcName.equals(rhs.rpcName))))&&((this.finalIndicator == rhs.finalIndicator)||((this.finalIndicator!= null)&&this.finalIndicator.equals(rhs.finalIndicator))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VfModule.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VfModule.java
new file mode 100644
index 0000000..8cb614e
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VfModule.java
@@ -0,0 +1,211 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import javax.validation.Valid;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+public class VfModule {
+
+ @SerializedName("vf-module-id")
+ @Expose
+ private String vfModuleId;
+ @SerializedName("vf-module-name")
+ @Expose
+ private String vfModuleName;
+ @SerializedName("heat-stack-id")
+ @Expose
+ private String heatStackId;
+ @SerializedName("orchestration-status")
+ @Expose
+ private String orchestrationStatus;
+ @SerializedName("is-base-vf-module")
+ @Expose
+ private Boolean isBaseVfModule;
+ @SerializedName("resource-version")
+ @Expose
+ private String resourceVersion;
+ @SerializedName("model-invariant-id")
+ @Expose
+ private String modelInvariantId;
+ @SerializedName("model-version-id")
+ @Expose
+ private String modelVersionId;
+ @SerializedName("model-customization-id")
+ @Expose
+ private String modelCustomizationId;
+ @SerializedName("module-index")
+ @Expose
+ private Integer moduleIndex;
+ @SerializedName("relationship-list")
+ @Expose
+ @Valid
+ private RelationshipList relationshipList;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VfModule() {
+ }
+
+ /**
+ *
+ * @param modelCustomizationId
+ * @param moduleIndex
+ * @param vfModuleName
+ * @param orchestrationStatus
+ * @param vfModuleId
+ * @param modelInvariantId
+ * @param heatStackId
+ * @param isBaseVfModule
+ * @param resourceVersion
+ * @param relationshipList
+ * @param modelVersionId
+ */
+ public VfModule(String vfModuleId, String vfModuleName, String heatStackId, String orchestrationStatus, Boolean isBaseVfModule, String resourceVersion, String modelInvariantId, String modelVersionId, String modelCustomizationId, Integer moduleIndex, RelationshipList relationshipList) {
+ super();
+ this.vfModuleId = vfModuleId;
+ this.vfModuleName = vfModuleName;
+ this.heatStackId = heatStackId;
+ this.orchestrationStatus = orchestrationStatus;
+ this.isBaseVfModule = isBaseVfModule;
+ this.resourceVersion = resourceVersion;
+ this.modelInvariantId = modelInvariantId;
+ this.modelVersionId = modelVersionId;
+ this.modelCustomizationId = modelCustomizationId;
+ this.moduleIndex = moduleIndex;
+ this.relationshipList = relationshipList;
+ }
+
+ public String getVfModuleId() {
+ return vfModuleId;
+ }
+
+ public void setVfModuleId(String vfModuleId) {
+ this.vfModuleId = vfModuleId;
+ }
+
+ public String getVfModuleName() {
+ return vfModuleName;
+ }
+
+ public void setVfModuleName(String vfModuleName) {
+ this.vfModuleName = vfModuleName;
+ }
+
+ public String getHeatStackId() {
+ return heatStackId;
+ }
+
+ public void setHeatStackId(String heatStackId) {
+ this.heatStackId = heatStackId;
+ }
+
+ public String getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+
+ public void setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ }
+
+ public Boolean getIsBaseVfModule() {
+ return isBaseVfModule;
+ }
+
+ public void setIsBaseVfModule(Boolean isBaseVfModule) {
+ this.isBaseVfModule = isBaseVfModule;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getModelCustomizationId() {
+ return modelCustomizationId;
+ }
+
+ public void setModelCustomizationId(String modelCustomizationId) {
+ this.modelCustomizationId = modelCustomizationId;
+ }
+
+ public Integer getModuleIndex() {
+ return moduleIndex;
+ }
+
+ public void setModuleIndex(Integer moduleIndex) {
+ this.moduleIndex = moduleIndex;
+ }
+
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("vfModuleId", vfModuleId).append("vfModuleName", vfModuleName).append("heatStackId", heatStackId).append("orchestrationStatus", orchestrationStatus).append("isBaseVfModule", isBaseVfModule).append("resourceVersion", resourceVersion).append("modelInvariantId", modelInvariantId).append("modelVersionId", modelVersionId).append("modelCustomizationId", modelCustomizationId).append("moduleIndex", moduleIndex).append("relationshipList", relationshipList).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(modelCustomizationId).append(moduleIndex).append(vfModuleName).append(orchestrationStatus).append(vfModuleId).append(modelInvariantId).append(heatStackId).append(isBaseVfModule).append(resourceVersion).append(relationshipList).append(modelVersionId).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VfModule) == false) {
+ return false;
+ }
+ VfModule rhs = ((VfModule) other);
+ return new EqualsBuilder().append(modelCustomizationId, rhs.modelCustomizationId).append(moduleIndex, rhs.moduleIndex).append(vfModuleName, rhs.vfModuleName).append(orchestrationStatus, rhs.orchestrationStatus).append(vfModuleId, rhs.vfModuleId).append(modelInvariantId, rhs.modelInvariantId).append(heatStackId, rhs.heatStackId).append(isBaseVfModule, rhs.isBaseVfModule).append(resourceVersion, rhs.resourceVersion).append(relationshipList, rhs.relationshipList).append(modelVersionId, rhs.modelVersionId).isEquals();
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VfModules.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VfModules.java
new file mode 100644
index 0000000..904da55
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VfModules.java
@@ -0,0 +1,82 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import java.util.List;
+import javax.validation.Valid;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+public class VfModules {
+
+ @SerializedName("vf-module")
+ @Expose
+ @Valid
+ private List<VfModule> vfModule = null;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VfModules() {
+ }
+
+ /**
+ *
+ * @param vfModule
+ */
+ public VfModules(List<VfModule> vfModule) {
+ super();
+ this.vfModule = vfModule;
+ }
+
+ public List<VfModule> getVfModule() {
+ return vfModule;
+ }
+
+ public void setVfModule(List<VfModule> vfModule) {
+ this.vfModule = vfModule;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("vfModule", vfModule).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(vfModule).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VfModules) == false) {
+ return false;
+ }
+ VfModules rhs = ((VfModules) other);
+ return new EqualsBuilder().append(vfModule, rhs.vfModule).isEquals();
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmName.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmName.java
new file mode 100644
index 0000000..5336dbe
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmName.java
@@ -0,0 +1,89 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class VmName {
+
+ @SerializedName("vm-name")
+ @Expose
+ private String vmName;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VmName() {
+ }
+
+ /**
+ *
+ * @param vmName
+ */
+ public VmName(String vmName) {
+ super();
+ this.vmName = vmName;
+ }
+
+ public String getVmName() {
+ return vmName;
+ }
+
+ public void setVmName(String vmName) {
+ this.vmName = vmName;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VmName.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("vmName");
+ sb.append('=');
+ sb.append(((this.vmName == null)?"<null>":this.vmName));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.vmName == null)? 0 :this.vmName.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VmName) == false) {
+ return false;
+ }
+ VmName rhs = ((VmName) other);
+ return ((this.vmName == rhs.vmName)||((this.vmName!= null)&&this.vmName.equals(rhs.vmName)));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java
new file mode 100644
index 0000000..cb12c26
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java
@@ -0,0 +1,181 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import java.util.ArrayList;
+import java.util.List;
+
+public class VmNetwork {
+
+ @SerializedName("network-role")
+ @Expose
+ private String networkRole;
+ @SerializedName("network-ips-v6")
+ @Expose
+ private List<NetworkIpV6> networkIpsV6 = new ArrayList<NetworkIpV6>();
+ @SerializedName("floating-ip")
+ @Expose
+ private String floatingIp;
+ @SerializedName("use-dhcp")
+ @Expose
+ private String useDhcp;
+ @SerializedName("network-ips")
+ @Expose
+ private List<NetworkIp> networkIps = new ArrayList<NetworkIp>();
+ @SerializedName("floating-ip-v6")
+ @Expose
+ private String floatingIpV6;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VmNetwork() {
+ }
+
+ /**
+ *
+ * @param useDhcp
+ * @param networkRole
+ * @param networkIps
+ * @param floatingIp
+ * @param floatingIpV6
+ * @param networkIpsV6
+ */
+ public VmNetwork(String networkRole, List<NetworkIpV6> networkIpsV6, String floatingIp, String useDhcp, List<NetworkIp> networkIps, String floatingIpV6) {
+ super();
+ this.networkRole = networkRole;
+ this.networkIpsV6 = networkIpsV6;
+ this.floatingIp = floatingIp;
+ this.useDhcp = useDhcp;
+ this.networkIps = networkIps;
+ this.floatingIpV6 = floatingIpV6;
+ }
+
+ public String getNetworkRole() {
+ return networkRole;
+ }
+
+ public void setNetworkRole(String networkRole) {
+ this.networkRole = networkRole;
+ }
+
+ public List<NetworkIpV6> getNetworkIpsV6() {
+ return networkIpsV6;
+ }
+
+ public void setNetworkIpsV6(List<NetworkIpV6> networkIpsV6) {
+ this.networkIpsV6 = networkIpsV6;
+ }
+
+ public String getFloatingIp() {
+ return floatingIp;
+ }
+
+ public void setFloatingIp(String floatingIp) {
+ this.floatingIp = floatingIp;
+ }
+
+ public String getUseDhcp() {
+ return useDhcp;
+ }
+
+ public void setUseDhcp(String useDhcp) {
+ this.useDhcp = useDhcp;
+ }
+
+ public List<NetworkIp> getNetworkIps() {
+ return networkIps;
+ }
+
+ public void setNetworkIps(List<NetworkIp> networkIps) {
+ this.networkIps = networkIps;
+ }
+
+ public String getFloatingIpV6() {
+ return floatingIpV6;
+ }
+
+ public void setFloatingIpV6(String floatingIpV6) {
+ this.floatingIpV6 = floatingIpV6;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VmNetwork.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("networkRole");
+ sb.append('=');
+ sb.append(((this.networkRole == null)?"<null>":this.networkRole));
+ sb.append(',');
+ sb.append("networkIpsV6");
+ sb.append('=');
+ sb.append(((this.networkIpsV6 == null)?"<null>":this.networkIpsV6));
+ sb.append(',');
+ sb.append("floatingIp");
+ sb.append('=');
+ sb.append(((this.floatingIp == null)?"<null>":this.floatingIp));
+ sb.append(',');
+ sb.append("useDhcp");
+ sb.append('=');
+ sb.append(((this.useDhcp == null)?"<null>":this.useDhcp));
+ sb.append(',');
+ sb.append("networkIps");
+ sb.append('=');
+ sb.append(((this.networkIps == null)?"<null>":this.networkIps));
+ sb.append(',');
+ sb.append("floatingIpV6");
+ sb.append('=');
+ sb.append(((this.floatingIpV6 == null)?"<null>":this.floatingIpV6));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.useDhcp == null)? 0 :this.useDhcp.hashCode()));
+ result = ((result* 31)+((this.networkRole == null)? 0 :this.networkRole.hashCode()));
+ result = ((result* 31)+((this.networkIps == null)? 0 :this.networkIps.hashCode()));
+ result = ((result* 31)+((this.floatingIp == null)? 0 :this.floatingIp.hashCode()));
+ result = ((result* 31)+((this.floatingIpV6 == null)? 0 :this.floatingIpV6 .hashCode()));
+ result = ((result* 31)+((this.networkIpsV6 == null)? 0 :this.networkIpsV6 .hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VmNetwork) == false) {
+ return false;
+ }
+ VmNetwork rhs = ((VmNetwork) other);
+ return (((((((this.useDhcp == rhs.useDhcp)||((this.useDhcp!= null)&&this.useDhcp.equals(rhs.useDhcp)))&&((this.networkRole == rhs.networkRole)||((this.networkRole!= null)&&this.networkRole.equals(rhs.networkRole))))&&((this.networkIps == rhs.networkIps)||((this.networkIps!= null)&&this.networkIps.equals(rhs.networkIps))))&&((this.floatingIp == rhs.floatingIp)||((this.floatingIp!= null)&&this.floatingIp.equals(rhs.floatingIp))))&&((this.floatingIpV6 == rhs.floatingIpV6)||((this.floatingIpV6 != null)&&this.floatingIpV6 .equals(rhs.floatingIpV6))))&&((this.networkIpsV6 == rhs.networkIpsV6)||((this.networkIpsV6 != null)&&this.networkIpsV6 .equals(rhs.networkIpsV6))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/Vnf.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/Vnf.java
new file mode 100644
index 0000000..36842a3
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/Vnf.java
@@ -0,0 +1,126 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class Vnf {
+
+ @SerializedName("vnf-id")
+ @Expose
+ private String vnfId;
+ @SerializedName("service-status")
+ @Expose
+ private ServiceStatus serviceStatus;
+ @SerializedName("service-data")
+ @Expose
+ private ServiceData serviceData;
+
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public Vnf() {
+ }
+
+ /**
+ *
+ * @param vnfId
+ * @param serviceStatus
+ * @param serviceData
+ */
+ public Vnf(String vnfId, ServiceStatus serviceStatus, ServiceData serviceData) {
+ super();
+ this.vnfId = vnfId;
+ this.serviceStatus = serviceStatus;
+ this.serviceData = serviceData;
+ }
+
+ public String getVnfId() {
+ return vnfId;
+ }
+
+ public void setVnfId(String vnfId) {
+ this.vnfId = vnfId;
+ }
+
+ public ServiceStatus getServiceStatus() {
+ return serviceStatus;
+ }
+
+ public void setServiceStatus(ServiceStatus serviceStatus) {
+ this.serviceStatus = serviceStatus;
+ }
+
+ public ServiceData getServiceData() {
+ return serviceData;
+ }
+
+ public void setServiceData(ServiceData serviceData) {
+ this.serviceData = serviceData;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(Vnf.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("vnfId");
+ sb.append('=');
+ sb.append(((this.vnfId == null)?"<null>":this.vnfId));
+ sb.append(',');
+ sb.append("serviceStatus");
+ sb.append('=');
+ sb.append(((this.serviceStatus == null)?"<null>":this.serviceStatus));
+ sb.append(',');
+ sb.append("serviceData");
+ sb.append('=');
+ sb.append(((this.serviceData == null)?"<null>":this.serviceData));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.serviceStatus == null)? 0 :this.serviceStatus.hashCode()));
+ result = ((result* 31)+((this.serviceData == null)? 0 :this.serviceData.hashCode()));
+ result = ((result* 31)+((this.vnfId == null)? 0 :this.vnfId.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof Vnf) == false) {
+ return false;
+ }
+ Vnf rhs = ((Vnf) other);
+ return ((((this.serviceStatus == rhs.serviceStatus)||((this.serviceStatus!= null)&&this.serviceStatus.equals(rhs.serviceStatus)))&&((this.serviceData == rhs.serviceData)||((this.serviceData!= null)&&this.serviceData.equals(rhs.serviceData))))&&((this.vnfId == rhs.vnfId)||((this.vnfId!= null)&&this.vnfId.equals(rhs.vnfId))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfAssignments.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfAssignments.java
new file mode 100644
index 0000000..2abfb31
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfAssignments.java
@@ -0,0 +1,127 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class VnfAssignments {
+
+ @SerializedName("vnf-networks")
+ @Expose
+ private List<VnfNetwork> vnfNetworks = new ArrayList<VnfNetwork>();
+ @SerializedName("availability-zones")
+ @Expose
+ private List<AvailabilityZone> availabilityZones = new ArrayList<AvailabilityZone>();
+ @SerializedName("vnf-vms")
+ @Expose
+ private List<VnfVm> vnfVms = new ArrayList<VnfVm>();
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VnfAssignments() {
+ }
+
+ /**
+ *
+ * @param vnfVms
+ * @param availabilityZones
+ * @param vnfNetworks
+ */
+ public VnfAssignments(List<VnfNetwork> vnfNetworks, List<AvailabilityZone> availabilityZones, List<VnfVm> vnfVms) {
+ super();
+ this.vnfNetworks = vnfNetworks;
+ this.availabilityZones = availabilityZones;
+ this.vnfVms = vnfVms;
+ }
+
+ public List<VnfNetwork> getVnfNetworks() {
+ return vnfNetworks;
+ }
+
+ public void setVnfNetworks(List<VnfNetwork> vnfNetworks) {
+ this.vnfNetworks = vnfNetworks;
+ }
+
+ public List<AvailabilityZone> getAvailabilityZones() {
+ return availabilityZones;
+ }
+
+ public void setAvailabilityZones(List<AvailabilityZone> availabilityZones) {
+ this.availabilityZones = availabilityZones;
+ }
+
+ public List<VnfVm> getVnfVms() {
+ return vnfVms;
+ }
+
+ public void setVnfVms(List<VnfVm> vnfVms) {
+ this.vnfVms = vnfVms;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VnfAssignments.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("vnfNetworks");
+ sb.append('=');
+ sb.append(((this.vnfNetworks == null)?"<null>":this.vnfNetworks));
+ sb.append(',');
+ sb.append("availabilityZones");
+ sb.append('=');
+ sb.append(((this.availabilityZones == null)?"<null>":this.availabilityZones));
+ sb.append(',');
+ sb.append("vnfVms");
+ sb.append('=');
+ sb.append(((this.vnfVms == null)?"<null>":this.vnfVms));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.availabilityZones == null)? 0 :this.availabilityZones.hashCode()));
+ result = ((result* 31)+((this.vnfVms == null)? 0 :this.vnfVms.hashCode()));
+ result = ((result* 31)+((this.vnfNetworks == null)? 0 :this.vnfNetworks.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VnfAssignments) == false) {
+ return false;
+ }
+ VnfAssignments rhs = ((VnfAssignments) other);
+ return ((((this.availabilityZones == rhs.availabilityZones)||((this.availabilityZones!= null)&&this.availabilityZones.equals(rhs.availabilityZones)))&&((this.vnfVms == rhs.vnfVms)||((this.vnfVms!= null)&&this.vnfVms.equals(rhs.vnfVms))))&&((this.vnfNetworks == rhs.vnfNetworks)||((this.vnfNetworks!= null)&&this.vnfNetworks.equals(rhs.vnfNetworks))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfInstance.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfInstance.java
new file mode 100644
index 0000000..e3fb756
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfInstance.java
@@ -0,0 +1,438 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import javax.validation.Valid;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.onap.pomba.contextbuilder.sdnc.exception.AuditError;
+import org.onap.pomba.contextbuilder.sdnc.exception.AuditException;
+
+
+public class VnfInstance {
+
+ @SerializedName("vnf-id")
+ @Expose
+ private String vnfId;
+ @SerializedName("vnf-name")
+ @Expose
+ private String vnfName;
+ @SerializedName("vnf-name2")
+ @Expose
+ private String vnfName2;
+ @SerializedName("vnf-type")
+ @Expose
+ private String vnfType;
+ @SerializedName("service-id")
+ @Expose
+ private String serviceId;
+ @SerializedName("prov-status")
+ @Expose
+ private String provStatus;
+ @SerializedName("license-key")
+ @Expose
+ private String licenseKey;
+ @SerializedName("equipment-role")
+ @Expose
+ private String equipmentRole;
+ @SerializedName("orchestration-status")
+ @Expose
+ private String orchestrationStatus;
+ @SerializedName("heat-stack-id")
+ @Expose
+ private String heatStackId;
+ @SerializedName("mso-catalog-key")
+ @Expose
+ private String msoCatalogKey;
+ @SerializedName("ipv4-oam-address")
+ @Expose
+ private String ipv4OamAddress;
+ @SerializedName("ipv4-loopback0-address")
+ @Expose
+ private String ipv4Loopback0Address;
+ @SerializedName("nm-lan-v6-address")
+ @Expose
+ private String nmLanV6Address;
+ @SerializedName("management-v6-address")
+ @Expose
+ private String managementV6Address;
+ @SerializedName("in-maint")
+ @Expose
+ private Boolean inMaint;
+ @SerializedName("is-closed-loop-disabled")
+ @Expose
+ private Boolean isClosedLoopDisabled;
+ @SerializedName("resource-version")
+ @Expose
+ private String resourceVersion;
+ @SerializedName("model-invariant-id")
+ @Expose
+ private String modelInvariantId;
+ @SerializedName("model-version-id")
+ @Expose
+ private String modelVersionId;
+ @SerializedName("model-customization-id")
+ @Expose
+ private String modelCustomizationId;
+ @SerializedName("nf-type")
+ @Expose
+ private String nfType;
+ @SerializedName("nf-function")
+ @Expose
+ private String nfFunction;
+ @SerializedName("nf-role")
+ @Expose
+ private String nfRole;
+ @SerializedName("nf-naming-code")
+ @Expose
+ private String nfNamingCode;
+ @SerializedName("relationship-list")
+ @Expose
+ @Valid
+ private RelationshipList relationshipList;
+ @SerializedName("vf-modules")
+ @Expose
+ @Valid
+ private VfModules vfModules;
+
+ private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
+
+ public static VnfInstance fromJson(String payload) throws AuditException {
+ try {
+ if (payload == null || payload.isEmpty()) {
+ throw new Exception(AuditError.JSON_EMPTY_RESPONSE);
+ }
+ return gson.fromJson(payload, VnfInstance.class);
+ } catch (Exception ex) {
+ throw new AuditException(AuditError.JSON_PARSE_ERROR, ex);
+ }
+ }
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VnfInstance() {
+ }
+
+ /**
+ *
+ * @param serviceId
+ * @param modelCustomizationId
+ * @param vnfType
+ * @param ipv4Loopback0Address
+ * @param nfFunction
+ * @param modelInvariantId
+ * @param resourceVersion
+ * @param vnfName2
+ * @param relationshipList
+ * @param nmLanV6Address
+ * @param nfRole
+ * @param nfType
+ * @param modelVersionId
+ * @param ipv4OamAddress
+ * @param vnfName
+ * @param inMaint
+ * @param msoCatalogKey
+ * @param provStatus
+ * @param vfModules
+ * @param equipmentRole
+ * @param vnfId
+ * @param orchestrationStatus
+ * @param nfNamingCode
+ * @param heatStackId
+ * @param isClosedLoopDisabled
+ * @param licenseKey
+ * @param managementV6Address
+ */
+ public VnfInstance(String vnfId, String vnfName, String vnfName2, String vnfType, String serviceId, String provStatus, String licenseKey, String equipmentRole, String orchestrationStatus, String heatStackId, String msoCatalogKey, String ipv4OamAddress, String ipv4Loopback0Address, String nmLanV6Address, String managementV6Address, Boolean inMaint, Boolean isClosedLoopDisabled, String resourceVersion, String modelInvariantId, String modelVersionId, String modelCustomizationId, String nfType, String nfFunction, String nfRole, String nfNamingCode, RelationshipList relationshipList, VfModules vfModules) {
+ super();
+ this.vnfId = vnfId;
+ this.vnfName = vnfName;
+ this.vnfName2 = vnfName2;
+ this.vnfType = vnfType;
+ this.serviceId= serviceId;
+ this.provStatus = provStatus;
+ this.licenseKey = licenseKey;
+ this.equipmentRole = equipmentRole;
+ this.orchestrationStatus = orchestrationStatus;
+ this.heatStackId= heatStackId;
+ this.msoCatalogKey = msoCatalogKey;
+ this.ipv4OamAddress = ipv4OamAddress;
+ this.ipv4Loopback0Address = ipv4Loopback0Address;
+ this.nmLanV6Address = nmLanV6Address;
+ this.managementV6Address = managementV6Address;
+ this.inMaint = inMaint;
+ this.isClosedLoopDisabled = isClosedLoopDisabled;
+ this.resourceVersion = resourceVersion;
+ this.modelInvariantId= modelInvariantId;
+ this.modelVersionId= modelVersionId;
+ this.modelCustomizationId= modelCustomizationId;
+ this.nfType = nfType;
+ this.nfFunction = nfFunction;
+ this.nfRole = nfRole;
+ this.nfNamingCode = nfNamingCode;
+ this.relationshipList = relationshipList;
+ this.vfModules = vfModules;
+ }
+
+ public String getVnfId() {
+ return vnfId;
+ }
+
+ public void setVnfId(String vnfId) {
+ this.vnfId = vnfId;
+ }
+
+ public String getVnfName() {
+ return vnfName;
+ }
+
+ public void setVnfName(String vnfName) {
+ this.vnfName = vnfName;
+ }
+
+ public String getVnfName2() {
+ return vnfName2;
+ }
+
+ public void setVnfName2(String vnfName2) {
+ this.vnfName2 = vnfName2;
+ }
+
+ public String getVnfType() {
+ return vnfType;
+ }
+
+ public void setVnfType(String vnfType) {
+ this.vnfType = vnfType;
+ }
+
+ public String getServiceId() {
+ return serviceId;
+ }
+
+ public void setServiceId(String serviceId) {
+ this.serviceId= serviceId;
+ }
+
+ public String getProvStatus() {
+ return provStatus;
+ }
+
+ public void setProvStatus(String provStatus) {
+ this.provStatus = provStatus;
+ }
+
+ public String getLicenseKey() {
+ return licenseKey;
+ }
+
+ public void setLicenseKey(String licenseKey) {
+ this.licenseKey = licenseKey;
+ }
+
+ public String getEquipmentRole() {
+ return equipmentRole;
+ }
+
+ public void setEquipmentRole(String equipmentRole) {
+ this.equipmentRole = equipmentRole;
+ }
+
+ public String getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+
+ public void setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ }
+
+ public String getHeatStackId() {
+ return heatStackId;
+ }
+
+ public void setHeatStackId(String heatStackId) {
+ this.heatStackId= heatStackId;
+ }
+
+ public String getMsoCatalogKey() {
+ return msoCatalogKey;
+ }
+
+ public void setMsoCatalogKey(String msoCatalogKey) {
+ this.msoCatalogKey = msoCatalogKey;
+ }
+
+ public String getIpv4OamAddress() {
+ return ipv4OamAddress;
+ }
+
+ public void setIpv4OamAddress(String ipv4OamAddress) {
+ this.ipv4OamAddress = ipv4OamAddress;
+ }
+
+ public String getIpv4Loopback0Address() {
+ return ipv4Loopback0Address;
+ }
+
+ public void setIpv4Loopback0Address(String ipv4Loopback0Address) {
+ this.ipv4Loopback0Address = ipv4Loopback0Address;
+ }
+
+ public String getNmLanV6Address() {
+ return nmLanV6Address;
+ }
+
+ public void setNmLanV6Address(String nmLanV6Address) {
+ this.nmLanV6Address = nmLanV6Address;
+ }
+
+ public String getManagementV6Address() {
+ return managementV6Address;
+ }
+
+ public void setManagementV6Address(String managementV6Address) {
+ this.managementV6Address = managementV6Address;
+ }
+
+ public Boolean getInMaint() {
+ return inMaint;
+ }
+
+ public void setInMaint(Boolean inMaint) {
+ this.inMaint = inMaint;
+ }
+
+ public Boolean getIsClosedLoopDisabled() {
+ return isClosedLoopDisabled;
+ }
+
+ public void setIsClosedLoopDisabled(Boolean isClosedLoopDisabled) {
+ this.isClosedLoopDisabled = isClosedLoopDisabled;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId= modelInvariantId;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId= modelVersionId;
+ }
+
+ public String getModelCustomizationId() {
+ return modelCustomizationId;
+ }
+
+ public void setModelCustomizationId(String modelCustomizationId) {
+ this.modelCustomizationId= modelCustomizationId;
+ }
+
+ public String getNfType() {
+ return nfType;
+ }
+
+ public void setNfType(String nfType) {
+ this.nfType = nfType;
+ }
+
+ public String getNfFunction() {
+ return nfFunction;
+ }
+
+ public void setNfFunction(String nfFunction) {
+ this.nfFunction = nfFunction;
+ }
+
+ public String getNfRole() {
+ return nfRole;
+ }
+
+ public void setNfRole(String nfRole) {
+ this.nfRole = nfRole;
+ }
+
+ public String getNfNamingCode() {
+ return nfNamingCode;
+ }
+
+ public void setNfNamingCode(String nfNamingCode) {
+ this.nfNamingCode = nfNamingCode;
+ }
+
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
+
+ public VfModules getVfModules() {
+ return vfModules;
+ }
+
+ public void setVfModules(VfModules vfModules) {
+ this.vfModules = vfModules;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("vnfId", vnfId).append("vnfName", vnfName).append("vnfName2", vnfName2).append("vnfType", vnfType).append("serviceId", serviceId).append("provStatus", provStatus).append("licenseKey", licenseKey).append("equipmentRole", equipmentRole).append("orchestrationStatus", orchestrationStatus).append("heatStackId", heatStackId).append("msoCatalogKey", msoCatalogKey).append("ipv4OamAddress", ipv4OamAddress).append("ipv4Loopback0Address", ipv4Loopback0Address).append("nmLanV6Address", nmLanV6Address).append("managementV6Address", managementV6Address).append("inMaint", inMaint).append("isClosedLoopDisabled", isClosedLoopDisabled).append("resourceVersion", resourceVersion).append("modelInvariantId", modelInvariantId).append("modelVersionId", modelVersionId).append("modelCustomizationId", modelCustomizationId).append("nfType", nfType).append("nfFunction", nfFunction).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode).append("relationshipList", relationshipList).append("vfModules", vfModules).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(modelCustomizationId).append(serviceId).append(ipv4Loopback0Address).append(vnfType).append(nfFunction).append(modelInvariantId).append(resourceVersion).append(vnfName2).append(relationshipList).append(nmLanV6Address).append(nfRole).append(nfType).append(modelVersionId).append(ipv4OamAddress).append(vnfName).append(inMaint).append(msoCatalogKey).append(provStatus).append(vfModules).append(equipmentRole).append(vnfId).append(orchestrationStatus).append(nfNamingCode).append(isClosedLoopDisabled).append(heatStackId).append(licenseKey).append(managementV6Address).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VnfInstance) == false) {
+ return false;
+ }
+ VnfInstance rhs = ((VnfInstance) other);
+ return new EqualsBuilder().append(modelCustomizationId, rhs.modelCustomizationId).append(serviceId, rhs.serviceId).append(ipv4Loopback0Address, rhs.ipv4Loopback0Address).append(vnfType, rhs.vnfType).append(nfFunction, rhs.nfFunction).append(modelInvariantId, rhs.modelInvariantId).append(resourceVersion, rhs.resourceVersion).append(vnfName2, rhs.vnfName2).append(relationshipList, rhs.relationshipList).append(nmLanV6Address, rhs.nmLanV6Address).append(nfRole, rhs.nfRole).append(nfType, rhs.nfType).append(modelVersionId, rhs.modelVersionId).append(ipv4OamAddress, rhs.ipv4OamAddress).append(vnfName, rhs.vnfName).append(inMaint, rhs.inMaint).append(msoCatalogKey, rhs.msoCatalogKey).append(provStatus, rhs.provStatus).append(vfModules, rhs.vfModules).append(equipmentRole, rhs.equipmentRole).append(vnfId, rhs.vnfId).append(orchestrationStatus, rhs.orchestrationStatus).append(nfNamingCode, rhs.nfNamingCode).append(isClosedLoopDisabled, rhs.isClosedLoopDisabled).append(heatStackId, rhs.heatStackId).append(licenseKey, rhs.licenseKey).append(managementV6Address, rhs.managementV6Address).isEquals();
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfList.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfList.java
new file mode 100644
index 0000000..e6360fb
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfList.java
@@ -0,0 +1,110 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import java.util.ArrayList;
+import java.util.List;
+import org.onap.pomba.contextbuilder.sdnc.exception.AuditError;
+import org.onap.pomba.contextbuilder.sdnc.exception.AuditException;
+
+public class VnfList {
+
+
+ @SerializedName("vnf-list")
+ @Expose
+ private List<Vnf> vnfList = new ArrayList<Vnf>();
+
+ private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
+
+ public static VnfList fromJson(String payload) throws AuditException {
+ try {
+ if (payload == null || payload.isEmpty()) {
+ throw new Exception(AuditError.JSON_EMPTY_RESPONSE);
+ }
+ return gson.fromJson(payload, VnfList.class);
+ } catch (Exception ex) {
+ throw new AuditException(AuditError.JSON_PARSE_ERROR, ex);
+ }
+ }
+
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VnfList() {
+ }
+
+ /**
+ *
+ * @param vnfList
+ */
+ public VnfList(List<Vnf> vnfList) {
+ super();
+ this.vnfList = vnfList;
+ }
+
+ public List<Vnf> getVnfList() {
+ return vnfList;
+ }
+
+ public void setVnfList(List<Vnf> vnfList) {
+ this.vnfList = vnfList;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VnfList.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("vnfList");
+ sb.append('=');
+ sb.append(((this.vnfList == null)?"<null>":this.vnfList));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.vnfList == null)? 0 :this.vnfList.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VnfList) == false) {
+ return false;
+ }
+ VnfList rhs = ((VnfList) other);
+ return ((this.vnfList == rhs.vnfList)||((this.vnfList!= null)&&this.vnfList.equals(rhs.vnfList)));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfNetwork.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfNetwork.java
new file mode 100644
index 0000000..084e4e0
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfNetwork.java
@@ -0,0 +1,161 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class VnfNetwork {
+
+ @SerializedName("network-role")
+ @Expose
+ private String networkRole;
+ @SerializedName("contrail-network-fqdn")
+ @Expose
+ private String contrailNetworkFqdn;
+ @SerializedName("network-name")
+ @Expose
+ private String networkName;
+ @SerializedName("network-id")
+ @Expose
+ private String networkId;
+ @SerializedName("neutron-id")
+ @Expose
+ private String neutronId;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VnfNetwork() {
+ }
+
+ /**
+ *
+ * @param networkRole
+ * @param networkId
+ * @param networkName
+ * @param contrailNetworkFqdn
+ * @param neutronId
+ */
+ public VnfNetwork(String networkRole, String contrailNetworkFqdn, String networkName, String networkId, String neutronId) {
+ super();
+ this.networkRole = networkRole;
+ this.contrailNetworkFqdn = contrailNetworkFqdn;
+ this.networkName = networkName;
+ this.networkId = networkId;
+ this.neutronId = neutronId;
+ }
+
+ public String getNetworkRole() {
+ return networkRole;
+ }
+
+ public void setNetworkRole(String networkRole) {
+ this.networkRole = networkRole;
+ }
+
+ public String getContrailNetworkFqdn() {
+ return contrailNetworkFqdn;
+ }
+
+ public void setContrailNetworkFqdn(String contrailNetworkFqdn) {
+ this.contrailNetworkFqdn = contrailNetworkFqdn;
+ }
+
+ public String getNetworkName() {
+ return networkName;
+ }
+
+ public void setNetworkName(String networkName) {
+ this.networkName = networkName;
+ }
+
+ public String getNetworkId() {
+ return networkId;
+ }
+
+ public void setNetworkId(String networkId) {
+ this.networkId = networkId;
+ }
+
+ public String getNeutronId() {
+ return neutronId;
+ }
+
+ public void setNeutronId(String neutronId) {
+ this.neutronId = neutronId;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VnfNetwork.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("networkRole");
+ sb.append('=');
+ sb.append(((this.networkRole == null)?"<null>":this.networkRole));
+ sb.append(',');
+ sb.append("contrailNetworkFqdn");
+ sb.append('=');
+ sb.append(((this.contrailNetworkFqdn == null)?"<null>":this.contrailNetworkFqdn));
+ sb.append(',');
+ sb.append("networkName");
+ sb.append('=');
+ sb.append(((this.networkName == null)?"<null>":this.networkName));
+ sb.append(',');
+ sb.append("networkId");
+ sb.append('=');
+ sb.append(((this.networkId == null)?"<null>":this.networkId));
+ sb.append(',');
+ sb.append("neutronId");
+ sb.append('=');
+ sb.append(((this.neutronId == null)?"<null>":this.neutronId));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.networkName == null)? 0 :this.networkName.hashCode()));
+ result = ((result* 31)+((this.networkRole == null)? 0 :this.networkRole.hashCode()));
+ result = ((result* 31)+((this.networkId == null)? 0 :this.networkId.hashCode()));
+ result = ((result* 31)+((this.contrailNetworkFqdn == null)? 0 :this.contrailNetworkFqdn.hashCode()));
+ result = ((result* 31)+((this.neutronId == null)? 0 :this.neutronId.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VnfNetwork) == false) {
+ return false;
+ }
+ VnfNetwork rhs = ((VnfNetwork) other);
+ return ((((((this.networkName == rhs.networkName)||((this.networkName!= null)&&this.networkName.equals(rhs.networkName)))&&((this.networkRole == rhs.networkRole)||((this.networkRole!= null)&&this.networkRole.equals(rhs.networkRole))))&&((this.networkId == rhs.networkId)||((this.networkId!= null)&&this.networkId.equals(rhs.networkId))))&&((this.contrailNetworkFqdn == rhs.contrailNetworkFqdn)||((this.contrailNetworkFqdn!= null)&&this.contrailNetworkFqdn.equals(rhs.contrailNetworkFqdn))))&&((this.neutronId == rhs.neutronId)||((this.neutronId!= null)&&this.neutronId.equals(rhs.neutronId))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfParameter.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfParameter.java
new file mode 100644
index 0000000..4ac602f
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfParameter.java
@@ -0,0 +1,107 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class VnfParameter {
+
+ @SerializedName("vnf-parameter-name")
+ @Expose
+ private String vnfParameterName;
+ @SerializedName("vnf-parameter-value")
+ @Expose
+ private String vnfParameterValue;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VnfParameter() {
+ }
+
+ /**
+ *
+ * @param vnfParameterValue
+ * @param vnfParameterName
+ */
+ public VnfParameter(String vnfParameterName, String vnfParameterValue) {
+ super();
+ this.vnfParameterName = vnfParameterName;
+ this.vnfParameterValue = vnfParameterValue;
+ }
+
+ public String getVnfParameterName() {
+ return vnfParameterName;
+ }
+
+ public void setVnfParameterName(String vnfParameterName) {
+ this.vnfParameterName = vnfParameterName;
+ }
+
+ public String getVnfParameterValue() {
+ return vnfParameterValue;
+ }
+
+ public void setVnfParameterValue(String vnfParameterValue) {
+ this.vnfParameterValue = vnfParameterValue;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VnfParameter.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("vnfParameterName");
+ sb.append('=');
+ sb.append(((this.vnfParameterName == null)?"<null>":this.vnfParameterName));
+ sb.append(',');
+ sb.append("vnfParameterValue");
+ sb.append('=');
+ sb.append(((this.vnfParameterValue == null)?"<null>":this.vnfParameterValue));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.vnfParameterValue == null)? 0 :this.vnfParameterValue.hashCode()));
+ result = ((result* 31)+((this.vnfParameterName == null)? 0 :this.vnfParameterName.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VnfParameter) == false) {
+ return false;
+ }
+ VnfParameter rhs = ((VnfParameter) other);
+ return (((this.vnfParameterValue == rhs.vnfParameterValue)||((this.vnfParameterValue!= null)&&this.vnfParameterValue.equals(rhs.vnfParameterValue)))&&((this.vnfParameterName == rhs.vnfParameterName)||((this.vnfParameterName!= null)&&this.vnfParameterName.equals(rhs.vnfParameterName))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfRequestInformation.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfRequestInformation.java
new file mode 100644
index 0000000..8cd4b99
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfRequestInformation.java
@@ -0,0 +1,233 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class VnfRequestInformation {
+
+ @SerializedName("vnf-name")
+ @Expose
+ private String vnfName;
+ @SerializedName("tenant")
+ @Expose
+ private String tenant;
+ @SerializedName("aic-cloud-region")
+ @Expose
+ private String aicCloudRegion;
+ @SerializedName("use-preload")
+ @Expose
+ private String usePreload;
+ @SerializedName("vnf-type")
+ @Expose
+ private String vnfType;
+ @SerializedName("vnf-id")
+ @Expose
+ private String vnfId;
+ @SerializedName("generic-vnf-type")
+ @Expose
+ private String genericVnfType;
+ @SerializedName("generic-vnf-name")
+ @Expose
+ private String genericVnfName;
+ @SerializedName("generic-vnf-id")
+ @Expose
+ private String genericVnfId;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VnfRequestInformation() {
+ }
+
+ /**
+ *
+ * @param aicCloudRegion
+ * @param vnfId
+ * @param genericVnfId
+ * @param usePreload
+ * @param vnfName
+ * @param vnfType
+ * @param genericVnfName
+ * @param tenant
+ * @param genericVnfType
+ */
+ public VnfRequestInformation(String vnfName, String tenant, String aicCloudRegion, String usePreload, String vnfType, String vnfId, String genericVnfType, String genericVnfName, String genericVnfId) {
+ super();
+ this.vnfName = vnfName;
+ this.tenant = tenant;
+ this.aicCloudRegion = aicCloudRegion;
+ this.usePreload = usePreload;
+ this.vnfType = vnfType;
+ this.vnfId = vnfId;
+ this.genericVnfType = genericVnfType;
+ this.genericVnfName = genericVnfName;
+ this.genericVnfId = genericVnfId;
+ }
+
+ public String getVnfName() {
+ return vnfName;
+ }
+
+ public void setVnfName(String vnfName) {
+ this.vnfName = vnfName;
+ }
+
+ public String getTenant() {
+ return tenant;
+ }
+
+ public void setTenant(String tenant) {
+ this.tenant = tenant;
+ }
+
+ public String getAicCloudRegion() {
+ return aicCloudRegion;
+ }
+
+ public void setAicCloudRegion(String aicCloudRegion) {
+ this.aicCloudRegion = aicCloudRegion;
+ }
+
+ public String getUsePreload() {
+ return usePreload;
+ }
+
+ public void setUsePreload(String usePreload) {
+ this.usePreload = usePreload;
+ }
+
+ public String getVnfType() {
+ return vnfType;
+ }
+
+ public void setVnfType(String vnfType) {
+ this.vnfType = vnfType;
+ }
+
+ public String getVnfId() {
+ return vnfId;
+ }
+
+ public void setVnfId(String vnfId) {
+ this.vnfId = vnfId;
+ }
+
+ public String getGenericVnfType() {
+ return genericVnfType;
+ }
+
+ public void setGenericVnfType(String genericVnfType) {
+ this.genericVnfType = genericVnfType;
+ }
+
+ public String getGenericVnfName() {
+ return genericVnfName;
+ }
+
+ public void setGenericVnfName(String genericVnfName) {
+ this.genericVnfName = genericVnfName;
+ }
+
+ public String getGenericVnfId() {
+ return genericVnfId;
+ }
+
+ public void setGenericVnfId(String genericVnfId) {
+ this.genericVnfId = genericVnfId;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VnfRequestInformation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("vnfName");
+ sb.append('=');
+ sb.append(((this.vnfName == null)?"<null>":this.vnfName));
+ sb.append(',');
+ sb.append("tenant");
+ sb.append('=');
+ sb.append(((this.tenant == null)?"<null>":this.tenant));
+ sb.append(',');
+ sb.append("aicCloudRegion");
+ sb.append('=');
+ sb.append(((this.aicCloudRegion == null)?"<null>":this.aicCloudRegion));
+ sb.append(',');
+ sb.append("usePreload");
+ sb.append('=');
+ sb.append(((this.usePreload == null)?"<null>":this.usePreload));
+ sb.append(',');
+ sb.append("vnfType");
+ sb.append('=');
+ sb.append(((this.vnfType == null)?"<null>":this.vnfType));
+ sb.append(',');
+ sb.append("vnfId");
+ sb.append('=');
+ sb.append(((this.vnfId == null)?"<null>":this.vnfId));
+ sb.append(',');
+ sb.append("genericVnfType");
+ sb.append('=');
+ sb.append(((this.genericVnfType == null)?"<null>":this.genericVnfType));
+ sb.append(',');
+ sb.append("genericVnfName");
+ sb.append('=');
+ sb.append(((this.genericVnfName == null)?"<null>":this.genericVnfName));
+ sb.append(',');
+ sb.append("genericVnfId");
+ sb.append('=');
+ sb.append(((this.genericVnfId == null)?"<null>":this.genericVnfId));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.aicCloudRegion == null)? 0 :this.aicCloudRegion.hashCode()));
+ result = ((result* 31)+((this.vnfId == null)? 0 :this.vnfId.hashCode()));
+ result = ((result* 31)+((this.genericVnfId == null)? 0 :this.genericVnfId.hashCode()));
+ result = ((result* 31)+((this.usePreload == null)? 0 :this.usePreload.hashCode()));
+ result = ((result* 31)+((this.vnfName == null)? 0 :this.vnfName.hashCode()));
+ result = ((result* 31)+((this.vnfType == null)? 0 :this.vnfType.hashCode()));
+ result = ((result* 31)+((this.genericVnfName == null)? 0 :this.genericVnfName.hashCode()));
+ result = ((result* 31)+((this.tenant == null)? 0 :this.tenant.hashCode()));
+ result = ((result* 31)+((this.genericVnfType == null)? 0 :this.genericVnfType.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VnfRequestInformation) == false) {
+ return false;
+ }
+ VnfRequestInformation rhs = ((VnfRequestInformation) other);
+ return ((((((((((this.aicCloudRegion == rhs.aicCloudRegion)||((this.aicCloudRegion!= null)&&this.aicCloudRegion.equals(rhs.aicCloudRegion)))&&((this.vnfId == rhs.vnfId)||((this.vnfId!= null)&&this.vnfId.equals(rhs.vnfId))))&&((this.genericVnfId == rhs.genericVnfId)||((this.genericVnfId!= null)&&this.genericVnfId.equals(rhs.genericVnfId))))&&((this.usePreload == rhs.usePreload)||((this.usePreload!= null)&&this.usePreload.equals(rhs.usePreload))))&&((this.vnfName == rhs.vnfName)||((this.vnfName!= null)&&this.vnfName.equals(rhs.vnfName))))&&((this.vnfType == rhs.vnfType)||((this.vnfType!= null)&&this.vnfType.equals(rhs.vnfType))))&&((this.genericVnfName == rhs.genericVnfName)||((this.genericVnfName!= null)&&this.genericVnfName.equals(rhs.genericVnfName))))&&((this.tenant == rhs.tenant)||((this.tenant!= null)&&this.tenant.equals(rhs.tenant))))&&((this.genericVnfType == rhs.genericVnfType)||((this.genericVnfType!= null)&&this.genericVnfType.equals(rhs.genericVnfType))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfTopologyIdentifier.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfTopologyIdentifier.java
new file mode 100644
index 0000000..507ae1d
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfTopologyIdentifier.java
@@ -0,0 +1,161 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class VnfTopologyIdentifier {
+
+ @SerializedName("generic-vnf-type")
+ @Expose
+ private String genericVnfType;
+ @SerializedName("service-type")
+ @Expose
+ private String serviceType;
+ @SerializedName("vnf-name")
+ @Expose
+ private String vnfName;
+ @SerializedName("generic-vnf-name")
+ @Expose
+ private String genericVnfName;
+ @SerializedName("vnf-type")
+ @Expose
+ private String vnfType;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VnfTopologyIdentifier() {
+ }
+
+ /**
+ *
+ * @param serviceType
+ * @param vnfName
+ * @param genericVnfName
+ * @param vnfType
+ * @param genericVnfType
+ */
+ public VnfTopologyIdentifier(String genericVnfType, String serviceType, String vnfName, String genericVnfName, String vnfType) {
+ super();
+ this.genericVnfType = genericVnfType;
+ this.serviceType = serviceType;
+ this.vnfName = vnfName;
+ this.genericVnfName = genericVnfName;
+ this.vnfType = vnfType;
+ }
+
+ public String getGenericVnfType() {
+ return genericVnfType;
+ }
+
+ public void setGenericVnfType(String genericVnfType) {
+ this.genericVnfType = genericVnfType;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getVnfName() {
+ return vnfName;
+ }
+
+ public void setVnfName(String vnfName) {
+ this.vnfName = vnfName;
+ }
+
+ public String getGenericVnfName() {
+ return genericVnfName;
+ }
+
+ public void setGenericVnfName(String genericVnfName) {
+ this.genericVnfName = genericVnfName;
+ }
+
+ public String getVnfType() {
+ return vnfType;
+ }
+
+ public void setVnfType(String vnfType) {
+ this.vnfType = vnfType;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VnfTopologyIdentifier.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("genericVnfType");
+ sb.append('=');
+ sb.append(((this.genericVnfType == null)?"<null>":this.genericVnfType));
+ sb.append(',');
+ sb.append("serviceType");
+ sb.append('=');
+ sb.append(((this.serviceType == null)?"<null>":this.serviceType));
+ sb.append(',');
+ sb.append("vnfName");
+ sb.append('=');
+ sb.append(((this.vnfName == null)?"<null>":this.vnfName));
+ sb.append(',');
+ sb.append("genericVnfName");
+ sb.append('=');
+ sb.append(((this.genericVnfName == null)?"<null>":this.genericVnfName));
+ sb.append(',');
+ sb.append("vnfType");
+ sb.append('=');
+ sb.append(((this.vnfType == null)?"<null>":this.vnfType));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.vnfName == null)? 0 :this.vnfName.hashCode()));
+ result = ((result* 31)+((this.serviceType == null)? 0 :this.serviceType.hashCode()));
+ result = ((result* 31)+((this.genericVnfName == null)? 0 :this.genericVnfName.hashCode()));
+ result = ((result* 31)+((this.vnfType == null)? 0 :this.vnfType.hashCode()));
+ result = ((result* 31)+((this.genericVnfType == null)? 0 :this.genericVnfType.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VnfTopologyIdentifier) == false) {
+ return false;
+ }
+ VnfTopologyIdentifier rhs = ((VnfTopologyIdentifier) other);
+ return ((((((this.vnfName == rhs.vnfName)||((this.vnfName!= null)&&this.vnfName.equals(rhs.vnfName)))&&((this.serviceType == rhs.serviceType)||((this.serviceType!= null)&&this.serviceType.equals(rhs.serviceType))))&&((this.genericVnfName == rhs.genericVnfName)||((this.genericVnfName!= null)&&this.genericVnfName.equals(rhs.genericVnfName))))&&((this.vnfType == rhs.vnfType)||((this.vnfType!= null)&&this.vnfType.equals(rhs.vnfType))))&&((this.genericVnfType == rhs.genericVnfType)||((this.genericVnfType!= null)&&this.genericVnfType.equals(rhs.genericVnfType))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfTopologyInformation.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfTopologyInformation.java
new file mode 100644
index 0000000..26ebb66
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfTopologyInformation.java
@@ -0,0 +1,127 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import java.util.ArrayList;
+import java.util.List;
+
+public class VnfTopologyInformation {
+
+ @SerializedName("vnf-topology-identifier")
+ @Expose
+ private VnfTopologyIdentifier vnfTopologyIdentifier;
+ @SerializedName("vnf-assignments")
+ @Expose
+ private VnfAssignments vnfAssignments;
+ @SerializedName("vnf-parameters")
+ @Expose
+ private List<VnfParameter> vnfParameters = new ArrayList<VnfParameter>();
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VnfTopologyInformation() {
+ }
+
+ /**
+ *
+ * @param vnfAssignments
+ * @param vnfTopologyIdentifier
+ * @param vnfParameters
+ */
+ public VnfTopologyInformation(VnfTopologyIdentifier vnfTopologyIdentifier, VnfAssignments vnfAssignments, List<VnfParameter> vnfParameters) {
+ super();
+ this.vnfTopologyIdentifier = vnfTopologyIdentifier;
+ this.vnfAssignments = vnfAssignments;
+ this.vnfParameters = vnfParameters;
+ }
+
+ public VnfTopologyIdentifier getVnfTopologyIdentifier() {
+ return vnfTopologyIdentifier;
+ }
+
+ public void setVnfTopologyIdentifier(VnfTopologyIdentifier vnfTopologyIdentifier) {
+ this.vnfTopologyIdentifier = vnfTopologyIdentifier;
+ }
+
+ public VnfAssignments getVnfAssignments() {
+ return vnfAssignments;
+ }
+
+ public void setVnfAssignments(VnfAssignments vnfAssignments) {
+ this.vnfAssignments = vnfAssignments;
+ }
+
+ public List<VnfParameter> getVnfParameters() {
+ return vnfParameters;
+ }
+
+ public void setVnfParameters(List<VnfParameter> vnfParameters) {
+ this.vnfParameters = vnfParameters;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VnfTopologyInformation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("vnfTopologyIdentifier");
+ sb.append('=');
+ sb.append(((this.vnfTopologyIdentifier == null)?"<null>":this.vnfTopologyIdentifier));
+ sb.append(',');
+ sb.append("vnfAssignments");
+ sb.append('=');
+ sb.append(((this.vnfAssignments == null)?"<null>":this.vnfAssignments));
+ sb.append(',');
+ sb.append("vnfParameters");
+ sb.append('=');
+ sb.append(((this.vnfParameters == null)?"<null>":this.vnfParameters));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.vnfAssignments == null)? 0 :this.vnfAssignments.hashCode()));
+ result = ((result* 31)+((this.vnfTopologyIdentifier == null)? 0 :this.vnfTopologyIdentifier.hashCode()));
+ result = ((result* 31)+((this.vnfParameters == null)? 0 :this.vnfParameters.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VnfTopologyInformation) == false) {
+ return false;
+ }
+ VnfTopologyInformation rhs = ((VnfTopologyInformation) other);
+ return ((((this.vnfAssignments == rhs.vnfAssignments)||((this.vnfAssignments!= null)&&this.vnfAssignments.equals(rhs.vnfAssignments)))&&((this.vnfTopologyIdentifier == rhs.vnfTopologyIdentifier)||((this.vnfTopologyIdentifier!= null)&&this.vnfTopologyIdentifier.equals(rhs.vnfTopologyIdentifier))))&&((this.vnfParameters == rhs.vnfParameters)||((this.vnfParameters!= null)&&this.vnfParameters.equals(rhs.vnfParameters))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java
new file mode 100644
index 0000000..ab39105
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VnfVm.java
@@ -0,0 +1,146 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.sdnc.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import java.util.ArrayList;
+import java.util.List;
+
+public class VnfVm {
+
+ @SerializedName("vm-type")
+ @Expose
+ private String vmType;
+ @SerializedName("vm-networks")
+ @Expose
+ private List<VmNetwork> vmNetworks = new ArrayList<VmNetwork>();
+ @SerializedName("vm-count")
+ @Expose
+ private Integer vmCount;
+ @SerializedName("vm-names")
+ @Expose
+ private List<VmName> vmNames = new ArrayList<VmName>();
+
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public VnfVm() {
+ }
+
+ /**
+ *
+ * @param vmType
+ * @param vmCount
+ * @param vmNetworks
+ * @param vmNames
+ */
+ public VnfVm(String vmType, List<VmNetwork> vmNetworks, Integer vmCount, List<VmName> vmNames) {
+ super();
+ this.vmType = vmType;
+ this.vmNetworks = vmNetworks;
+ this.vmCount = vmCount;
+ this.vmNames = vmNames;
+ }
+
+ public String getVmType() {
+ return vmType;
+ }
+
+ public void setVmType(String vmType) {
+ this.vmType = vmType;
+ }
+
+ public List<VmNetwork> getVmNetworks() {
+ return vmNetworks;
+ }
+
+ public void setVmNetworks(List<VmNetwork> vmNetworks) {
+ this.vmNetworks = vmNetworks;
+ }
+
+ public Integer getVmCount() {
+ return vmCount;
+ }
+
+ public void setVmCount(Integer vmCount) {
+ this.vmCount = vmCount;
+ }
+
+ public List<VmName> getVmNames() {
+ return vmNames;
+ }
+
+ public void setVmNames(List<VmName> vmNames) {
+ this.vmNames = vmNames;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(VnfVm.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
+ sb.append("vmType");
+ sb.append('=');
+ sb.append(((this.vmType == null)?"<null>":this.vmType));
+ sb.append(',');
+ sb.append("vmNetworks");
+ sb.append('=');
+ sb.append(((this.vmNetworks == null)?"<null>":this.vmNetworks));
+ sb.append(',');
+ sb.append("vmCount");
+ sb.append('=');
+ sb.append(((this.vmCount == null)?"<null>":this.vmCount));
+ sb.append(',');
+ sb.append("vmNames");
+ sb.append('=');
+ sb.append(((this.vmNames == null)?"<null>":this.vmNames));
+ sb.append(',');
+ if (sb.charAt((sb.length()- 1)) == ',') {
+ sb.setCharAt((sb.length()- 1), ']');
+ } else {
+ sb.append(']');
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 1;
+ result = ((result* 31)+((this.vmType == null)? 0 :this.vmType.hashCode()));
+ result = ((result* 31)+((this.vmCount == null)? 0 :this.vmCount.hashCode()));
+ result = ((result* 31)+((this.vmNames == null)? 0 :this.vmNames.hashCode()));
+ result = ((result* 31)+((this.vmNetworks == null)? 0 :this.vmNetworks.hashCode()));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof VnfVm) == false) {
+ return false;
+ }
+ VnfVm rhs = ((VnfVm) other);
+ return (((((this.vmType == rhs.vmType)||((this.vmType!= null)&&this.vmType.equals(rhs.vmType)))&&((this.vmCount == rhs.vmCount)||((this.vmCount!= null)&&this.vmCount.equals(rhs.vmCount))))&&((this.vmNames == rhs.vmNames)||((this.vmNames!= null)&&this.vmNames.equals(rhs.vmNames))))&&((this.vmNetworks == rhs.vmNetworks)||((this.vmNetworks!= null)&&this.vmNetworks.equals(rhs.vmNetworks))));
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringService.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringService.java
index 6ead761..ebb3277 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringService.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringService.java
@@ -19,10 +19,11 @@
package org.onap.pomba.contextbuilder.sdnc.service;
+import javax.servlet.http.HttpServletRequest;
import org.onap.pomba.common.datatypes.ModelContext;
import org.onap.pomba.contextbuilder.sdnc.exception.AuditException;
public interface SpringService {
- public ModelContext getContext(String serviceInstanceId, String transactionId) throws AuditException;
+ public ModelContext getContext(HttpServletRequest request, String serviceInstanceId, String transactionId, String partnerName) throws AuditException;
public String getSdncAuthoriztion();
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringServiceImpl.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringServiceImpl.java
index b19c24c..b21a76b 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringServiceImpl.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/SpringServiceImpl.java
@@ -18,22 +18,29 @@
package org.onap.pomba.contextbuilder.sdnc.service;
+import java.net.InetAddress;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.UUID;
+import javax.servlet.http.HttpServletRequest;
import org.apache.camel.ProducerTemplate;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
+import org.onap.aai.restclient.client.RestClient;
import org.onap.pomba.common.datatypes.ModelContext;
import org.onap.pomba.contextbuilder.sdnc.exception.AuditException;
-import org.onap.pomba.contextbuilder.sdnc.service.rs.RestService;
import org.onap.pomba.contextbuilder.sdnc.model.ServiceEntity;
+import org.onap.pomba.contextbuilder.sdnc.service.rs.RestService;
+import org.onap.pomba.contextbuilder.sdnc.util.RestUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import org.onap.pomba.contextbuilder.sdnc.util.RestUtil;
-import org.onap.aai.restclient.client.RestClient;
@Service
public class SpringServiceImpl implements SpringService {
+
private static Logger log = LoggerFactory.getLogger(RestService.class);
@Autowired
@@ -41,8 +48,6 @@ public class SpringServiceImpl implements SpringService {
private KieContainer kieContainer;
@Autowired
private ProducerTemplate producerTemplate;
-
- //AAI related
@Autowired
private String aaiBasicAuthorization;
@Autowired
@@ -53,24 +58,45 @@ public class SpringServiceImpl implements SpringService {
private String aaiPathToSearchNodeQuery;
@Autowired
private String aaiPathToCustomerQuery;
-
- public SpringServiceImpl() {
- // needed for instantiation
- }
-
@Autowired
public SpringServiceImpl(KieContainer kieContainer) {
this.kieContainer = kieContainer;
+ }
+ public SpringServiceImpl() {
+ // needed for instantiation
}
+ public static final String APP_NAME = "SdncContextBuilder";
+ public static final String MDC_REQUEST_ID = "RequestId";
+ public static final String MDC_SERVER_FQDN = "ServerFQDN";
+ public static final String MDC_SERVICE_NAME = "ServiceName";
+ public static final String MDC_PARTNER_NAME = "PartnerName";
+ public static final String MDC_START_TIME = "StartTime";
+ public static final String MDC_SERVICE_INSTANCE_ID = "ServiceInstanceId";
+ public static final String MDC_INVOCATION_ID = "InvocationID";
+ public static final String MDC_CLIENT_ADDRESS = "ClientAddress";
+ public static final String MDC_STATUS_CODE = "StatusCode";
+ public static final String MDC_RESPONSE_CODE = "ResponseCode";
+ public static final String MDC_INSTANCE_UUID = "InstanceUUID";
+
+ private static UUID instanceUUID = UUID.randomUUID();
+
@Override
- public ModelContext getContext(String serviceInstanceId, String transactionId) throws AuditException {
+ public ModelContext getContext(HttpServletRequest request, String serviceInstanceId, String transactionId, String partnerName) throws AuditException {
+
+ String remoteAddress = request.getRemoteAddr() != null ? request.getRemoteAddr() : null;
+ initMDC(transactionId, partnerName, serviceInstanceId, remoteAddress);
+
ModelContext context = null;
// Call AAI system to populate ServiceData
ServiceEntity serviceEntity = RestUtil.getServiceEntity(aaiClient, aaiBaseUrl, aaiBasicAuthorization, aaiPathToSearchNodeQuery, aaiPathToCustomerQuery, serviceInstanceId, transactionId);
+ if (null == serviceEntity) {
+ return context;
+ }
+
processApiMappingRules(serviceEntity);
log.info("SDN-C determined API: " + serviceEntity.getApiName());
@@ -79,6 +105,27 @@ public class SpringServiceImpl implements SpringService {
return context;
}
+ private void initMDC(String requestId, String partnerName, String serviceInstanceId, String remoteAddress) {
+ MDC.clear();
+ MDC.put(MDC_REQUEST_ID, requestId);
+ MDC.put(MDC_SERVICE_NAME, APP_NAME);
+ MDC.put(MDC_SERVICE_INSTANCE_ID, serviceInstanceId);
+ MDC.put(MDC_PARTNER_NAME, partnerName);
+ MDC.put(MDC_CLIENT_ADDRESS, remoteAddress);
+ MDC.put(MDC_START_TIME, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(new Date()));
+ MDC.put(MDC_INVOCATION_ID, UUID.randomUUID().toString());
+ MDC.put(MDC_INSTANCE_UUID, instanceUUID.toString());
+
+ try {
+ MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getCanonicalHostName());
+ } catch (Exception e) {
+ // If, for some reason we are unable to get the canonical host name,
+ // we
+ // just want to leave the field null.
+ log.info("Could not get canonical host name for " + MDC_SERVER_FQDN + ", leaving field null");
+ }
+ }
+
private void processApiMappingRules(ServiceEntity serviceData){
KieSession kieSession = kieContainer.newKieSession();
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestService.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestService.java
index ec1581a..efab905 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestService.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestService.java
@@ -22,6 +22,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
+import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@@ -33,12 +34,12 @@ import javax.ws.rs.core.Response;
@Api
-@Path("/service")
+@Path("/")
@Produces({MediaType.APPLICATION_JSON})
public interface RestService {
@GET
- @Path("/context")
+ @Path("service/context")
@Produces({MediaType.APPLICATION_JSON})
@ApiOperation(
value = "Respond SDNCContext Model Data",
@@ -52,7 +53,29 @@ public interface RestService {
@ApiResponse(code = 404, message = "Service not available"),
@ApiResponse(code = 500, message = "Unexpected Runtime error")
})
- public Response getContext(@Context HttpHeaders headers,
- @QueryParam("serviceInstanceId") String serviceInstanceId
+ public Response getContext(@Context HttpServletRequest request,
+ @Context HttpHeaders headers,
+ @QueryParam("serviceInstanceId") String serviceInstanceId
);
-} \ No newline at end of file
+
+ @GET
+ @Path("{version:[vV][1-5]}/service/context")
+ @Produces({MediaType.APPLICATION_JSON})
+ @ApiOperation(
+ value = "Respond SDNCContext v1 - v5 Model Data",
+ notes = "Returns a JSON object which represents the SDNCConetxt V1 model data",
+ response = Response.class
+ )
+ @ApiResponses(
+ value = {
+ @ApiResponse(code = 200, message = "OK"),
+ @ApiResponse(code = 400, message = "Bad Request"),
+ @ApiResponse(code = 404, message = "Service not available"),
+ @ApiResponse(code = 500, message = "Unexpected Runtime error")
+ })
+ public Response getV1Context(@Context HttpServletRequest request,
+ @Context HttpHeaders headers,
+ @QueryParam("serviceInstanceId") String serviceInstanceId
+ );
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestServiceImpl.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestServiceImpl.java
index d3b6378..a70012f 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestServiceImpl.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/service/rs/RestServiceImpl.java
@@ -20,6 +20,7 @@ package org.onap.pomba.contextbuilder.sdnc.service.rs;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
@@ -43,20 +44,22 @@ public class RestServiceImpl implements RestService {
}
@Override
- public Response getContext(HttpHeaders headers, String serviceInstanceId) {
+ public Response getContext(HttpServletRequest request, HttpHeaders headers, String serviceInstanceId) {
Response response = null;
ModelContext sdncContext= null;
Gson gson = new GsonBuilder().create();
try {
- // Do some validation on Http headers and URL parameters
- RestUtil.validateHeader(headers, service.getSdncAuthoriztion());
+ // Validate URL parameters
RestUtil.validateURL(serviceInstanceId);
+ // Validate Headers and extract Partner Name
+ String partnerName = RestUtil.validateHeader(headers, service.getSdncAuthoriztion());
+
// Keep the same transaction id for logging purposeString transactionId
- String transactionId = RestUtil.extractTranIdHeader(headers);
+ String transactionId = RestUtil.extractTranactionIdHeader(headers);
- sdncContext = service.getContext(serviceInstanceId, transactionId);
+ sdncContext = service.getContext(request, serviceInstanceId, transactionId, partnerName);
if (sdncContext==null) {
// Return empty JSON
@@ -78,4 +81,10 @@ public class RestServiceImpl implements RestService {
return response;
}
+ @Override
+ public Response getV1Context(HttpServletRequest request, HttpHeaders headers, String serviceInstanceId) {
+ return getContext(request, headers, serviceInstanceId);
+ }
+
+
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java
index 8701c89..c29374b 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java
@@ -21,36 +21,51 @@ package org.onap.pomba.contextbuilder.sdnc.util;
import com.bazaarvoice.jolt.Chainr;
import com.bazaarvoice.jolt.JsonUtils;
import com.google.gson.Gson;
+import com.sun.jersey.core.util.MultivaluedMapImpl;
import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.ws.rs.client.Client;
import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
+import org.json.JSONArray;
+import org.json.JSONException;
import org.json.JSONObject;
+import org.onap.aai.restclient.client.OperationResult;
+import org.onap.aai.restclient.client.RestClient;
import org.onap.pomba.common.datatypes.ModelContext;
+import org.onap.pomba.common.datatypes.Service;
+import org.onap.pomba.common.datatypes.VF;
+import org.onap.pomba.common.datatypes.VFModule;
+import org.onap.pomba.common.datatypes.VNFC;
+import org.onap.pomba.contextbuilder.sdnc.exception.AuditError;
import org.onap.pomba.contextbuilder.sdnc.exception.AuditException;
+import org.onap.pomba.contextbuilder.sdnc.model.ServiceEntity;
+import org.onap.pomba.contextbuilder.sdnc.model.VfModule;
+import org.onap.pomba.contextbuilder.sdnc.model.VmName;
+import org.onap.pomba.contextbuilder.sdnc.model.Vnf;
+import org.onap.pomba.contextbuilder.sdnc.model.VnfInstance;
+import org.onap.pomba.contextbuilder.sdnc.model.VnfList;
+import org.onap.pomba.contextbuilder.sdnc.model.VnfTopologyIdentifier;
+import org.onap.pomba.contextbuilder.sdnc.model.VnfVm;
import org.onap.pomba.contextbuilder.sdnc.service.rs.RestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.onap.aai.restclient.client.OperationResult;
-import org.onap.aai.restclient.client.RestClient;
-import javax.ws.rs.core.MediaType;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import java.util.Map;
-import java.util.Collections;
-import javax.ws.rs.core.MultivaluedMap;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.onap.pomba.contextbuilder.sdnc.model.ServiceEntity;
public class RestUtil {
private static Logger log = LoggerFactory.getLogger(RestService.class);
- public static final String INTERNAL_SERVER_ERROR = "Internal Server Error";
-
// HTTP headers
public static final String TRANSACTION_ID = "X-TransactionId";
public static final String FROM_APP_ID = "X-FromAppId";
@@ -59,18 +74,19 @@ public class RestUtil {
// AAI related
private static final String APP_NAME = "sdncCtxBuilder";
private static final String EMPTY_JSON_STRING = "{}";
- private static final String JSON_ATT_RESOURCE_TYPE = "resource-type";
- private static final String JSON_ATT_RESOURCE_LINK = "resource-link";
+ private static final String JSON_RESOURCE_TYPE = "resource-type";
+ private static final String JSON_RESOURCE_LINK = "resource-link";
+ private static final String JSON_GLOBAL_CUSTOMER_ID = "global-customer-id";
+ private static final String JSON_SUBSCRIBER_TYPE = "subscriber-type";
+ private static final String JSON_SUBSCRIBER_NAME = "subscriber-name";
private static final String RESULT_DATA = "result-data";
private static final String CATALOG_SERVICE_INSTANCE = "service-instance";
private static final String CUSTOMER_ID_STRING = "/customers/customer/";
private static final String SERVICE_TYPE_STRING = "/service-subscriptions/service-subscription/";
- private static final String CUSTOMER = "customer";
- private static final String JSON_ATT_GLOBAL_CUSTOMER_ID = "global-customer-id";
- private static final String JSON_ATT_SUBSCRIBER_TYPE = "subscriber-type";
- private static final String JSON_ATT_SUBSCRIBER_NAME = "subscriber-name";
private static final String FORWARD_SLASH = "/";
+ // SDNC vnf Json Path
+ private static final String specPath = "config/vnflist.spec";
// Parameters for Query SDNC Model Data REST API URL
private static final String SERVICE_INSTANCE_ID = "serviceInstanceId";
@@ -89,7 +105,11 @@ public class RestUtil {
}
- public static void validateHeader(HttpHeaders headers, String sdncCtxBuilderBasicAuthorization) throws AuditException {
+ public static String validateHeader(HttpHeaders headers, String sdncCtxBuilderBasicAuthorization) throws AuditException {
+
+ /*
+ * Validate that the headers are there and return the FROM_APP_ID
+ */
String fromAppId = headers.getRequestHeaders().getFirst(FROM_APP_ID);
if((fromAppId == null) || fromAppId.trim().isEmpty()) {
@@ -103,13 +123,15 @@ public class RestUtil {
if((!headerAuthorization.contentEquals(sdncCtxBuilderBasicAuthorization))) {
throw new AuditException("Failed Basic "+ AUTHORIZATION, Status.UNAUTHORIZED);
}
+
+ return fromAppId;
}
/*
* The purpose is to keep same transaction Id from north bound interface to south bound interface
*/
- public static String extractTranIdHeader(HttpHeaders headers) {
+ public static String extractTranactionIdHeader(HttpHeaders headers) {
String transactionId = null;
transactionId = headers.getRequestHeaders().getFirst(TRANSACTION_ID);
if((transactionId == null) || transactionId.trim().isEmpty()) {
@@ -133,14 +155,55 @@ public class RestUtil {
*/
public static String getSdncGenericResource(Client sdncClient, String sdncBaseUrl, String authorization, String sdncGenericResourcePath,
String serviceInstaceId) throws AuditException {
- String vnfSdncURL = sdncBaseUrl+generateSdncInstanceURL(sdncGenericResourcePath, serviceInstaceId);
- // send rest request to SDNC VNF-API
- return getSdncResource(sdncClient, vnfSdncURL, authorization);
+ String genericResourceSdncURL = sdncBaseUrl+generateSdncInstanceURL(sdncGenericResourcePath, serviceInstaceId);
+ // send rest request to SDNC GENERIC-RESOURCE-API
+ return getSdncResource(sdncClient, genericResourceSdncURL, authorization);
+ }
+
+ /**
+ * For each AAI VnfInstance, use the AAI Vf_module_id to make a rest call to SDNC VNF-API to create a list of all SDNC Vnfs.
+ * The URL for VNF-API is https://<SDN-C_HOST_NAME>:8543/restconf/config/VNF-API:vnfs/vnf-list/<vnf-id>
+ * @param sdncClient
+ * @param sdncBaseUrl
+ * @param sdncVnfInstancePath
+ * @param transactionId
+ * @param genericVNFPayload
+ * @param vnfInstance
+ * @return
+ * @throws AuditException
+ */
+ public static Map<String,List<Vnf>> getSdncVnfList(Client sdncClient, String sdncBaseUrl, String sdncVnfInstancePath,
+ String authorization, List<VnfInstance> vnfList) throws AuditException {
+
+ // define map [key: vnf-id, value: list of SDNC vnfs, which in fact are vf_modules]
+ Map<String,List<Vnf>> sdncVnfMap = new HashMap<String,List<Vnf>>();
+ for (VnfInstance vnfInstance: vnfList) {
+ if (vnfInstance.getVfModules() != null) {
+ List<Vnf> sdncVnfList = new ArrayList<>();
+ List<VfModule> vfModuleList = vnfInstance.getVfModules().getVfModule();
+ if (vfModuleList != null && !vfModuleList.isEmpty()) {
+ for (VfModule vfModuleInstance : vfModuleList) {
+ // create SDNC VNF-API url using AAI VnfInstance VfModule Vf_module_id
+ String vnfSdncURL = sdncBaseUrl+generateSdncInstanceURL(sdncVnfInstancePath, vfModuleInstance.getVfModuleId());
+ // send rest request to SDNC VNF-API
+ String sndcVNFPayload = getSdncResource(sdncClient, vnfSdncURL, authorization);
+ if (isEmptyJson(sndcVNFPayload)) {
+ log.info("VNF with vf-module-id is not found from SDNC");
+ } else {
+ List<Vnf> vnfsList = extractVnfList(sndcVNFPayload);
+ sdncVnfList.addAll(vnfsList);
+ }
+ }
+ }
+ sdncVnfMap.put(vnfInstance.getVnfId(),sdncVnfList);
+ }
+ }
+ return sdncVnfMap;
}
- public static ModelContext transform(String sdncResponse) {
- List<Object> jsonSpec = JsonUtils.filepathToList("config/sdnccontextbuilder.spec");
+ public static ModelContext transformGenericResource(String sdncResponse, String specPath) {
+ List<Object> jsonSpec = JsonUtils.filepathToList(specPath);
Object jsonInput = JsonUtils.jsonToObject(sdncResponse);
Chainr chainr = Chainr.fromSpec(jsonSpec);
Object transObject = chainr.transform(jsonInput);
@@ -149,9 +212,66 @@ public class RestUtil {
}
+ /**
+ * Transform the AAI and SDNC models to the audit common model
+ * @param aaiVnfLst
+ * @param sdncVnfMap
+ * @return
+ * @throws AuditException
+ */
+ public static ModelContext transformVnfList(List<VnfInstance> aaiVnfLst, Map<String,List<Vnf>> sdncVnfMap) {
+ ModelContext context = new ModelContext();
+ Service service = new Service();
+ List<VF> vfList = new ArrayList<>();
+
+ // Initialize common model members to null
+ service.setInvariantUuid("null");
+ service.setUuid("null");
+ service.setName("null");
+
+ for(VnfInstance aaiVnfInstance : aaiVnfLst) {
+ VF vf = new VF();
+ // Initialize common model members to null
+ vf.setName("null");
+ vf.setType("null");
+ vf.setInvariantUuid("null");
+ vf.setUuid("null");
+ List<Vnf> sdncVnfList = sdncVnfMap.get(aaiVnfInstance.getVnfId());
+ try {
+ // Set the common model VF name and type from the SDNC topology info
+ VnfTopologyIdentifier vnfTopologyId = null;
+ if (sdncVnfList != null && !sdncVnfList.isEmpty()) {
+ for(Vnf sdncVnf : sdncVnfList) {
+ vnfTopologyId = sdncVnf.getServiceData().getVnfTopologyInformation().getVnfTopologyIdentifier();
+ if (vf.getName().contentEquals("null")) {
+ vf.setName(vnfTopologyId.getGenericVnfName());
+ }
+ if (vf.getType().contentEquals("null")) {
+ vf.setType(vnfTopologyId.getGenericVnfType());
+ }
+ }
+ }
+ } catch (Exception e) {
+ log.info(e.getMessage());
+ }
+ // Get the common model list of VFModule from the SDNC VNF List
+ List<VFModule> vfmoduleLst = getVfModuleList(aaiVnfInstance, sdncVnfList);
+ vf.setVfModules(vfmoduleLst);
+
+ // Get the common model list of VNFC from the SDNC Vnf
+ List<VNFC> vnfcList = getVnfcList(sdncVnfList);
+ vf.setVnfcs(vnfcList);
+ vfList.add(vf);
+ }
- private static String getSdncResource(Client sdncClient, String url, String authorization) throws AuditException {
+ context.setService(service);
+ context.setVfs(vfList);
+ return context;
+ }
+
+ public static String getSdncResource(Client sdncClient, String url, String authorization) throws AuditException {
+ log.info("SDNC GET request at url = " + url);
Response response = sdncClient.target(url).request()
.header("Accept", "application/json")
.header(AUTHORIZATION, authorization).get();
@@ -164,7 +284,7 @@ public class RestUtil {
return new JSONObject().toString();
} else {
- throw new AuditException(INTERNAL_SERVER_ERROR + " with " + response.getStatus());
+ throw new AuditException(AuditError.INTERNAL_SERVER_ERROR + " with " + response.getStatus());
}
}
@@ -191,10 +311,10 @@ public class RestUtil {
String aaiPathToSearchNodeQuery,
String aaiPathToCustomerQuery,
String serviceInstanceId,
- String transactionId)throws AuditException {
+ String transactionId) throws AuditException {
- String obtainResourceLink_url = generateUrl_ForResourceLink(aaiBaseUrl, aaiPathToSearchNodeQuery, serviceInstanceId);
- String aaiResourceData = getAaiResource(aaiClient, obtainResourceLink_url, aaiBasicAuthorization, transactionId, MediaType.valueOf(MediaType.APPLICATION_JSON));
+ String getResourceLinkUrl = generateAaiUrl(aaiBaseUrl, aaiPathToSearchNodeQuery, serviceInstanceId);
+ String aaiResourceData = getAaiResource(aaiClient, getResourceLinkUrl, aaiBasicAuthorization, transactionId, MediaType.valueOf(MediaType.APPLICATION_JSON));
// Handle the case if the service instance is not found in AAI
if (isEmptyJson(aaiResourceData)) {
@@ -203,22 +323,23 @@ public class RestUtil {
return null;
}
- String resourceLink = extractResourceLinkBasedOnServiceInstance(aaiResourceData, CATALOG_SERVICE_INSTANCE);
+ String resourceLink = extractResourceLink(aaiResourceData, CATALOG_SERVICE_INSTANCE);
ServiceEntity serviceEntityObj = createServiceEntityObj (resourceLink); //customerId and serviceType are updated here.
if (serviceEntityObj != null) {
- serviceEntityObj.setServiceInstanceId(serviceInstanceId);
- String customerId = serviceEntityObj.getCustomerId();
- // Obtain customerType and customerName
- String obtainCustomer_url = generateUrl_ForCustomer (aaiBaseUrl, aaiPathToCustomerQuery, customerId);
- String aaiCustomerData = getAaiResource(aaiClient, obtainCustomer_url, aaiBasicAuthorization, transactionId, MediaType.valueOf(MediaType.APPLICATION_JSON));
- if (isEmptyJson(aaiCustomerData)) {
- log.info(" Customer name {} is not found from AAI", customerId);
- // Only return the empty Json on the root level. i.e service instance
- throw new AuditException(INTERNAL_SERVER_ERROR + ": Customer ID cannot be found from AAI :" + customerId);
- }
- // Update customerType and customerName to the existing serviceEntityObj
- updateServiceEntityObj ( aaiCustomerData , serviceEntityObj);
+ serviceEntityObj.setTransactionId(transactionId);
+ serviceEntityObj.setServiceInstanceId(serviceInstanceId);
+ String customerId = serviceEntityObj.getCustomerId();
+ // Obtain customerType and customerName
+ String getCustomerUrl = generateAaiUrl (aaiBaseUrl, aaiPathToCustomerQuery, customerId);
+ String aaiCustomerData = getAaiResource(aaiClient, getCustomerUrl, aaiBasicAuthorization, transactionId, MediaType.valueOf(MediaType.APPLICATION_JSON));
+ if (isEmptyJson(aaiCustomerData)) {
+ log.info(" Customer name {} is not found from AAI", customerId);
+ // Only return the empty Json on the root level. i.e service instance
+ throw new AuditException(AuditError.INTERNAL_SERVER_ERROR + ": Customer ID cannot be found from AAI :" + customerId);
+ }
+ // Update customerType and customerName to the existing serviceEntityObj
+ updateServiceEntityObj ( aaiCustomerData , serviceEntityObj);
}
return serviceEntityObj;
@@ -228,15 +349,10 @@ public class RestUtil {
return (serviceInstancePayload.equals(EMPTY_JSON_STRING));
}
- private static String generateUrl_ForResourceLink (String aaiBaseURL, String aaiPathToSearchNodeQuery ,String serviceInstanceId) {
- return aaiBaseURL + aaiPathToSearchNodeQuery + serviceInstanceId;
+ public static String generateAaiUrl (String aaiBaseURL, String aaiPathToCustomerQuery, String parameter) {
+ return aaiBaseURL + aaiPathToCustomerQuery + (parameter != null ? parameter : "");
}
- private static String generateUrl_ForCustomer (String aaiBaseURL, String aaiPathToCustomerQuery ,String customerId) {
- return aaiBaseURL + aaiPathToCustomerQuery + customerId;
- }
-
- @SuppressWarnings("unchecked")
private static Map<String, List<String>> buildHeaders(String aaiBasicAuthorization, String transactionId) {
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
headers.put(TRANSACTION_ID, Collections.singletonList(transactionId));
@@ -245,9 +361,9 @@ public class RestUtil {
return headers;
}
- private static String getAaiResource(RestClient client, String url, String aaiBasicAuthorization, String transId, MediaType mediaType)
+ public static String getAaiResource(RestClient client, String url, String aaiBasicAuthorization, String transactionId, MediaType mediaType)
throws AuditException {
- OperationResult result = client.get(url, buildHeaders(aaiBasicAuthorization, transId), MediaType.valueOf(MediaType.APPLICATION_JSON));
+ OperationResult result = client.get(url, buildHeaders(aaiBasicAuthorization, transactionId), MediaType.valueOf(MediaType.APPLICATION_JSON));
if (result.getResultCode() == 200) {
return result.getResult();
@@ -257,7 +373,7 @@ public class RestUtil {
return new JSONObject().toString();
} else {
- throw new AuditException(INTERNAL_SERVER_ERROR + " with " + result.getFailureCause());
+ throw new AuditException(AuditError.INTERNAL_SERVER_ERROR + " with " + result.getFailureCause());
}
}
@@ -272,7 +388,7 @@ public class RestUtil {
* ]
* }
*/
- private static String extractResourceLinkBasedOnServiceInstance(String payload, String catalog) throws AuditException {
+ private static String extractResourceLink(String payload, String catalog) throws AuditException {
String resourceLink = null;
log.info("Fetching the resource-link based on resource-type=" + catalog);
@@ -281,8 +397,8 @@ public class RestUtil {
if (result_data_list != null) {
for (int i = 0; i < result_data_list.length(); i++) {
JSONObject obj = result_data_list.optJSONObject(i);
- if (obj.has(JSON_ATT_RESOURCE_TYPE) && (obj.getString(JSON_ATT_RESOURCE_TYPE).equals(catalog) )) {
- resourceLink = obj.getString(JSON_ATT_RESOURCE_LINK);
+ if (obj.has(JSON_RESOURCE_TYPE) && (obj.getString(JSON_RESOURCE_TYPE).equals(catalog) )) {
+ resourceLink = obj.getString(JSON_RESOURCE_LINK);
log.info(resourceLink);
return resourceLink;
}
@@ -290,7 +406,7 @@ public class RestUtil {
}
} catch (JSONException e) {
log.error(e.getMessage());
- throw new AuditException("Json Reader Parse Error " + e.getMessage());
+ throw new AuditException(AuditError.JSON_PARSE_ERROR + e.getMessage());
}
log.warn("resource-link CANNOT be found: ", payload );
@@ -298,6 +414,7 @@ public class RestUtil {
return resourceLink;
}
+
/*
* Extract the "subscriber-name" and "subscriber-type" from Json payload. For example
* {
@@ -316,9 +433,9 @@ public class RestUtil {
try {
JSONObject obj = new JSONObject (payload);
- if (obj.has(JSON_ATT_GLOBAL_CUSTOMER_ID) && (obj.getString(JSON_ATT_GLOBAL_CUSTOMER_ID).equals(customerId) )) {
- serviceEntityObj.setCustomerType(obj.getString(JSON_ATT_SUBSCRIBER_TYPE));
- serviceEntityObj.setCustomerName(obj.getString(JSON_ATT_SUBSCRIBER_NAME));
+ if (obj.has(JSON_GLOBAL_CUSTOMER_ID) && (obj.getString(JSON_GLOBAL_CUSTOMER_ID).equals(customerId) )) {
+ serviceEntityObj.setCustomerType(obj.getString(JSON_SUBSCRIBER_TYPE));
+ serviceEntityObj.setCustomerName(obj.getString(JSON_SUBSCRIBER_NAME));
return;
}
} catch (JSONException e) {
@@ -353,9 +470,106 @@ public class RestUtil {
return serviceEntity;
}
+
+ /*
+ * Extract the vnf-list from the Json payload.
+ */
+ private static List<Vnf> extractVnfList(String payload) throws AuditException {
+ List<Object> jsonSpec = JsonUtils.filepathToList(specPath);
+ Object jsonInput = JsonUtils.jsonToObject(payload);
+ Chainr chainr = Chainr.fromSpec(jsonSpec);
+ Object transObject = chainr.transform(jsonInput);
+ String vnfListString = JsonUtils.toPrettyJsonString(transObject);
+ VnfList vnfList = VnfList.fromJson(vnfListString);
+ return vnfList.getVnfList();
+ }
+
private static String abstractStrInfo (String origStr, String matchStr) {
String after = origStr.substring( origStr.indexOf(matchStr) + matchStr.length());
return after.substring(0, after.indexOf(FORWARD_SLASH));
}
+
+ /**
+ * Get the common model list of AAI exist in SDNC per each (AAI GenericVNF > vf-modules > vf-module > model-version-id )
+ * @param aaiVnf
+ * @param sdncVnfList
+ * @return
+ * @throws AuditException
+ */
+ private static List<VFModule> getVfModuleList(VnfInstance aaiVnf, List<Vnf> sdncVnfList) {
+ List<VFModule> vfmoduleLst = new ArrayList<>();
+ if (aaiVnf.getVfModules() != null && aaiVnf.getVfModules().getVfModule() != null ) {
+ ConcurrentMap<String, AtomicInteger> vnfModulemap = buildMaxInstanceMap(aaiVnf.getVfModules().getVfModule()) ;
+ for (Map.Entry<String, AtomicInteger> entry : vnfModulemap.entrySet()) {
+ String modelVersionId = entry.getKey();
+ for (Vnf sdncVnf : sdncVnfList) {
+ if ( sdncVnf.getVnfId().equals(modelVersionId)) {
+ VFModule vfModule = new VFModule();
+ vfModule.setUuid(modelVersionId);
+ vfModule.setMaxInstances(entry.getValue().intValue());
+ vfmoduleLst.add(vfModule);
+ }
+ }
+ }
+ }
+ log.debug("The size of vfmoduleLst:"+ vfmoduleLst.size());
+ return vfmoduleLst;
+ }
+
+ /*
+ * Build the map with key (model_version_id) and with the max occurrences of the value in the map
+ * @param vf_module_List
+ * @return
+ */
+ private static ConcurrentMap<String, AtomicInteger> buildMaxInstanceMap(List<VfModule> vfModuleList) {
+
+ ConcurrentMap<String, AtomicInteger> map = new ConcurrentHashMap<>();
+
+ for (VfModule vfModule: vfModuleList) {
+ String vfModuleId = vfModule.getVfModuleId();
+ map.putIfAbsent(vfModuleId, new AtomicInteger(0));
+ map.get(vfModuleId).incrementAndGet();
+ }
+ return map;
+ }
+
+ /*
+ * Get the common model list of VNFC from the SDNC Vnfs
+ * @param sdncVnfMap
+ * @return
+ */
+ private static List<VNFC> getVnfcList(List<Vnf> sdncVnfList) {
+ List<VNFC> vnfcList = new ArrayList<>();
+ if (sdncVnfList != null && !sdncVnfList.isEmpty()) {
+ for (Vnf sdncVnf : sdncVnfList) {
+ try {
+ List<VnfVm> sdncVnfVmLst = sdncVnf.getServiceData().getVnfTopologyInformation().getVnfAssignments().getVnfVms();
+ if (sdncVnfVmLst != null && !sdncVnfVmLst.isEmpty()) {
+ for (VnfVm sdncVnfVm : sdncVnfVmLst) {
+ List<VmName> sdncVmNameLst = sdncVnfVm.getVmNames();
+ if (sdncVmNameLst != null && !sdncVmNameLst.isEmpty()) {
+ for (VmName sdncVmName : sdncVmNameLst) {
+ VNFC vnfc = new VNFC();
+ // Initialize common model members to null
+ vnfc.setInvariantUuid("null");
+ vnfc.setUuid("null");
+ vnfc.setType(sdncVnfVm.getVmType() == null ? "null" : sdncVnfVm.getVmType());
+ vnfc.setName(sdncVmName.getVmName() == null ? "null" : sdncVmName.getVmName());
+ vnfcList.add(vnfc);
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ log.info(e.getMessage());
+ }
+ }
+ }
+ log.debug("The size of vnfcList:"+ vnfcList.size());
+ return vnfcList;
+ }
+
+
+
}