Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[POLICY-117] Resolve the Policy Critical issues
[policy/engine.git]
/
ECOMP-PDP-REST
/
src
/
main
/
java
/
org
/
openecomp
/
policy
/
pdp
/
rest
/
api
/
services
/
CreateUpdatePolicyServiceImpl.java
diff --git
a/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java
b/ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java
index
4032a8a
..
cf21711
100644
(file)
--- a/
ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java
+++ b/
ECOMP-PDP-REST/src/main/java/org/openecomp/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java
@@
-33,7
+33,7
@@
import org.openecomp.policy.xacml.api.XACMLErrorConstants;
import org.springframework.http.HttpStatus;
public class CreateUpdatePolicyServiceImpl implements CreateUpdatePolicyService {
import org.springframework.http.HttpStatus;
public class CreateUpdatePolicyServiceImpl implements CreateUpdatePolicyService {
- private static
Logger LOGGER = FlexLogger.getLogger(CreateUpdatePolicyService
.class.getName());
+ private static
final Logger LOGGER = FlexLogger.getLogger(CreateUpdatePolicyServiceImpl
.class.getName());
private String policyResult = null;
private HttpStatus status = HttpStatus.BAD_REQUEST;
private String policyResult = null;
private HttpStatus status = HttpStatus.BAD_REQUEST;
@@
-55,7
+55,7
@@
public class CreateUpdatePolicyServiceImpl implements CreateUpdatePolicyService
requestUUID = UUID.fromString(requestID);
} catch (IllegalArgumentException e) {
requestUUID = UUID.randomUUID();
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();
}
}else{
requestUUID = UUID.randomUUID();
@@
-222,9
+222,9
@@
public class CreateUpdatePolicyServiceImpl implements CreateUpdatePolicyService
return false;
}
if (policyParameters.getPolicyName().contains(".")) {
return false;
}
if (policyParameters.getPolicyName().contains(".")) {
- policyName = policyParameters.getPolicyName().substring(policyParameters.getPolicyName().lastIndexOf(
"."
) + 1,
+ policyName = policyParameters.getPolicyName().substring(policyParameters.getPolicyName().lastIndexOf(
'.'
) + 1,
policyParameters.getPolicyName().length());
policyParameters.getPolicyName().length());
- policyScope = policyParameters.getPolicyName().substring(0,policyParameters.getPolicyName().lastIndexOf(
"."
));
+ policyScope = policyParameters.getPolicyName().substring(0,policyParameters.getPolicyName().lastIndexOf(
'.'
));
LOGGER.info("Name is " + policyName + " scope is " + policyScope);
} else {
message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Policy Scope given.";
LOGGER.info("Name is " + policyName + " scope is " + policyScope);
} else {
message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Policy Scope given.";
@@
-233,7
+233,6
@@
public class CreateUpdatePolicyServiceImpl implements CreateUpdatePolicyService
if (policyName==null||policyName.trim().isEmpty()){
message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Policy Name given.";
return false;
if (policyName==null||policyName.trim().isEmpty()){
message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Policy Name given.";
return false;
-
}
message = PolicyUtils.emptyPolicyValidator(policyScope);
if(!message.contains("success")){
}
message = PolicyUtils.emptyPolicyValidator(policyScope);
if(!message.contains("success")){