diff options
author | Rob Daugherty <rd472p@att.com> | 2018-03-14 02:07:32 -0400 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2018-03-14 04:08:41 -0400 |
commit | 38f720752af4d4aad8c4e467a288d9048659f688 (patch) | |
tree | e81066a8b5c77272e30fb57a64999573c4db4d86 /adapters/mso-catalog-db-adapter | |
parent | aee3d223f92a6f250f43e17558a2dfd576ff7294 (diff) |
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 <rd472p@att.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter')
10 files changed, 63 insertions, 138 deletions
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 @@ <artifactId>mso-catalog-db</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.jboss.resteasy</groupId> - <artifactId>resteasy-jaxrs</artifactId> - <version>3.0.19.Final</version> - <scope>provided</scope> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </exclusion> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.jboss.resteasy</groupId> - <artifactId>resteasy-jackson-provider</artifactId> - <version>3.0.16.Final</version> - </dependency> <!--<dependency> <groupId>org.onap.so</groupId> <artifactId>status-control</artifactId> <version>${project.version}</version> </dependency>--> <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-all</artifactId> - <version>1.10.19</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>2.0.5-beta</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito</artifactId> - <version>1.6.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-junit4</artifactId> - <version>1.6.2</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>javax.json</groupId> <artifactId>javax.json-api</artifactId> <version>1.0</version> <scope>test</scope> </dependency> - <dependency> - <groupId>org.glassfish</groupId> - <artifactId>javax.json</artifactId> - <version>1.0.4</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest-all</artifactId> - <version>1.3</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.jboss.resteasy</groupId> - <artifactId>resteasy-client</artifactId> - <version>3.0.19.Final</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <version>3.1.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.jboss.resteasy</groupId> - <artifactId>tjws</artifactId> - <version>3.0.19.Final</version> - <scope>test</scope> - </dependency> +<dependency> + <groupId>org.glassfish</groupId> + <artifactId>javax.json</artifactId> + <version>1.0.4</version> + <scope>test</scope> +</dependency> +<dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-all</artifactId> + <version>1.3</version> + <scope>test</scope> +</dependency> +<dependency> + <groupId>javax.servlet</groupId> + <artifactId>javax.servlet-api</artifactId> + <version>3.1.0</version> + <scope>test</scope> +</dependency> </dependencies> -</project>
\ No newline at end of file +</project> 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> allottedResourceCustomization; private final String template = @@ -43,15 +41,17 @@ public class QueryAllottedResourceCustomization extends CatalogQuery { "\t\t\t\"modelCustomizationUuid\" : <MODEL_CUSTOMIZATION_UUID>,\n"+ "\t\t\t\"modelInstanceName\" : <MODEL_INSTANCE_NAME>\n"+ "\t\t},\n"+ - "\t\t\"toscaNodeType\" : <TOSCA_NODE_TYPE>,\n"+ - "\t\t\"allottedResourceType\" : <ALLOTTED_RESOURCE_TYPE>,\n"+ - "\t\t\"allottedResourceRole\" : <ALLOTTED_RESOURCE_ROLE>,\n"+ - "\t\t\"providingServiceModelInvariantUuid\" : <PROVIDING_SERVICE_MODEL_INVARIANT_UUID>,\n"+ - "\t\t\"nfFunction\" : <NF_FUNCTION>,\n"+ - "\t\t\"nfType\" : <NF_TYPE>,\n"+ - "\t\t\"nfRole\" : <NF_ROLE>,\n"+ - "\t\t\"nfNamingCode\" : <NF_NAMING_CODE>\n"+ - "\t}"; + "\t\t\"toscaNodeType\" : <TOSCA_NODE_TYPE>,\n"+ + "\t\t\"allottedResourceType\" : <ALLOTTED_RESOURCE_TYPE>,\n"+ + "\t\t\"allottedResourceRole\" : <ALLOTTED_RESOURCE_ROLE>,\n"+ + "\t\t\"providingServiceModelName\" : <PROVIDING_SERVICE_MODEL_NAME>,\n"+ + "\t\t\"providingServiceModelInvariantUuid\" : <PROVIDING_SERVICE_MODEL_INVARIANT_UUID>,\n"+ + "\t\t\"providingServiceModelUuid\" : <PROVIDING_SERVICE_MODEL_UUID>,\n"+ + "\t\t\"nfFunction\" : <NF_FUNCTION>,\n"+ + "\t\t\"nfType\" : <NF_TYPE>,\n"+ + "\t\t\"nfRole\" : <NF_ROLE>,\n"+ + "\t\t\"nfNamingCode\" : <NF_NAMING_CODE>\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\" : <SERVICE_MODEL_INVARIANT_ID>,\n"+ "\t\t\"modelVersion\" : <SERVICE_MODEL_VERSION>\n"+ "\t},\n"+ - "\t\"serviceType\" : <SERVICE_TYPE>,\n"+ - "\t\"serviceRole\" : <SERVICE_ROLE>,\n"+ + "\t\"serviceType\" : <SERVICE_TYPE>,\n"+ + "\t\"serviceRole\" : <SERVICE_ROLE>,\n"+ + "\t\"environmentContext\" : <ENVIRONMENT_CONTEXT>,\n"+ + "\t\"workloadContext\" : <WORKLOAD_CONTEXT>,\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<NetworkResourceCustomization> 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<VnfResourceCustomization> serviceVnfs; private final String template = "\n"+ -// "\t{ \"vnfResource\" : {\n"+ "\t{ \"modelInfo\" : {\n"+ "\t\t\"modelName\" : <MODEL_NAME>,\n"+ "\t\t\"modelUuid\" : <MODEL_UUID>,\n"+ @@ -50,10 +47,9 @@ public class QueryServiceVnfs extends CatalogQuery { "\t\"nfType\" : <NF_TYPE>,\n"+ "\t\"nfRole\" : <NF_ROLE>,\n"+ "\t\"nfNamingCode\" : <NF_NAMING_CODE>,\n"+ -// "\t}\n"+ + "\t\"multiStageDesign\" : <MULTI_STEP_DESIGN>,\n"+ "<_VFMODULES_>\n" + "\t}"; -// "\t}}"; public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<>(); } public QueryServiceVnfs(List<VnfResourceCustomization> 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<VfModuleCustomization> 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<VfModule> vfModules; |