summaryrefslogtreecommitdiffstats
path: root/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/DeletePolicyService.java
diff options
context:
space:
mode:
Diffstat (limited to 'ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/DeletePolicyService.java')
-rw-r--r--ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/DeletePolicyService.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/DeletePolicyService.java b/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/DeletePolicyService.java
index d0978fc5b..3b1ea23fb 100644
--- a/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/DeletePolicyService.java
+++ b/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/DeletePolicyService.java
@@ -31,7 +31,7 @@ import org.openecomp.policy.xacml.std.pap.StdPAPPolicy;
import org.springframework.http.HttpStatus;
public class DeletePolicyService {
- private static Logger LOGGER = FlexLogger.getLogger(DeletePolicyService.class.getName());
+ private static final Logger LOGGER = FlexLogger.getLogger(DeletePolicyService.class.getName());
private String deleteResult = null;
private HttpStatus status = HttpStatus.BAD_REQUEST;
@@ -53,7 +53,7 @@ public class DeletePolicyService {
requestUUID = UUID.fromString(requestID);
} catch (IllegalArgumentException e) {
requestUUID = UUID.randomUUID();
- LOGGER.info("Generated Random UUID: " + requestUUID.toString());
+ LOGGER.info("Generated Random UUID: " + requestUUID.toString(), e);
}
}else{
requestUUID = UUID.randomUUID();
@@ -74,7 +74,7 @@ public class DeletePolicyService {
if(deleteResult==null){
return;
}
- if (deleteResult.contains("BAD REQUEST")||deleteResult.contains("PE300")||deleteResult.contains("not exist")||deleteResult.contains("Invalid policyName")) {
+ if (deleteResult.contains("BAD REQUEST")||deleteResult.contains("PE300")||deleteResult.contains("PE200")||deleteResult.contains("not exist")||deleteResult.contains("Invalid policyName")) {
status = HttpStatus.BAD_REQUEST;
} else if (deleteResult.contains("locked down")){
status = HttpStatus.ACCEPTED;
@@ -174,6 +174,10 @@ public class DeletePolicyService {
private boolean getValidation() {
// While Validating, extract the required values.
+ if (deletePolicyParameters.getPolicyName()==null||deletePolicyParameters.getPolicyName().trim().isEmpty()){
+ message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Policy Name given.";
+ return false;
+ }
if (!deletePolicyParameters.getPolicyName().contains("xml")) {
if (deletePolicyParameters.getPolicyName() != null
&& deletePolicyParameters.getPolicyName().contains(".")) {
@@ -188,10 +192,6 @@ public class DeletePolicyService {
} else {
policyName = deletePolicyParameters.getPolicyName();
}
- if (deletePolicyParameters.getPolicyName()==null||deletePolicyParameters.getPolicyName().trim().isEmpty()){
- message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Policy Name given.";
- return false;
- }
policyType = deletePolicyParameters.getPolicyType();
if(policyType== null || policyType.trim().isEmpty()){
message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No PolicyType given.";