diff options
Diffstat (limited to 'controlloop/common/eventmanager/src/main')
3 files changed, 20 insertions, 17 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java index 3feab7d7c..b61eabc4b 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java @@ -341,7 +341,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { // PLD - this is simply comparing the policy. Do we want to equals the whole object? // if (this.currentOperation.policy.equals(operation.policy)) { - System.out.println("Finishing " + this.currentOperation.policy.getRecipe() + " result is " + this.currentOperation.getOperationResult()); + logger.debug("Finishing {} result is {}", this.currentOperation.policy.getRecipe(), this.currentOperation.getOperationResult()); // // Save history // @@ -359,7 +359,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { // return; } - System.out.println("Cannot finish current operation " + this.currentOperation.policy + " does not match given operation " + operation.policy); + logger.debug("Cannot finish current operation {} does not match given operation {}", this.currentOperation.policy, operation.policy); return; } throw new ControlLoopException("No operation to finish."); diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java index 0df58be06..09f69fb0b 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java @@ -211,7 +211,7 @@ public class ControlLoopOperationManager implements Serializable { // // We are not supporting MSO interface at the moment // - System.out.println("We are not supporting MSO actor in the latest release."); + logger.debug("We are not supporting MSO actor in the latest release."); return null; case "VFC": this.operationRequest = VFCActorServiceProvider.constructRequest((VirtualControlLoopEvent) onset, operation.operation, this.policy); @@ -315,10 +315,10 @@ public class ControlLoopOperationManager implements Serializable { // Sanity check // if (this.policy == null) { - System.out.println("getOperationTimeout returning 0"); + logger.debug("getOperationTimeout returning 0"); return 0; } - System.out.println("getOperationTimeout returning " + this.policy.getTimeout()); + logger.debug("getOperationTimeout returning {}", this.policy.getTimeout()); return this.policy.getTimeout(); } @@ -485,7 +485,7 @@ public class ControlLoopOperationManager implements Serializable { private void completeOperation(Integer attempt, String message, PolicyResult result) { if (attempt == null) { - System.out.println("attempt cannot be null (i.e. subRequestID)"); + logger.debug("attempt cannot be null (i.e. subRequestID)"); return; } if (this.currentOperation != null) { @@ -509,7 +509,7 @@ public class ControlLoopOperationManager implements Serializable { this.currentOperation = null; return; } - System.out.println("not current"); + logger.debug("not current"); } for (Operation op : this.operationHistory) { if (op.attempt == attempt.intValue()) { @@ -520,7 +520,7 @@ public class ControlLoopOperationManager implements Serializable { return; } } - System.out.println("Could not find associated operation"); + logger.debug("Could not find associated operation"); } diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java index 5c019c487..bb5cec8da 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java @@ -28,29 +28,32 @@ import java.util.Queue; import org.onap.policy.appc.Request; import org.onap.policy.controlloop.ControlLoopNotification; import org.onap.policy.controlloop.util.Serialization; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.onap.policy.drools.PolicyEngine; public class PolicyEngineJUnitImpl implements PolicyEngine { + private static final Logger logger = LoggerFactory.getLogger(PolicyEngineJUnitImpl.class); private Map<String, Map<String, Queue<Object>>> busMap = new HashMap<String, Map<String, Queue<Object>>>(); @Override public boolean deliver(String busType, String topic, Object obj) { if (obj instanceof ControlLoopNotification) { ControlLoopNotification notification = (ControlLoopNotification) obj; - //System.out.println("Notification: " + notification.notification + " " + (notification.message == null ? "" : notification.message) + " " + notification.history); - System.out.println(Serialization.gsonPretty.toJson(notification)); + //logger.debug("Notification: " + notification.notification + " " + (notification.message == null ? "" : notification.message) + " " + notification.history); + logger.debug(Serialization.gsonPretty.toJson(notification)); } if (obj instanceof Request) { Request request = (Request) obj; - System.out.println("Request: " + request.Action + " subrequest " + request.CommonHeader.SubRequestID); + logger.debug("Request: {} subrequst {}", request.Action, request.CommonHeader.SubRequestID); } // // Does the bus exist? // if (busMap.containsKey(busType) == false) { - System.out.println("creating new bus type " + busType); + logger.debug("creating new bus type {}", busType); // // Create the bus // @@ -64,7 +67,7 @@ public class PolicyEngineJUnitImpl implements PolicyEngine { // Does the topic exist? // if (topicMap.containsKey(topic) == false) { - System.out.println("creating new topic " + topic); + logger.debug("creating new topic {}", topic); // // Create the topic // @@ -73,7 +76,7 @@ public class PolicyEngineJUnitImpl implements PolicyEngine { // // Get the topic queue // - System.out.println("queueing"); + logger.debug("queueing"); return topicMap.get(topic).add(obj); } @@ -90,13 +93,13 @@ public class PolicyEngineJUnitImpl implements PolicyEngine { // Does the topic exist? // if (topicMap.containsKey(topic)) { - System.out.println("The queue has " + topicMap.get(topic).size()); + logger.debug("The queue has {}", topicMap.get(topic).size()); return topicMap.get(topic).poll(); } else { - System.err.println("No topic exists " + topic); + logger.error("No topic exists {}", topic); } } else { - System.err.println("No bus exists " + busType); + logger.error("No bus exists {}", busType); } return null; } |