aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/guard/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/guard/src/main/java')
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java8
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java2
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardYamlToXacml.java2
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java5
4 files changed, 11 insertions, 6 deletions
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java
index 9b2644b95..6ba1a5a5f 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java
@@ -338,7 +338,7 @@ public class PIPEngineGetHistory extends StdConfigurableEngine{
}catch(Exception ex){
logger.error("PIP thread got Exception. Can't connect to Operations History DB -- {}", OpsHistPU);
logger.error("getCountFromDB threw: ", ex);
- return 0;
+ return -1;
}
DateUtil dateUtil = new DateUtil(){
@@ -406,9 +406,9 @@ public class PIPEngineGetHistory extends StdConfigurableEngine{
+ " and endtime between '" + new Timestamp(diff) + "' and '" + new Timestamp(now) + "'";
Query nq = em.createNativeQuery(sql);
- nq.setParameter(0, actor);
- nq.setParameter(1, operation);
- nq.setParameter(2, target);
+ nq.setParameter(1, actor);
+ nq.setParameter(2, operation);
+ nq.setParameter(3, target);
int ret = -1;
try{
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
index 0703b7611..cbaa8edde 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
@@ -104,12 +104,12 @@ public class PolicyGuardXacmlHelper {
jsonReq.put("decisionAttributes", attributes);
jsonReq.put("onapName", "PDPD");
- URLEntry urlEntry = restUrls[restUrlIndex];
try {
//
// Call RESTful PDP
//
+ URLEntry urlEntry = restUrls[restUrlIndex];
netLogger.info("[OUT|{}|{}|]{}{}", "GUARD", urlEntry.restURL, System.lineSeparator(), jsonReq.toString());
response = callRESTfulPDP(new ByteArrayInputStream(jsonReq
.toString().getBytes()), urlEntry.restURL,
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardYamlToXacml.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardYamlToXacml.java
index 72b723c1f..aef86f320 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardYamlToXacml.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardYamlToXacml.java
@@ -244,7 +244,7 @@ public class PolicyGuardYamlToXacml {
xacmlFileContent = m.replaceAll("<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">"
+ target
+ "</AttributeValue>"
- + "\n\t\t\t\t\t\t\\$\\{blackListElement\\}");
+ + "\n\t\t\t\t\t\t\\$\\{blackListElement\\}\n");
}
p = Pattern.compile("\t\t\t\t\t\t\\$\\{blackListElement\\}\n");
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java
index ca62f6149..93bdc0c37 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java
@@ -68,6 +68,11 @@ public final class Util {
public static final String PERMIT = "Permit";
public static final String DENY = "Deny";
+ /*
+ * Junit props
+ */
+ protected static final String PU_KEY = "OperationsHistoryPU";
+ protected static final String JUNITPU = "TestOperationsHistoryPU";
private static final Logger logger = LoggerFactory.getLogger(Util.class);
public static class Pair<A, B> {