summaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-10-26 17:32:58 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-26 17:32:58 +0000
commit3bfa599ce2ca409622d3f4d0900a3543a812aabd (patch)
treeeddb9d41948f6171dc06c39f411fb604ec7e6f4a /catalog-be
parent4f74ac66e4e115654ec30c1f5553e079c3bd4e58 (diff)
parent5d9812bdbdc1a10e7e05d227178d878798da2fab (diff)
Merge "sanity stabilization" into release-1.1.0
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
index 6e971f215d..b9956063d6 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
@@ -243,8 +243,13 @@ public class AssetsDataServlet extends AbstractValidationsServlet {
ComponentTypeEnum componentType = ComponentTypeEnum.findByParamName(assetType);
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, instanceIdHeader);
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, requestURI);
- additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, componentType.getValue());
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, uuid);
+ if (componentType == null) {
+ log.debug("getMetaData: assetType parameter {} is not valid", assetType);
+ responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT);
+ return buildErrorResponse(responseFormat);
+ }
+ additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, componentType.getValue());
// Mandatory
if (instanceIdHeader == null || instanceIdHeader.isEmpty()) {
@@ -331,8 +336,15 @@ public class AssetsDataServlet extends AbstractValidationsServlet {
EnumMap<AuditingFieldsKeysEnum, Object> additionalParam = new EnumMap<AuditingFieldsKeysEnum, Object>(AuditingFieldsKeysEnum.class);
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, instanceIdHeader);
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, url);
- additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, componentType.getValue());
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, uuid);
+
+ if (componentType == null) {
+ log.debug("getToscaModel: assetType parameter {} is not valid", assetType);
+ responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT);
+ return buildErrorResponse(responseFormat);
+ }
+ additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, componentType.getValue());
+
if (instanceIdHeader == null || instanceIdHeader.isEmpty()) {
log.debug("getToscaModel: Missing X-ECOMP-InstanceID header");