Mostly moving variables to their right spot.
Issue-ID: POLICY-1129
Change-Id: Iccc084bbb404ffd51bdd0b26b5f8c373c6142fb1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
package org.onap.policy.drools;
+@FunctionalInterface
public interface PolicyEngine {
public boolean deliver(String busType, String topic, Object obj);
}
*/
public interface ControlLoopMetrics {
+ /**
+ * Singleton manager object.
+ */
+ ControlLoopMetrics manager = new CacheBasedControlLoopMetricsManager();
+
/**
* Gets all transaction identifiers being monitored.
*
* Refresh underlying transaction management.
*/
void refresh();
-
- /**
- * Singleton manager object.
- */
- ControlLoopMetrics manager = new CacheBasedControlLoopMetricsManager();
}
import org.slf4j.LoggerFactory;
public class PolicyGuard {
- private PolicyGuard() {
- // Cannot instantiate this static class
- }
private static final Logger logger = LoggerFactory.getLogger(PolicyGuard.class);
private A parameterA;
private B parameterB;
- public static <A, B> LockResult<A, B> createLockResult(A parameterA, B parameterB) {
- return new LockResult<>(parameterA, parameterB);
- }
-
public LockResult(A parameterA, B parameterB) {
this.parameterA = parameterA;
this.parameterB = parameterB;
public B getB() {
return parameterB;
}
+
+ public static <A, B> LockResult<A, B> createLockResult(A parameterA, B parameterB) {
+ return new LockResult<>(parameterA, parameterB);
+ }
}
+ private PolicyGuard() {
+ // Cannot instantiate this static class
+ }
+
/**
* Get the factory.
*
// Constant for the systme line separator
private static final String SYSTEM_LS = System.lineSeparator();
+ private UrlEntry[] restUrls = null;
+ private int restUrlIndex = 0;
+
+ // REST timeout, initialized from 'pdpx.timeout' property
+ private int timeout = 20000;
+
public PolicyGuardXacmlHelper() {
init(PolicyEngine.manager.getEnvironment());
}
String environment = null;
}
- private UrlEntry[] restUrls = null;
- private int restUrlIndex = 0;
-
- // REST timeout, initialized from 'pdpx.timeout' property
- private int timeout = 20000;
-
/**
* Call PDP.
*
//DO Nothing Empty Constructor
}
+ public ControlLoopGuard(ControlLoopGuard clGuard) {
+ this.guard = new Guard();
+ this.guards = new LinkedList<>(clGuard.guards);
+ }
+
public Guard getGuard() {
return guard;
}
this.guards = guards;
}
- public ControlLoopGuard(ControlLoopGuard clGuard) {
- this.guard = new Guard();
- this.guards = new LinkedList<>(clGuard.guards);
- }
-
@Override
public String toString() {
return "Guard [guard=" + guard + ", GuardPolicies=" + guards + "]";