aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/main
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2020-02-06 11:42:53 -0500
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-02-07 09:10:34 -0500
commit580f68b9f028d519adaeabede0f9bf03d6ea7565 (patch)
treeb0670ae05f9e3dc7ddb314a3418aeb85f20560d2 /mso-api-handlers/mso-api-handler-infra/src/main
parent6db24e72ecbf4f5c63085085c10dc656568b563b (diff)
Remove unused param
Remove unused param from request parameters Issue-ID: SO-2651 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I1c9a8e05aa329ee65f9910ab25319a0a61d54675
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java10
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java3
3 files changed, 10 insertions, 6 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
index e3e840bbcd..c077558301 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
@@ -85,6 +85,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -105,6 +106,9 @@ public class MsoRequest {
@Autowired
private ResponseBuilder builder;
+ @Value("${mso.enforceDLP:false}")
+ private boolean enforceDLP;
+
private static Logger logger = LoggerFactory.getLogger(MsoRequest.class);
public Response buildServiceErrorResponse(int httpResponseCode, MsoException exceptionType, String errorText,
@@ -179,8 +183,10 @@ public class MsoRequest {
rules.add(new ModelInfoValidation());
rules.add(new CloudConfigurationValidation());
rules.add(new SubscriberInfoValidation());
- rules.add(new PlatformLOBValidation());
- rules.add(new ProjectOwningEntityValidation());
+ if (!enforceDLP) {
+ rules.add(new PlatformLOBValidation());
+ rules.add(new ProjectOwningEntityValidation());
+ }
rules.add(new RelatedInstancesValidation());
rules.add(new ConfigurationParametersValidation());
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java
index 20be2b5a8b..71405b0f63 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/PlatformLOBValidation.java
@@ -43,8 +43,7 @@ public class PlatformLOBValidation implements ValidationRule {
platform = info.getSir().getRequestDetails().getPlatform();
lineOfBusiness = info.getSir().getRequestDetails().getLineOfBusiness();
- if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.createInstance
- && !info.getReqParameters().getEnforceValidNfValues()) {
+ if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.createInstance) {
if (reqVersion > 5 && platform == null) {
throw new ValidationException("platform");
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java
index cebbd6389c..07641ae87b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ProjectOwningEntityValidation.java
@@ -45,8 +45,7 @@ public class ProjectOwningEntityValidation implements ValidationRule {
project = info.getSir().getRequestDetails().getProject();
owningEntity = info.getSir().getRequestDetails().getOwningEntity();
if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.service.name())
- && !info.getReqParameters().getEnforceValidNfValues() && action == Action.createInstance
- || action == Action.assignInstance) {
+ && action == Action.createInstance || action == Action.assignInstance) {
if (reqVersion > 5 && owningEntity == null) {
throw new ValidationException("owningEntity");
}