summaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/so
diff options
context:
space:
mode:
authorDaniel Cruz <dc443y@att.com>2019-03-11 15:29:14 -0500
committerPamela Dragosh <pdragosh@research.att.com>2019-03-19 11:43:44 +0000
commit71513a08caa8fd80c732d53d97b242e4b3a3f5c6 (patch)
tree7908248883a94b7dd8c9586b0bd30940881c10b2 /controlloop/common/model-impl/so
parentf3260414bad28d0a807e60f703f1d87a1cc38f6a (diff)
Change LoggerFactoryWrapper to NetLoggerUtil
Removed LoggerFactoryWrapper references to use NetLoggerUtil. Issue-ID: POLICY-1499 Change-Id: I6f7066f4523736672e17d2e1e609c38c44852769 Signed-off-by: Daniel Cruz <dc443y@att.com>
Diffstat (limited to 'controlloop/common/model-impl/so')
-rw-r--r--controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SoManager.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SoManager.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SoManager.java
index 7c145e01d..836ebc85b 100644
--- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SoManager.java
+++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SoManager.java
@@ -30,7 +30,9 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import org.drools.core.WorkingMemory;
-import org.onap.policy.common.utils.slf4j.LoggerFactoryWrapper;
+import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
+import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
+import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.drools.system.PolicyEngine;
import org.onap.policy.rest.RestManager;
import org.onap.policy.rest.RestManager.Pair;
@@ -47,7 +49,6 @@ import org.slf4j.LoggerFactory;
*/
public final class SoManager {
private static final Logger logger = LoggerFactory.getLogger(SoManager.class);
- private static final Logger netLogger = LoggerFactoryWrapper.getNetworkLogger();
private static ExecutorService executors = Executors.newCachedThreadPool();
@@ -85,8 +86,8 @@ public final class SoManager {
final String password, final SoRequest request) {
// Issue the HTTP POST request to SO to create the service instance
String requestJson = Serialization.gsonPretty.toJson(request);
- netLogger.info("[OUT|{}|{}|{}|{}|{}|{}|]{}{}", "SO", url, username, password, createSimpleHeaders(), MEDIA_TYPE,
- LINE_SEPARATOR, requestJson);
+ NetLoggerUtil.getNetworkLogger().info("[OUT|{}|{}|{}|{}|{}|{}|]{}{}", "SO", url, username, password,
+ createSimpleHeaders(), MEDIA_TYPE, LINE_SEPARATOR, requestJson);
Pair<Integer, String> httpResponse =
restManager.post(url, username, password, createSimpleHeaders(), MEDIA_TYPE, requestJson);
@@ -183,13 +184,13 @@ public final class SoManager {
.equals(SoOperationType.SCALE_OUT)) {
url = urlBase + "/serviceInstantiation/v7/serviceInstances/" + serviceInstanceId + "/vnfs/"
+ vnfInstanceId + "/vfModules/scaleOut";
- netLogger.info("[OUT|{}|{}|]{}{}", "SO", url, LINE_SEPARATOR, soJson);
+ NetLoggerUtil.log(EventType.OUT, CommInfrastructure.REST, url, soJson);
httpResponse = restManager.post(url, username, password, createSimpleHeaders(), MEDIA_TYPE, soJson);
} else if (request.getOperationType() != null && request.getOperationType()
.equals(SoOperationType.DELETE_VF_MODULE)) {
url = urlBase + "/serviceInstances/v7/" + serviceInstanceId + "/vnfs/" + vnfInstanceId
+ "/vfModules/" + vfModuleInstanceId;
- netLogger.info("[OUT|{}|{}|]{}{}", "SO", url, LINE_SEPARATOR, soJson);
+ NetLoggerUtil.log(EventType.OUT, CommInfrastructure.REST, url, soJson);
httpResponse = restManager.delete(url, username, password, createSimpleHeaders(), MEDIA_TYPE, soJson);
} else {
return null;
@@ -252,8 +253,8 @@ public final class SoManager {
}
// Issue a GET to find the current status of our request
- netLogger.info("[OUT|{}|{}|{}|{}|{}|{}|]{}", "SO", urlGet, username, password, createSimpleHeaders(),
- MEDIA_TYPE, LINE_SEPARATOR);
+ NetLoggerUtil.getNetworkLogger().info("[OUT|{}|{}|{}|{}|{}|{}|]{}", "SO", urlGet, username, password,
+ createSimpleHeaders(), MEDIA_TYPE, LINE_SEPARATOR);
Pair<Integer, String> httpResponse = restManager.get(urlGet, username, password, createSimpleHeaders());
// Get our response
@@ -304,7 +305,7 @@ public final class SoManager {
response.setHttpResponseCode(httpResponse.first);
}
- netLogger.info("[IN|{}|{}|]{}{}", "SO", requestUrl, LINE_SEPARATOR, httpResponse.second);
+ NetLoggerUtil.log(EventType.IN, CommInfrastructure.REST, requestUrl, httpResponse.second);
if (logger.isDebugEnabled()) {
logger.debug("***** Response to SO Request to URL {}:", requestUrl);