Fixed some small sonar issues. Some of the others will be
taken care of when we implement things.
Issue-ID: POLICY-1602
Change-Id: I745962feaf00904c39b2e80e00bcc565f51dc8fd
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
public static final Identifier ID_OBLIGATION_POLICY_MONITORING_DATATYPE =
XACML3.ID_DATATYPE_STRING;
public static final Identifier ID_OBLIGATION_POLICY_MONITORING_DATATYPE =
XACML3.ID_DATATYPE_STRING;
- public static final Identifier ID_OBLIGATION_ISSUER =
+ public static final Identifier ID_OBLIGATION_MONITORING_ISSUER =
new IdentifierImpl(URN_ONAP, "issuer:monitoring");
private ToscaDictionary() {
new IdentifierImpl(URN_ONAP, "issuer:monitoring");
private ToscaDictionary() {
public class XacmlPolicyUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(XacmlPolicyUtils.class);
public class XacmlPolicyUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(XacmlPolicyUtils.class);
+ private static final String DOT_FILE_SUFFIX = ".file";
+ private static final String NOT_FOUND_MESSAGE = "NOT FOUND";
private XacmlPolicyUtils() {
super();
private XacmlPolicyUtils() {
super();
id++;
} else {
referencedPolicies.add(refId);
id++;
} else {
referencedPolicies.add(refId);
- properties.put(refId + ".file", refPolicyPath.toAbsolutePath().toString());
+ properties.put(refId + DOT_FILE_SUFFIX, refPolicyPath.toAbsolutePath().toString());
boolean found = false;
Set<String> referencedPolicies = XACMLProperties.getReferencedPolicyIDs(properties);
for (String refPolicy : referencedPolicies) {
boolean found = false;
Set<String> referencedPolicies = XACMLProperties.getReferencedPolicyIDs(properties);
for (String refPolicy : referencedPolicies) {
- String refPolicyFile = refPolicy + ".file";
+ String refPolicyFile = refPolicy + DOT_FILE_SUFFIX;
//
// If the key and value match, then it will return true
//
//
// If the key and value match, then it will return true
//
Set<String> rootPolicies = XACMLProperties.getRootPolicyIDs(properties);
logger.debug("Root Policies: {}", properties.getProperty(XACMLProperties.PROP_ROOTPOLICIES));
for (String root : rootPolicies) {
Set<String> rootPolicies = XACMLProperties.getRootPolicyIDs(properties);
logger.debug("Root Policies: {}", properties.getProperty(XACMLProperties.PROP_ROOTPOLICIES));
for (String root : rootPolicies) {
- logger.debug("{}", properties.getProperty(root + ".file", "NOT FOUND"));
+ logger.debug("{}", properties.getProperty(root + DOT_FILE_SUFFIX, NOT_FOUND_MESSAGE));
}
//
// Get the current set of referenced policy ids
}
//
// Get the current set of referenced policy ids
Set<String> referencedPolicies = XACMLProperties.getReferencedPolicyIDs(properties);
logger.debug("Referenced Policies: {}", properties.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES));
for (String ref : referencedPolicies) {
Set<String> referencedPolicies = XACMLProperties.getReferencedPolicyIDs(properties);
logger.debug("Referenced Policies: {}", properties.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES));
for (String ref : referencedPolicies) {
- logger.debug("{}", properties.getProperty(ref + ".file", "NOT FOUND"));
+ logger.debug("{}", properties.getProperty(ref + DOT_FILE_SUFFIX, NOT_FOUND_MESSAGE));
//
// Probably don't need these as these ID's are used by other components
//
//
// Probably don't need these as these ID's are used by other components
//
- assertNotNull(ToscaDictionary.ID_OBLIGATION_ISSUER);
+ assertNotNull(ToscaDictionary.ID_OBLIGATION_MONITORING_ISSUER);
Map<String, Object> resources = decisionRequest.getResource();
for (Entry<String, Object> entry : resources.entrySet()) {
Map<String, Object> resources = decisionRequest.getResource();
for (Entry<String, Object> entry : resources.entrySet()) {
- if (entry.getKey().equals("policy-id")) {
+ if ("policy-id".contentEquals(entry.getKey())) {
//
// TODO handle lists of policies
//
request.resource = entry.getValue().toString();
continue;
}
//
// TODO handle lists of policies
//
request.resource = entry.getValue().toString();
continue;
}
- if (entry.getKey().equals("policy-type")) {
+ if ("policy-type".contentEquals(entry.getKey())) {
//
// TODO handle lists of policies
//
//
// TODO handle lists of policies
//