summaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/aai
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/aai
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/aai')
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java
index 6136aee93..e609e932e 100644
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java
+++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java
@@ -28,7 +28,9 @@ import java.util.Map;
import java.util.UUID;
import org.onap.policy.aai.util.Serialization;
-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.rest.RestManager;
import org.onap.policy.rest.RestManager.Pair;
import org.slf4j.Logger;
@@ -39,15 +41,9 @@ import org.slf4j.LoggerFactory;
*/
public final class AaiManager {
- /** The Constant LINE_SEPARATOR. */
- private static final String LINE_SEPARATOR = System.lineSeparator();
-
/** The Constant logger. */
private static final Logger logger = LoggerFactory.getLogger(AaiManager.class);
- /** The Constant netLogger. */
- private static final Logger netLogger = LoggerFactoryWrapper.getNetworkLogger();
-
/** The rest manager. */
// The REST manager used for processing REST calls for this AAI manager
private final RestManager restManager;
@@ -79,7 +75,7 @@ public final class AaiManager {
logger.debug("RestManager.post before");
String requestJson = Serialization.gsonPretty.toJson(request);
- netLogger.info("[OUT|{}|{}|]{}{}", "AAI", url, LINE_SEPARATOR, requestJson);
+ NetLoggerUtil.log(EventType.OUT, CommInfrastructure.REST, url, requestJson);
Pair<Integer, String> httpDetails =
restManager.post(url, username, password, headers, "application/json", requestJson);
logger.debug("RestManager.post after");
@@ -168,7 +164,7 @@ public final class AaiManager {
int attemptsLeft = 3;
while (attemptsLeft-- > 0) {
- netLogger.info("[OUT|{}|{}|]", "AAI", urlGet);
+ NetLoggerUtil.getNetworkLogger().info("[OUT|{}|{}|]", CommInfrastructure.REST, urlGet);
Pair<Integer, String> httpDetailsGet = restManager.get(urlGet, username, password, headers);
if (httpDetailsGet == null) {
logger.info("AAI GET Null Response to {}", urlGet);
@@ -228,7 +224,7 @@ public final class AaiManager {
final Class<T> classOfResponse) {
try {
T response = Serialization.gsonPretty.fromJson(httpDetails.second, classOfResponse);
- netLogger.info("[IN|{}|{}|]{}{}", "AAI", url, LINE_SEPARATOR, httpDetails.second);
+ NetLoggerUtil.log(EventType.IN, CommInfrastructure.REST, url, httpDetails.second);
return response;
} catch (JsonSyntaxException e) {
logger.error("postQuery threw: ", e);