From 38f720752af4d4aad8c4e467a288d9048659f688 Mon Sep 17 00:00:00 2001 From: Rob Daugherty Date: Wed, 14 Mar 2018 02:07:32 -0400 Subject: AT&T 1712 and 1802 release code This is code from AT&T's 1712 and 1802 releases. Change-Id: Ie1e85851e94bc66c4d9514a0226c221939531a04 Issue-ID: SO-425 Signed-off-by: Rob Daugherty --- adapters/mso-catalog-db-adapter/pom.xml | 105 ++++----------------- .../catalogdb/catalogrest/CatalogQuery.java | 2 +- .../catalogrest/CatalogQueryException.java | 3 - .../catalogrest/CatalogQueryExceptionCommon.java | 6 +- .../QueryAllottedResourceCustomization.java | 28 +++--- .../catalogrest/QueryServiceMacroHolder.java | 14 +-- .../catalogrest/QueryServiceNetworks.java | 2 - .../catalogdb/catalogrest/QueryServiceVnfs.java | 25 +++-- .../catalogdb/catalogrest/QueryVfModule.java | 10 +- .../catalogdb/catalogrest/QueryVfModules.java | 6 +- 10 files changed, 63 insertions(+), 138 deletions(-) (limited to 'adapters/mso-catalog-db-adapter') diff --git a/adapters/mso-catalog-db-adapter/pom.xml b/adapters/mso-catalog-db-adapter/pom.xml index 9bacb17a51..67b1f3124e 100644 --- a/adapters/mso-catalog-db-adapter/pom.xml +++ b/adapters/mso-catalog-db-adapter/pom.xml @@ -69,102 +69,35 @@ mso-catalog-db ${project.version} - - org.jboss.resteasy - resteasy-jaxrs - 3.0.19.Final - provided - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-simple - - - org.apache.httpcomponents - httpclient - - - - - org.jboss.resteasy - resteasy-jackson-provider - 3.0.16.Final - - - org.mockito - mockito-all - 1.10.19 - test - - - junit - junit - 4.11 - test - - - org.mockito - mockito-core - 2.0.5-beta - test - - - org.powermock - powermock-api-mockito - 1.6.2 - test - - - org.powermock - powermock-module-junit4 - 1.6.2 - test - javax.json javax.json-api 1.0 test - - org.glassfish - javax.json - 1.0.4 - test - - - org.hamcrest - hamcrest-all - 1.3 - test - - - org.jboss.resteasy - resteasy-client - 3.0.19.Final - test - - - javax.servlet - javax.servlet-api - 3.1.0 - test - - - org.jboss.resteasy - tjws - 3.0.19.Final - test - + + org.glassfish + javax.json + 1.0.4 + test + + + org.hamcrest + hamcrest-all + 1.3 + test + + + javax.servlet + javax.servlet-api + 3.1.0 + test + - \ No newline at end of file + diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java index 4a8233bb03..10d76f145b 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java @@ -21,7 +21,7 @@ package org.openecomp.mso.adapters.catalogdb.catalogrest; import org.openecomp.mso.logger.MsoLogger; -import org.codehaus.jackson.map.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.Map; import java.util.regex.Matcher; diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryException.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryException.java index ae8042d42f..a35bc78229 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryException.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryException.java @@ -19,13 +19,10 @@ */ package org.openecomp.mso.adapters.catalogdb.catalogrest; -import org.jboss.resteasy.annotations.providers.NoJackson; - import javax.xml.bind.annotation.XmlRootElement; import java.io.Serializable; @XmlRootElement(name = "catalogQueryException") -@NoJackson public class CatalogQueryException extends CatalogQueryExceptionCommon implements Serializable { private static final long serialVersionUID = -9062290006520066109L; diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java index a1bc08599b..a1414e08bd 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java @@ -20,8 +20,8 @@ */ package org.openecomp.mso.adapters.catalogdb.catalogrest; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; @@ -42,7 +42,7 @@ public abstract class CatalogQueryExceptionCommon { try { String jsonString; ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); jsonString = mapper.writeValueAsString(this); return jsonString; } catch (Exception e) { diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java index f7758c315c..450ffd6d93 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java @@ -20,7 +20,6 @@ package org.openecomp.mso.adapters.catalogdb.catalogrest; import org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization; -import org.jboss.resteasy.annotations.providers.NoJackson; import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; @@ -29,7 +28,6 @@ import java.util.List; import java.util.Map; @XmlRootElement(name = "serviceAllottedResources") -@NoJackson public class QueryAllottedResourceCustomization extends CatalogQuery { private List allottedResourceCustomization; private final String template = @@ -43,15 +41,17 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { "\t\t\t\"modelCustomizationUuid\" : ,\n"+ "\t\t\t\"modelInstanceName\" : \n"+ "\t\t},\n"+ - "\t\t\"toscaNodeType\" : ,\n"+ - "\t\t\"allottedResourceType\" : ,\n"+ - "\t\t\"allottedResourceRole\" : ,\n"+ - "\t\t\"providingServiceModelInvariantUuid\" : ,\n"+ - "\t\t\"nfFunction\" : ,\n"+ - "\t\t\"nfType\" : ,\n"+ - "\t\t\"nfRole\" : ,\n"+ - "\t\t\"nfNamingCode\" : \n"+ - "\t}"; + "\t\t\"toscaNodeType\" : ,\n"+ + "\t\t\"allottedResourceType\" : ,\n"+ + "\t\t\"allottedResourceRole\" : ,\n"+ + "\t\t\"providingServiceModelName\" : ,\n"+ + "\t\t\"providingServiceModelInvariantUuid\" : ,\n"+ + "\t\t\"providingServiceModelUuid\" : ,\n"+ + "\t\t\"nfFunction\" : ,\n"+ + "\t\t\"nfType\" : ,\n"+ + "\t\t\"nfRole\" : ,\n"+ + "\t\t\"nfNamingCode\" : \n"+ + "\t}"; // "\t}}"; public QueryAllottedResourceCustomization() { super(); allottedResourceCustomization = new ArrayList<>(); } @@ -96,13 +96,15 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUuid()); put(valueMap, "MODEL_INSTANCE_NAME", o.getModelInstanceName()); put(valueMap, "TOSCA_NODE_TYPE", arNull ? null : o.getAllottedResource().getToscaNodeType()); - put(valueMap, "ALLOTTED_RESOURCE_TYPE", o.getNfType()); - put(valueMap, "ALLOTTED_RESOURCE_ROLE", o.getNfRole()); + put(valueMap, "ALLOTTED_RESOURCE_TYPE", arNull ? null : o.getAllottedResource().getSubcategory()); + put(valueMap, "ALLOTTED_RESOURCE_ROLE", o.getTargetNetworkRole()); put(valueMap, "NF_TYPE", o.getNfType()); put(valueMap, "NF_ROLE", o.getNfRole()); put(valueMap, "NF_FUNCTION", o.getNfFunction()); put(valueMap, "NF_NAMING_CODE", o.getNfNamingCode()); put(valueMap, "PROVIDING_SERVICE_MODEL_INVARIANT_UUID", o.getProvidingServiceModelInvariantUuid()); + put(valueMap, "PROVIDING_SERVICE_MODEL_UUID", o.getProvidingServiceModelUuid()); + put(valueMap, "PROVIDING_SERVICE_MODEL_NAME", o.getProvidingServiceModelName()); sb.append(sep).append(this.setTemplate(template, valueMap)); sep = ",\n"; diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java index 2e70391c05..e683a9fd8d 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java @@ -21,14 +21,12 @@ package org.openecomp.mso.adapters.catalogdb.catalogrest; import org.openecomp.mso.db.catalog.beans.Service; import org.openecomp.mso.db.catalog.beans.ServiceMacroHolder; -import org.jboss.resteasy.annotations.providers.NoJackson; import javax.xml.bind.annotation.XmlRootElement; import java.util.HashMap; import java.util.Map; @XmlRootElement(name = "serviceResources") -@NoJackson public class QueryServiceMacroHolder extends CatalogQuery { private ServiceMacroHolder serviceMacroHolder; private static final String LINE_BEGINNING = "(?m)^"; @@ -40,8 +38,10 @@ public class QueryServiceMacroHolder extends CatalogQuery { "\t\t\"modelInvariantUuid\" : ,\n"+ "\t\t\"modelVersion\" : \n"+ "\t},\n"+ - "\t\"serviceType\" : ,\n"+ - "\t\"serviceRole\" : ,\n"+ + "\t\"serviceType\" : ,\n"+ + "\t\"serviceRole\" : ,\n"+ + "\t\"environmentContext\" : ,\n"+ + "\t\"workloadContext\" : ,\n"+ "<_SERVICEVNFS_>,\n"+ "<_SERVICENETWORKS_>,\n"+ "<_SERVICEALLOTTEDRESOURCES_>\n"+ @@ -73,8 +73,10 @@ public class QueryServiceMacroHolder extends CatalogQuery { put(valueMap, "SERVICE_MODEL_UUID", service.getModelUUID()); //getServiceModelUuid()); put(valueMap, "SERVICE_MODEL_INVARIANT_ID", service.getModelInvariantUUID()); //getServiceModelInvariantId()); put(valueMap, "SERVICE_MODEL_VERSION", service.getVersion()); //getServiceModelVersion()); - put(valueMap, "SERVICE_TYPE", service.getServiceType()); - put(valueMap, "SERVICE_ROLE", service.getServiceRole()); + put(valueMap, "SERVICE_TYPE", service.getServiceType()); + put(valueMap, "SERVICE_ROLE", service.getServiceRole()); + put(valueMap, "ENVIRONMENT_CONTEXT", service.getEnvironmentContext()); + put(valueMap, "WORKLOAD_CONTEXT", service.getWorkloadContext()); String subitem; subitem = new QueryServiceVnfs(serviceMacroHolder.getVnfResourceCustomizations()).JSON2(true, true); diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java index c04068d680..9795deec54 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java @@ -20,7 +20,6 @@ package org.openecomp.mso.adapters.catalogdb.catalogrest; import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization; -import org.jboss.resteasy.annotations.providers.NoJackson; import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; @@ -29,7 +28,6 @@ import java.util.List; import java.util.Map; @XmlRootElement(name = "serviceNetworks") -@NoJackson public class QueryServiceNetworks extends CatalogQuery { private List serviceNetworks; private final String template = diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java index f0d4327950..383a106b18 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java @@ -20,23 +20,20 @@ package org.openecomp.mso.adapters.catalogdb.catalogrest; /* should be called QueryVnfResource.java */ -import org.openecomp.mso.db.catalog.beans.VnfResource; -import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization; -import org.jboss.resteasy.annotations.providers.NoJackson; - -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.xml.bind.annotation.XmlRootElement; + +import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization; + @XmlRootElement(name = "serviceVnfs") -@NoJackson public class QueryServiceVnfs extends CatalogQuery { private List serviceVnfs; private final String template = "\n"+ -// "\t{ \"vnfResource\" : {\n"+ "\t{ \"modelInfo\" : {\n"+ "\t\t\"modelName\" : ,\n"+ "\t\t\"modelUuid\" : ,\n"+ @@ -50,10 +47,9 @@ public class QueryServiceVnfs extends CatalogQuery { "\t\"nfType\" : ,\n"+ "\t\"nfRole\" : ,\n"+ "\t\"nfNamingCode\" : ,\n"+ -// "\t}\n"+ + "\t\"multiStageDesign\" : ,\n"+ "<_VFMODULES_>\n" + "\t}"; -// "\t}}"; public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<>(); } public QueryServiceVnfs(List vlist) { @@ -104,11 +100,12 @@ public class QueryServiceVnfs extends CatalogQuery { put(valueMap, "MODEL_VERSION", vrNull ? null : o.getVnfResource().getVersion()); put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUuid()); put(valueMap, "MODEL_INSTANCE_NAME", o.getModelInstanceName()); - put(valueMap, "TOSCA_NODE_TYPE", vrNull ? null : o.getVnfResource().getToscaNodeType()); - put(valueMap, "NF_FUNCTION", o.getNfFunction()); - put(valueMap, "NF_TYPE", o.getNfType()); - put(valueMap, "NF_ROLE", o.getNfRole()); - put(valueMap, "NF_NAMING_CODE", o.getNfNamingCode()); + put(valueMap, "TOSCA_NODE_TYPE", vrNull ? null : o.getVnfResource().getToscaNodeType()); + put(valueMap, "NF_FUNCTION", o.getNfFunction()); + put(valueMap, "NF_TYPE", o.getNfType()); + put(valueMap, "NF_ROLE", o.getNfRole()); + put(valueMap, "NF_NAMING_CODE", o.getNfNamingCode()); + put(valueMap, "MULTI_STEP_DESIGN", o.getMultiStageDesign()); String subitem = new QueryVfModule(vrNull ? null : o.getVfModuleCustomizations()).JSON2(true, true); valueMap.put("_VFMODULES_", subitem.replaceAll("(?m)^", "\t\t")); diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java index fe0f0cbc17..a8969dd45d 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java @@ -19,18 +19,16 @@ */ package org.openecomp.mso.adapters.catalogdb.catalogrest; -import org.openecomp.mso.db.catalog.beans.VfModule; -import org.openecomp.mso.db.catalog.beans.VfModuleCustomization; -import org.jboss.resteasy.annotations.providers.NoJackson; - -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.xml.bind.annotation.XmlRootElement; + +import org.openecomp.mso.db.catalog.beans.VfModuleCustomization; + @XmlRootElement(name = "vfModules") -@NoJackson public class QueryVfModule extends CatalogQuery { private List vfModules; private final String template = diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModules.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModules.java index 00a5cafb29..001a9f496a 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModules.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModules.java @@ -25,14 +25,12 @@ import java.util.List; import javax.xml.bind.annotation.XmlRootElement; -import org.codehaus.jackson.map.ObjectMapper; -import org.jboss.resteasy.annotations.providers.NoJackson; - import org.openecomp.mso.db.catalog.beans.VfModule; import org.openecomp.mso.logger.MsoLogger; +import com.fasterxml.jackson.databind.ObjectMapper; + @XmlRootElement(name = "vfModules") -@NoJackson public class QueryVfModules { private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); private List vfModules; -- cgit 1.2.3-korg