Client Logging
[so.git] / adapters / mso-openstack-adapters / src / main / java / org / onap / so / adapters / openstack / CXFConfiguration.java
index d298186..996e2c2 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -46,6 +48,8 @@ import org.onap.so.adapters.vnf.VolumeAdapterRest;
 import org.onap.so.adapters.vnf.VolumeAdapterRestV2;
 import org.onap.so.client.policy.JettisonStyleMapperProvider;
 import org.onap.so.logger.MsoLogger;
+import org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor;
+import org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.web.servlet.ServletRegistrationBean;
 import org.springframework.context.annotation.Bean;
@@ -56,8 +60,6 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 
 @Configuration
 public class CXFConfiguration {
-       private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, CXFConfiguration.class);
-       
        @Autowired
        private NetworkAdapterRest networkAdapterRest;
        @Autowired
@@ -84,8 +86,7 @@ public class CXFConfiguration {
        private MsoVnfCloudifyAdapterImpl vnfCloudifyAdapterImpl;
        @Autowired
        private JettisonStyleMapperProvider jettisonStyleObjectMapper;  
-       
-       
+
     @Bean(name=Bus.DEFAULT_BUS_ID)
     public SpringBus springBus() {      
         return new SpringBus();
@@ -107,6 +108,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), networkAdapterImpl);
         endpoint.publish("/NetworkAdapter");
         endpoint.setWsdlLocation("NetworkAdapter.wsdl");
+        endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor());
+        endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor());
+        endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor());
         return endpoint;
     }  
        
@@ -115,6 +119,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), networkAdapterAsyncImpl);
         endpoint.publish("/NetworkAdapterAsync");
         endpoint.setWsdlLocation("NetworkAdapterAsync.wsdl");
+        endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor());
+        endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor());
+        endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor());
         return endpoint;
     }          
        
@@ -126,6 +133,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), tenantAdapterImpl);
         endpoint.publish("/TenantAdapter");
         endpoint.setWsdlLocation("TenantAdapter.wsdl");
+        endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor());
+        endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor());
+        endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor());
         return endpoint;
     }
     
@@ -139,6 +149,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), vnfAdapterImpl);
         endpoint.publish("/VnfAdapter");
         endpoint.setWsdlLocation("VnfAdapter.wsdl");
+        endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor());
+        endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor());
+        endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor());
         return endpoint;
     }
     
@@ -147,6 +160,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), vnfAdapterAsyncImpl);
         endpoint.publish("/VnfAsyncAdapter");
         endpoint.setWsdlLocation("VnfAsyncAdapter.wsdl");
+        endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor());
+        endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor());
+        endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor());
         return endpoint;
     }
     
@@ -155,6 +171,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), vnfCloudifyAdapterImpl);
         endpoint.publish("/VnfCloudifyAdapterImpl");
         endpoint.setWsdlLocation("VnfCloudifyAdapterImpl.wsdl");
+        endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor());
+        endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor());
+        endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor());
         return endpoint;
     }