diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2019-09-10 16:31:01 +0300 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2019-09-12 08:51:25 +0300 |
commit | 2265215c803291e029add2db7912c7b1e25e0a8e (patch) | |
tree | 3082c232fa26483a0f1262efcc5c228d554280d1 /vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java | |
parent | 77e77f77c89ca1bef622b12c71897ab1ab256216 (diff) |
make Logging a service and inject it to SyncRestClient
Issue-ID: VID-611
Change-Id: I120782884351c55b2e0d1b4ca8bae1e2479d1d0a
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java index b9908d1e3..99845f06d 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java @@ -55,7 +55,6 @@ import org.onap.vid.asdc.parser.ToscaParserImpl2; import org.onap.vid.asdc.parser.VidNotionsBuilder; import org.onap.vid.asdc.rest.SdcRestClient; import org.onap.vid.client.SyncRestClient; -import org.onap.vid.client.SyncRestClientInterface; import org.onap.vid.properties.AsdcClientConfiguration; import org.onap.vid.properties.VidProperties; import org.onap.vid.scheduler.SchedulerService; @@ -67,6 +66,7 @@ import org.onap.vid.services.AaiServiceImpl; import org.onap.vid.services.ChangeManagementService; import org.onap.vid.services.PombaService; import org.onap.vid.services.PombaServiceImpl; +import org.onap.vid.utils.Logging; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -119,13 +119,19 @@ public class WebConfig { } @Bean(name = "aaiRestInterface") - public AAIRestInterface aaiRestInterface(HttpsAuthClient httpsAuthClientFactory, ServletRequestHelper servletRequestHelper, SystemPropertyHelper systemPropertyHelper) { - return new AAIRestInterface(httpsAuthClientFactory, servletRequestHelper, systemPropertyHelper); + public AAIRestInterface aaiRestInterface(HttpsAuthClient httpsAuthClientFactory, + ServletRequestHelper servletRequestHelper, + SystemPropertyHelper systemPropertyHelper, + Logging loggingService) { + return new AAIRestInterface(httpsAuthClientFactory, servletRequestHelper, systemPropertyHelper, loggingService); } @Bean - public PombaRestInterface getPombaRestInterface(HttpsAuthClient httpsAuthClientFactory, ServletRequestHelper servletRequestHelper, SystemPropertyHelper systemPropertyHelper) { - return new PombaRestInterface(httpsAuthClientFactory, servletRequestHelper, systemPropertyHelper); + public PombaRestInterface getPombaRestInterface(HttpsAuthClient httpsAuthClientFactory, + ServletRequestHelper servletRequestHelper, + SystemPropertyHelper systemPropertyHelper, + Logging loggingService) { + return new PombaRestInterface(httpsAuthClientFactory, servletRequestHelper, systemPropertyHelper, loggingService); } @Bean @@ -150,18 +156,13 @@ public class WebConfig { } @Bean - public AsdcClient sdcClient(AsdcClientConfiguration asdcClientConfiguration, SyncRestClientInterface syncRestClient) { + public AsdcClient sdcClient(AsdcClientConfiguration asdcClientConfiguration, Logging loggingService) { String auth = asdcClientConfiguration.getAsdcClientAuth(); String host = asdcClientConfiguration.getAsdcClientHost(); String protocol = asdcClientConfiguration.getAsdcClientProtocol(); int port = asdcClientConfiguration.getAsdcClientPort(); - return new SdcRestClient(protocol + "://" + host + ":" + port + "/", auth, syncRestClient); - } - - @Bean - public SyncRestClientInterface syncRestClient() { - return new SyncRestClient(); + return new SdcRestClient(protocol + "://" + host + ":" + port + "/", auth, new SyncRestClient(loggingService), loggingService); } @Bean @@ -190,8 +191,10 @@ public class WebConfig { } @Bean - public AaiOverTLSClientInterface aaiOverTLSClient(ObjectMapper unirestObjectMapper, SystemProperties systemProperties){ - return new AaiOverTLSClient(new SyncRestClient(unirestObjectMapper), new AaiOverTLSPropertySupplier()); + public AaiOverTLSClientInterface aaiOverTLSClient(ObjectMapper unirestObjectMapper, SystemProperties systemProperties, Logging loggingService){ + return new AaiOverTLSClient( + new SyncRestClient(unirestObjectMapper, loggingService), + new AaiOverTLSPropertySupplier()); } @Bean |