From dd64c2c344196e30543fda9a7840bd5b3e03f587 Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Mon, 28 Jan 2019 21:24:13 +0100 Subject: Use helper class to retrieve network logger Instead of abusing constant from Topic interface use new dedicated helper class to retrive network logger. Issue-ID: POLICY-1486 Depends-On: Ic1f07466e1ab6abcc00098e617f0e82da19e852d Change-Id: I453a14c3dda337f2a4d08914ead32b37adc17353 Signed-off-by: Krzysztof Opasiak --- .../so/src/main/java/org/onap/policy/so/SoManager.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'controlloop/common/model-impl/so') 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 20136f713..7c145e01d 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 @@ -3,6 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Samsung Electronics Co., Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +30,7 @@ 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.drools.system.PolicyEngine; import org.onap.policy.rest.RestManager; import org.onap.policy.rest.RestManager.Pair; @@ -45,8 +47,8 @@ import org.slf4j.LoggerFactory; */ public final class SoManager { private static final Logger logger = LoggerFactory.getLogger(SoManager.class); - private static final Logger netLogger = - LoggerFactory.getLogger(org.onap.policy.common.endpoints.event.comm.Topic.NETWORK_LOGGER); + private static final Logger netLogger = LoggerFactoryWrapper.getNetworkLogger(); + private static ExecutorService executors = Executors.newCachedThreadPool(); private static final int SO_RESPONSE_ERROR = 999; @@ -121,10 +123,10 @@ public final class SoManager { * @param request the SO request * @return a concurrent Future for the thread that handles the request */ - public Future asyncSoRestCall(final String requestId, + public Future asyncSoRestCall(final String requestId, final WorkingMemory wm, - final String serviceInstanceId, - final String vnfInstanceId, + final String serviceInstanceId, + final String vnfInstanceId, final String vfModuleInstanceId, final SoRequest request) { return executors.submit(new AsyncSoRestCallThread(requestId, wm, serviceInstanceId, vnfInstanceId, vfModuleInstanceId, request)); @@ -151,9 +153,9 @@ public final class SoManager { * @param vfModuleInstanceId the vf module instance id (not null in case of delete vf module request) * @param request the request itself */ - private AsyncSoRestCallThread(final String requestId, + private AsyncSoRestCallThread(final String requestId, final WorkingMemory wm, final String serviceInstanceId, - final String vnfInstanceId, final String vfModuleInstanceId, + final String vnfInstanceId, final String vfModuleInstanceId, final SoRequest request) { this.requestId = requestId; this.wm = wm; -- cgit 1.2.3-korg