summaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src/main
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-03-14 02:07:32 -0400
committerRob Daugherty <rd472p@att.com>2018-03-14 04:08:41 -0400
commit38f720752af4d4aad8c4e467a288d9048659f688 (patch)
treee81066a8b5c77272e30fb57a64999573c4db4d86 /adapters/mso-catalog-db-adapter/src/main
parentaee3d223f92a6f250f43e17558a2dfd576ff7294 (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/src/main')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQuery.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryException.java3
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java6
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java28
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java14
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java25
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java10
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModules.java6
9 files changed, 44 insertions, 52 deletions
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;