aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/vfc
diff options
context:
space:
mode:
authorMagnusen, Drew (dm741q) <dm741q@att.com>2017-08-24 11:37:46 -0500
committerMagnusen, Drew (dm741q) <dm741q@att.com>2017-08-28 13:07:09 -0500
commit11e0afc41aa47b9b5fe36c6c654c5b7493e4ba46 (patch)
treeb05742106ad95c9f47a006f36eb87aabb784ca1e /controlloop/common/model-impl/vfc
parentd03507850e293674cc118f76bab0629d457179ae (diff)
Removal of sys.out/err with logger messages
Removed any use of System.out.println or System.err.println and replaced with relevant logger statements. Issue-ID: POLICY-176 Change-Id: I91513267635bfb2a34f2a9650c48f367d53fc842 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
Diffstat (limited to 'controlloop/common/model-impl/vfc')
-rw-r--r--controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java b/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java
index 44f9905b2..0aade0744 100644
--- a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java
+++ b/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java
@@ -24,6 +24,8 @@ import java.util.Map;
import org.onap.policy.vfc.util.Serialization;
import org.onap.policy.rest.RESTManager;
import org.onap.policy.rest.RESTManager.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.gson.JsonSyntaxException;
@@ -33,7 +35,8 @@ public final class VFCManager implements Runnable {
private String username;
private String password;
private VFCRequest vfcRequest;
-
+ private static final Logger logger = LoggerFactory.getLogger(VFCManager.class);
+
public VFCManager(VFCRequest request) {
vfcRequest = request;
// TODO: Get base URL, username and password from MSB?
@@ -67,8 +70,8 @@ public final class VFCManager implements Runnable {
VFCResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, VFCResponse.class);
String body = Serialization.gsonPretty.toJson(response);
- System.out.println("Response to VFC Heal post:");
- System.out.println(body);
+ logger.debug("Response to VFC Heal post:");
+ logger.debug(body);
String jobId = response.jobId;
int attemptsLeft = 20;
@@ -81,27 +84,27 @@ public final class VFCManager implements Runnable {
Pair<Integer, String> httpDetailsGet = RESTManager.get(urlGet, username, password, headers);
responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, VFCResponse.class);
body = Serialization.gsonPretty.toJson(responseGet);
- System.out.println("Response to VFC Heal get:");
- System.out.println(body);
+ logger.debug("Response to VFC Heal get:");
+ logger.debug(body);
if (httpDetailsGet.a == 200) {
if (responseGet.responseDescriptor.status.equalsIgnoreCase("finished") ||
responseGet.responseDescriptor.status.equalsIgnoreCase("error")) {
- System.out.println("VFC Heal Status " + responseGet.responseDescriptor.status);
+ logger.debug("VFC Heal Status {}", responseGet.responseDescriptor.status);
break;
}
}
Thread.sleep(20000);
}
if (attemptsLeft <= 0)
- System.out.println("VFC timeout. Status: (" + responseGet.responseDescriptor.status + ")");
+ logger.debug("VFC timeout. Status: ({})", responseGet.responseDescriptor.status);
} catch (JsonSyntaxException e) {
- System.err.println("Failed to deserialize into VFCResponse" + e.getLocalizedMessage());
+ logger.error("Failed to deserialize into VFCResponse {}",e.getLocalizedMessage(),e);
} catch (InterruptedException e) {
- System.err.println("Interrupted exception: " + e.getLocalizedMessage());
+ logger.error("Interrupted exception: {}", e.getLocalizedMessage(), e);
}
} else {
- System.out.println("VFC Heal Restcall failed");
+ logger.warn("VFC Heal Restcall failed");
}
}
}