Merge "fixed sonar issue in TenantAdapterRest.java"
authorByung-Woo Jun <byung-woo.jun@ericsson.com>
Tue, 4 Sep 2018 13:36:21 +0000 (13:36 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 4 Sep 2018 13:36:21 +0000 (13:36 +0000)
124 files changed:
adapters/mso-adapter-utils/pom.xml
adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsTest.java
adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/authentication/AuthenticationMethodTest.java
adapters/mso-adapter-utils/src/test/java/org/onap/so/config/PoConfigTest.java
adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/beans/OpenstackBeansPojoTest.java
adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java
adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoKeystoneUtilsTest.java
adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoNeutronUtilsTest.java
adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkRequest.java
adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkResponse.java
adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java
adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java
adapters/mso-catalog-db-adapter/pom.xml
adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/CatalogDBApplication.java
adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java
adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java [new file with mode: 0644]
adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebSecurityConfigImpl.java
adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.7__CreateTableControllerSelectionRefence.sql [moved from adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.4__CreateTableControllerSelectionRefence.sql with 100% similarity]
adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.8__AutoScaleOutReferenceData.sql [new file with mode: 0644]
adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
adapters/mso-openstack-adapters/src/main/java/db/migration/V4_2__DummyMigration.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/CreateNetworkNotification.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkRollback.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/QueryNetworkNotification.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/UpdateNetworkNotification.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapter.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapterImpl.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/beans/HeatRequest.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java
adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/CXFConfiguration.java
adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/WebMvcConfig.java [new file with mode: 0644]
adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/exceptions/MsoRequestsDbException.java
adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml
adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java
adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java
adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/application/TestAppender.java [moved from adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/Application.java with 55% similarity]
adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml
adapters/mso-requests-db-adapter/src/test/resources/logback-test.xml
adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/CXFConfiguration.java
adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/MapRequestTunables.java
adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/MapTypedRequestTunablesData.java
adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java
adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/BaseTest.java
adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java
adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java
adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/recipe/ResourceInputTest.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/ResponseExceptionMapperImplTest.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/appc/ApplicationControllerActionTest.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/appc/ApplicationControllerClientV2Test.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/appc/ApplicationControllerSupportTest.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/dmaapproperties/DmaapPropertiesClientTest.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java
bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/restproperties/ThreadedReadTest.java
bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java
bpmn/mso-infrastructure-bpmn/src/test/java/SDNCAdapterCallbackRequestTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/buildingblock/SniroHomingV2BBTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/buildingblock/SniroHomingV2Test.java
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy
bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateVcpeResCustService.bpmn
bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfAdapterClientIT.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientIT.java
common/pom.xml
common/src/main/java/org/onap/so/client/RestClient.java
common/src/main/java/org/onap/so/exceptions/MSOException.java [new file with mode: 0644]
common/src/main/java/org/onap/so/logger/LoggerStartupListener.java
common/src/main/java/org/onap/so/logger/MsoLogger.java
common/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java [new file with mode: 0644]
common/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java [new file with mode: 0644]
common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsClientLogging.java [moved from common/src/main/java/org/onap/so/logging/jaxrs/filter/jersey/JaxRsClientLogging.java with 99% similarity]
common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java [moved from common/src/main/java/org/onap/so/logging/jaxrs/filter/jersey/JaxRsFilterLogging.java with 50% similarity]
common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCSetup.java [new file with mode: 0644]
common/src/main/java/org/onap/so/logging/jaxrs/filter/SpringClientFilter.java [moved from common/src/main/java/org/onap/so/logging/jaxrs/filter/jersey/SpringClientFilter.java with 98% similarity]
common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java [new file with mode: 0644]
docs/architecture/architecture.rst
docs/developer_info/BPMN_Main_Process_Flows.rst [moved from docs/bpmn/BPMN_Main_Process_Flows.rst with 100% similarity]
docs/developer_info/BPMN_Project_Deployment_Strategy.rst [moved from docs/bpmn/BPMN_Project_Deployment_Strategy.rst with 100% similarity]
docs/developer_info/BPMN_Project_Structure.rst [moved from docs/bpmn/BPMN_Project_Structure.rst with 100% similarity]
docs/developer_info/BPMN_Subprocess_Process_Flows.rst [moved from docs/bpmn/BPMN_Subprocess_Process_Flows.rst with 100% similarity]
docs/developer_info/Building_SO.rst [moved from docs/Building_SO.rst with 100% similarity]
docs/developer_info/Camunda_Cockpit_Community_Edition.rst [moved from docs/bpmn/Camunda_Cockpit_Community_Edition.rst with 100% similarity]
docs/developer_info/Camunda_Cockpit_Enterprise_Edition.rst [moved from docs/bpmn/Camunda_Cockpit_Enterprise_Edition.rst with 100% similarity]
docs/developer_info/Camunda_Modeler.rst [moved from docs/bpmn/Camunda_Modeler.rst with 100% similarity]
docs/developer_info/ONAP_SO_Env_Setup_Guide.pdf [moved from docs/ONAP_SO_Env_Setup_Guide.pdf with 100% similarity]
docs/developer_info/Working_with_SO_Docker.rst [moved from docs/Working_with_SO_Docker.rst with 100% similarity]
docs/developer_info/developer_information.rst [new file with mode: 0644]
docs/developer_information.rst [deleted file]
docs/index.rst
docs/installconfigure/Install_Configure_SO.rst [moved from docs/Install_Configure_SO.rst with 93% similarity]
docs/release_notes/release-notes.rst [moved from docs/release-notes.rst with 100% similarity]
mso-api-handlers/mso-api-handler-common/pom.xml
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SpringContextHelper.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironment.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateEcompOperationalEnvironmentTest.java
mso-catalog-db/pom.xml
mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ControllerSelectionReferenceRepository.java
mso-catalog-db/src/test/java/org/onap/so/db/catalog/BaseTest.java [moved from mso-catalog-db/src/test/java/org/onap/so/BaseTest.java with 93% similarity]
mso-catalog-db/src/test/java/org/onap/so/db/catalog/BuildingBlockDetailTest.java
mso-catalog-db/src/test/java/org/onap/so/db/catalog/ControllerSelectionReferenceTest.java
mso-catalog-db/src/test/java/org/onap/so/db/catalog/EmbeddedMariaDbConfig.java [moved from mso-catalog-db/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java with 98% similarity]
mso-catalog-db/src/test/java/org/onap/so/db/catalog/NetworkTest.java
mso-catalog-db/src/test/java/org/onap/so/db/catalog/OrchestrationStatusStateTransitionDirectiveTest.java
mso-catalog-db/src/test/java/org/onap/so/db/catalog/ServiceTest.java
mso-catalog-db/src/test/java/org/onap/so/db/catalog/TestApplication.java [moved from mso-catalog-db/src/test/java/org/onap/so/TestApplication.java with 93% similarity]
mso-catalog-db/src/test/java/org/onap/so/db/catalog/VFModuleTest.java
mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudSiteRepositoryTest.java
mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudifyManagerRepositoryTest.java
mso-catalog-db/src/test/resources/data.sql
packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml

index 566eef7..b0687ed 100644 (file)
@@ -81,7 +81,7 @@
                </dependency>
                <dependency>
                        <groupId>org.onap.so</groupId>
-                       <artifactId>mso-catalog-db</artifactId>
+                       <artifactId>mso-catalog-db</artifactId> 
                        <version>${project.version}</version>
                </dependency>
                <dependency>
@@ -92,7 +92,6 @@
                <dependency>
                        <groupId>javax.servlet</groupId>
                        <artifactId>javax.servlet-api</artifactId>
-                       <version>3.1.0</version>
                        <scope>provided</scope>
                </dependency>
                <dependency>
                <dependency>
                        <groupId>org.yaml</groupId>
                        <artifactId>snakeyaml</artifactId>
-                       <version>1.15</version>
                </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>h2</artifactId>
                        <scope>test</scope>
                </dependency>
+               <dependency>
+                       <groupId>org.apache.cxf</groupId>
+                       <artifactId>cxf-rt-rs-client</artifactId>
+                       <version>${cxf.version}</version>
+               </dependency>
+               <dependency>
+               <groupId>org.apache.cxf</groupId>
+               <artifactId>cxf-rt-bindings-soap</artifactId>
+                       <version>${cxf.version}</version>
+               </dependency>
+               <dependency>
+               <groupId>org.apache.cxf</groupId>
+               <artifactId>cxf-rt-transports-http</artifactId>
+               <version>${cxf.version}</version>
+               </dependency>
        </dependencies>
 </project>
index c9a0a1d..abb0a10 100644 (file)
@@ -25,7 +25,7 @@ import java.util.HashMap;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.onap.so.cloud.Application;
+import org.onap.so.TestApplication;
 import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
 import org.onap.so.openstack.exceptions.MsoException;
 import org.onap.so.openstack.exceptions.MsoIOException;
@@ -46,7 +46,7 @@ import com.woorea.openstack.heat.model.CreateStackParam;
  *
  */
 @RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class)
+@SpringBootTest(classes = TestApplication.class)
 @ActiveProfiles("test")
 @Ignore
 public class MsoHeatUtilsTest extends MsoCommonUtils {
index d676bca..95e4352 100644 (file)
@@ -25,7 +25,6 @@ import static org.junit.Assert.assertTrue;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.onap.so.BaseTest;
-import org.onap.so.cloud.Application;
 import org.onap.so.db.catalog.beans.AuthenticationType;
 import org.onap.so.db.catalog.beans.CloudIdentity;
 import org.onap.so.cloud.authentication.models.RackspaceAuthentication;
index f069e9f..1884b32 100644 (file)
 package org.onap.so.config;
 
 import static org.junit.Assert.assertEquals;
-
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.onap.so.BaseTest;
-import org.onap.so.cloud.Application;
 import org.onap.so.config.beans.PoConfig;
+import org.onap.so.BaseTest;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.junit4.SpringRunner;
 
 public class PoConfigTest extends BaseTest {
 
index 94715f1..ac194cc 100644 (file)
@@ -22,7 +22,6 @@ package org.onap.so.openstack.beans;
 
 import org.junit.Test;
 import org.onap.so.BaseTest;
-
 import com.openpojo.reflection.PojoClass;
 import com.openpojo.reflection.impl.PojoClassFactory;
 import com.openpojo.validation.Validator;
index b304cba..6517122 100644 (file)
@@ -37,7 +37,6 @@ import com.woorea.openstack.heat.model.CreateStackParam;
 import org.apache.http.HttpStatus;
 import org.junit.Assert;
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.StubOpenStack;
 import org.onap.so.adapters.vdu.CloudInfo;
 import org.onap.so.adapters.vdu.PluginAction;
@@ -48,6 +47,7 @@ import org.onap.so.adapters.vdu.VduModelInfo;
 import org.onap.so.adapters.vdu.VduStateType;
 import org.onap.so.adapters.vdu.VduStatus;
 import org.onap.so.cloud.CloudConfig;
+import org.onap.so.BaseTest;
 import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.openstack.beans.HeatStatus;
 import org.onap.so.openstack.beans.StackInfo;
index 92f7738..5100407 100644 (file)
@@ -23,8 +23,8 @@ package org.onap.so.openstack.utils;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.StubOpenStack;
+import org.onap.so.BaseTest;
 import org.onap.so.openstack.beans.MsoTenant;
 import org.onap.so.openstack.exceptions.MsoException;
 import org.springframework.beans.factory.annotation.Autowired;
index 0442d4d..f679e1f 100644 (file)
@@ -23,8 +23,8 @@ package org.onap.so.openstack.utils;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.StubOpenStack;
+import org.onap.so.BaseTest;
 import org.onap.so.openstack.beans.NetworkInfo;
 import org.onap.so.openstack.exceptions.MsoException;
 import org.springframework.beans.factory.annotation.Autowired;
index f069bf2..7c3669d 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
@@ -45,7 +47,9 @@ public class DeleteNetworkRequest extends NetworkRequestCommon {
        private String modelCustomizationUuid;
        private MsoRequest msoRequest = new MsoRequest();
 
-       public DeleteNetworkRequest() {}
+       public DeleteNetworkRequest() {
+               //empty default constructor
+       }
 
        public String getCloudSiteId() {
                return cloudSiteId;
index 6953dfe..0511836 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
@@ -45,8 +47,7 @@ public class QueryNetworkResponse extends NetworkResponseCommon {
        private List<RouteTarget> routeTargets;
        private Map<String, String> subnetIdMap;
        private Map<String, String> networkOutputs;
-       private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, QueryNetworkResponse.class);
-
+       
        public QueryNetworkResponse() {
                super();
        }
index c1c8258..8dee547 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
@@ -58,7 +60,7 @@ public class UpdateNetworkRequest extends NetworkRequestCommon {
        private Boolean backout = true;
        private Map<String,String> networkParams = new HashMap<>();
        private MsoRequest msoRequest = new MsoRequest();
-       private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, UpdateNetworkRequest.class);
+       
        @JsonProperty
        private boolean contrailRequest;
        public UpdateNetworkRequest() {
index 575853a..8701aa4 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2018 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
@@ -20,8 +22,6 @@
 
 package org.onap.so.adapters.vdu;
 
-import java.util.Arrays;
-import java.util.Objects;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.commons.lang3.builder.EqualsBuilder;
 
index df5f3fa..e8db6be 100644 (file)
                        <artifactId>spring-boot-starter-test</artifactId>
                        <scope>test</scope>
                </dependency>
-               <dependency>
-                       <groupId>org.onap.so</groupId>
-                       <artifactId>deployment-configs</artifactId>
-                       <version>${project.version}</version>
-               </dependency>
                <dependency>
                        <groupId>org.onap.so</groupId>
                        <artifactId>mso-catalog-db</artifactId>
                        <version>${project.version}</version>
                </dependency>
-               <dependency>
-                       <groupId>janino</groupId>
-                       <artifactId>janino</artifactId>
-                       <version>2.5.15</version>
-               </dependency>
                <dependency>
                        <groupId>uk.co.blackpepper.bowman</groupId>
                        <artifactId>bowman-client</artifactId>
index ce98b74..93e396b 100644 (file)
@@ -25,7 +25,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.domain.EntityScan;
 import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
 
-@SpringBootApplication(scanBasePackages = {"org.onap.so.adapters.catalogdb", "org.onap.so.db.catalog.client"})
+@SpringBootApplication(scanBasePackages = {"org.onap.so.adapters.catalogdb", "org.onap.so.db.catalog.client","org.onap.so.logging.jaxrs.filter","org.onap.so.logging.spring.interceptor"})
 @EnableJpaRepositories("org.onap.so.db.catalog.data.repository")
 @EntityScan("org.onap.so.db.catalog.beans")
 public class CatalogDBApplication {
index dcd668f..ff162c8 100644 (file)
@@ -25,7 +25,7 @@ import javax.ws.rs.ApplicationPath;
 
 import org.glassfish.jersey.server.ResourceConfig;
 import org.onap.so.adapters.catalogdb.rest.CatalogDbAdapterRest;
-import org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging;
+import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
 import org.springframework.context.annotation.Configuration;
 
 import io.swagger.jaxrs.config.BeanConfig;
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/WebMvcConfig.java
new file mode 100644 (file)
index 0000000..823c807
--- /dev/null
@@ -0,0 +1,22 @@
+package org.onap.so.adapters.catalogdb;
+
+
+import org.onap.so.logging.spring.interceptor.LoggingInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.handler.MappedInterceptor;
+
+@Configuration
+public class WebMvcConfig extends WebMvcConfigurerAdapter {
+
+    @Autowired
+    LoggingInterceptor loggingInterceptor;
+
+    @Bean
+    public MappedInterceptor mappedLoggingInterceptor() {
+        return new MappedInterceptor(new String[]{"/**"}, loggingInterceptor);
+    }
+
+}
\ No newline at end of file
index 144df5f..2eb4858 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 - 2018 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
@@ -36,7 +38,7 @@ public class WebSecurityConfigImpl extends WebSecurityConfig {
                http.csrf().disable()
                .authorizeRequests()
                .antMatchers("/manage/health","/manage/info").permitAll()
-               .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),",").toString())
+               .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),","))
                .and()
                .httpBasic();
        }
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.8__AutoScaleOutReferenceData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.8__AutoScaleOutReferenceData.sql
new file mode 100644 (file)
index 0000000..c5a8dcf
--- /dev/null
@@ -0,0 +1,22 @@
+use catalogdb;
+
+INSERT INTO building_block_detail (BUILDING_BLOCK_NAME, RESOURCE_TYPE, TARGET_ACTION)
+VALUES
+('ConfigurationScaleOutBB', 'VF_MODULE', 'CREATE'),
+('GenericVnfHealthCheckBB', 'VF_MODULE', 'CREATE');
+
+INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, IS_TOPLEVELFLOW, MIN_API_VERSION, MAX_API_VERSION) VALUES
+('VFModule-ScaleOut', 'createInstance', 'VfModule', true, true, '7','7');
+
+INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES
+('VFModule-ScaleOut', '1', 'GenericVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '2', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '3', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '4', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '5', 'ConfigurationScaleOutBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '6', 'GenericVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut'));
+
+INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY)
+VALUES
+('GenericVnfHealthCheckBB', '*', '*', '*', "*" , 'Retry'),
+('ConfigurationScaleOutBB', '*', '*', '*', "*" , 'Retry');
index c3159f0..687b2f6 100644 (file)
@@ -34,6 +34,7 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
 import org.onap.so.adapters.catalogdb.CatalogDBApplication;
 
 import org.onap.so.logger.MsoLogger;
@@ -108,6 +109,27 @@ public class CatalogDBRestTest {
                                HttpMethod.GET, entity, String.class);
                
                assertEquals(Response.Status.OK.getStatusCode(),response.getStatusCode().value());
+        for(ILoggingEvent logEvent : TestAppender.events)
+            if(logEvent.getLoggerName().equals("org.onap.so.logging.spring.interceptor.LoggingInterceptor") &&
+                    logEvent.getMarker().getName().equals("ENTRY")
+                    ){
+                Map<String,String> mdc = logEvent.getMDCPropertyMap();
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.INSTANCE_UUID));
+                assertNotNull(mdc.get(MsoLogger.REQUEST_ID));
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+                assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+                assertEquals("/manage/health",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+                assertEquals("INPROGRESS",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+            }else if(logEvent.getLoggerName().equals("org.onap.so.logging.spring.interceptor.LoggingInterceptor") &&
+                    logEvent.getMarker()!= null && logEvent.getMarker().getName().equals("EXIT")){
+                Map<String,String> mdc = logEvent.getMDCPropertyMap();
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+                assertEquals("200",mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
+                assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+                assertEquals("/manage/health",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+                assertEquals("COMPLETED",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+            }
        }
        
        /* Service Resources Endpoint */
index 6530b7b..6398d41 100644 (file)
@@ -7,6 +7,6 @@ import java.sql.Connection;
 public class V4_2__DummyMigration implements JdbcMigration {
     @Override
     public void migrate(Connection connection) throws Exception {
-        
+        //does nothing
     }
 }
index e5a8d3f..c8df1fd 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
@@ -465,7 +467,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                         Map <String, Object> outputs = heatStack.getOutputs ();
                         Map <String, String> sMap = new HashMap <> ();
                         if (outputs != null) {
-                               for (String key : outputs.keySet ()) {
+                               for (Map.Entry<String, Object> entry : outputs.entrySet()) {
+                                       String key=entry.getKey();
                                        if (key != null && key.startsWith ("subnet")) {
                                                if (aic3template) //one subnet_id output
                                                {
@@ -619,7 +622,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                 Map <String, Object> outputs = heatStack.getOutputs ();
                 Map <String, String> sMap = new HashMap <> ();
                 if (outputs != null) {
-                    for (String key : outputs.keySet ()) {
+                    for (Map.Entry<String, Object> entry : outputs.entrySet()) {
+                       String key = entry.getKey();
                         if (key != null && key.startsWith ("subnet")) {
                                if (aic3template) //one subnet output expected
                                        {
@@ -1067,7 +1071,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                 Map<String, Object> outputs = heatStack.getOutputs();
                 Map<String, String> sMap = new HashMap<>();
                 if (outputs != null) {
-                    for (String key : outputs.keySet()) {
+                    for (Map.Entry<String, Object> entry : outputs.entrySet()) {
+                       String key=entry.getKey();
                         if (key != null && key.startsWith("subnet")) {
                             if (aic3template) //one subnet output expected
                             {
index 8135088..fcce165 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
@@ -346,7 +348,7 @@ public class CreateNetworkNotification {
          */
         public List<CreateNetworkNotification.SubnetIdMap.Entry> getEntry() {
             if (entry == null) {
-                entry = new ArrayList<CreateNetworkNotification.SubnetIdMap.Entry>();
+                entry = new ArrayList<>();
             }
             return this.entry;
         }
index 4fde850..e7ace11 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
@@ -362,7 +364,7 @@ public class NetworkRollback {
      */
     public List<Integer> getVlans() {
         if (vlans == null) {
-            vlans = new ArrayList<Integer>();
+            vlans = new ArrayList<>();
         }
         return this.vlans;
     }
index 55a8e3d..87aa218 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
@@ -314,7 +316,7 @@ public class QueryNetworkNotification {
      */
     public List<Integer> getVlans() {
         if (vlans == null) {
-            vlans = new ArrayList<Integer>();
+            vlans = new ArrayList<>();
         }
         return this.vlans;
     }
@@ -406,7 +408,7 @@ public class QueryNetworkNotification {
          */
         public List<QueryNetworkNotification.SubnetIdMap.Entry> getEntry() {
             if (entry == null) {
-                entry = new ArrayList<QueryNetworkNotification.SubnetIdMap.Entry>();
+                entry = new ArrayList<>();
             }
             return this.entry;
         }
index f61d0a8..daff548 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
@@ -292,7 +294,7 @@ public class UpdateNetworkNotification {
          */
         public List<UpdateNetworkNotification.SubnetIdMap.Entry> getEntry() {
             if (entry == null) {
-                entry = new ArrayList<UpdateNetworkNotification.SubnetIdMap.Entry>();
+                entry = new ArrayList<>();
             }
             return this.entry;
         }
index d298186..2b21381 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
@@ -85,6 +87,11 @@ public class CXFConfiguration {
        @Autowired
        private JettisonStyleMapperProvider jettisonStyleObjectMapper;  
        
+       @Autowired
+       private SOAPLoggingInInterceptor soapInInterceptor;
+           
+       @Autowired
+       private SOAPLoggingOutInterceptor soapOutInterceptor;
        
     @Bean(name=Bus.DEFAULT_BUS_ID)
     public SpringBus springBus() {      
@@ -107,6 +114,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), networkAdapterImpl);
         endpoint.publish("/NetworkAdapter");
         endpoint.setWsdlLocation("NetworkAdapter.wsdl");
+        endpoint.getInInterceptors().add(soapInInterceptor);
+        endpoint.getOutInterceptors().add(soapOutInterceptor);
+        endpoint.getOutFaultInterceptors().add(soapOutInterceptor);
         return endpoint;
     }  
        
@@ -115,6 +125,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), networkAdapterAsyncImpl);
         endpoint.publish("/NetworkAdapterAsync");
         endpoint.setWsdlLocation("NetworkAdapterAsync.wsdl");
+        endpoint.getInInterceptors().add(soapInInterceptor);
+        endpoint.getOutInterceptors().add(soapOutInterceptor);
+        endpoint.getOutFaultInterceptors().add(soapOutInterceptor);
         return endpoint;
     }          
        
@@ -126,6 +139,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), tenantAdapterImpl);
         endpoint.publish("/TenantAdapter");
         endpoint.setWsdlLocation("TenantAdapter.wsdl");
+        endpoint.getInInterceptors().add(soapInInterceptor);
+        endpoint.getOutInterceptors().add(soapOutInterceptor);
+        endpoint.getOutFaultInterceptors().add(soapOutInterceptor);
         return endpoint;
     }
     
@@ -139,6 +155,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), vnfAdapterImpl);
         endpoint.publish("/VnfAdapter");
         endpoint.setWsdlLocation("VnfAdapter.wsdl");
+        endpoint.getInInterceptors().add(soapInInterceptor);
+        endpoint.getOutInterceptors().add(soapOutInterceptor);
+        endpoint.getOutFaultInterceptors().add(soapOutInterceptor);
         return endpoint;
     }
     
@@ -147,6 +166,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), vnfAdapterAsyncImpl);
         endpoint.publish("/VnfAsyncAdapter");
         endpoint.setWsdlLocation("VnfAsyncAdapter.wsdl");
+        endpoint.getInInterceptors().add(soapInInterceptor);
+        endpoint.getOutInterceptors().add(soapOutInterceptor);
+        endpoint.getOutFaultInterceptors().add(soapOutInterceptor);
         return endpoint;
     }
     
@@ -155,6 +177,9 @@ public class CXFConfiguration {
         EndpointImpl endpoint = new EndpointImpl(springBus(), vnfCloudifyAdapterImpl);
         endpoint.publish("/VnfCloudifyAdapterImpl");
         endpoint.setWsdlLocation("VnfCloudifyAdapterImpl.wsdl");
+        endpoint.getInInterceptors().add(soapInInterceptor);
+        endpoint.getOutInterceptors().add(soapOutInterceptor);
+        endpoint.getOutFaultInterceptors().add(soapOutInterceptor);
         return endpoint;
     }
     
index 37a84c1..d82d478 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
@@ -30,7 +32,6 @@ import javax.jws.WebService;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.ws.Holder;
 
-import org.onap.so.adapters.tenant.exceptions.TenantAlreadyExists;
 import org.onap.so.adapters.tenant.exceptions.TenantException;
 import org.onap.so.adapters.tenantrest.TenantRollback;
 import org.onap.so.entity.MsoRequest;
index f58382f..b86681e 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
@@ -45,12 +47,13 @@ import org.springframework.stereotype.Component;
 @WebService(serviceName = "TenantAdapter", endpointInterface = "org.onap.so.adapters.tenant.MsoTenantAdapter", targetNamespace = "http://org.onap.so/tenant")
 @Component
 public class MsoTenantAdapterImpl implements MsoTenantAdapter {
-       public static final String CREATE_TENANT = "CreateTenant";
+       public static final String CREATE_TENANT = "createTenant";
     public static final String OPENSTACK = "OpenStack";
     public static final String QUERY_TENANT = "QueryTenant";
     public static final String DELETE_TENANT = "DeleteTenant";
     public static final String ROLLBACK_TENANT = "RollbackTenant";
-       
+       private static final String SUCCESS_RESPONSE_OPENSTACK="Successfully received response from Open Stack";
+       private static final String OPENSTACK_COMMUNICATE_EXCEPTION_MSG="Exception while communicate with Open Stack";
     @Resource
     private WebServiceContext wsContext;
 
@@ -84,7 +87,7 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
                               Boolean backout,
                               MsoRequest msoRequest,
                               Holder <String> tenantId,
-                              Holder <TenantRollback> rollback) throws TenantException, TenantAlreadyExists {
+                              Holder <TenantRollback> rollback) throws TenantException {
         MsoLogger.setLogContext (msoRequest);
         MsoLogger.setServiceName (CREATE_TENANT);
 
@@ -104,7 +107,7 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
                try {
                        tUtils = tFactory.getTenantUtils (cloudSiteId);
                } catch (MsoCloudSiteNotFound me) {
-            logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, "createTenant", MsoLogger.ErrorCode.DataError, "no implementation found for " + cloudSiteId, me);
+            logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, CREATE_TENANT, MsoLogger.ErrorCode.DataError, "no implementation found for " + cloudSiteId, me);
             throw new TenantException (me);
                }
 
@@ -113,11 +116,11 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
         long queryTenantStartTime = System.currentTimeMillis ();
         try {
             newTenant = tUtils.queryTenantByName (tenantName, cloudSiteId);
-            logger.recordMetricEvent (queryTenantStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", OPENSTACK, QUERY_TENANT, null);
+            logger.recordMetricEvent (queryTenantStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_RESPONSE_OPENSTACK, OPENSTACK, QUERY_TENANT, null);
         } catch (MsoException me) {
-            logger.recordMetricEvent (queryTenantStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with Open Stack", OPENSTACK, QUERY_TENANT, null);
+            logger.recordMetricEvent (queryTenantStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, OPENSTACK_COMMUNICATE_EXCEPTION_MSG, OPENSTACK, QUERY_TENANT, null);
             String error = "Create Tenant " + tenantName + ": " + me;
-            logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, "createTenant", MsoLogger.ErrorCode.DataError, "Exception while communicate with Open Stack", me);
+            logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, CREATE_TENANT, MsoLogger.ErrorCode.DataError, OPENSTACK_COMMUNICATE_EXCEPTION_MSG, me);
             logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
             throw new TenantException (me);
         }
@@ -127,11 +130,11 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
             long createTenantStartTime = System.currentTimeMillis ();
             try {
                 newTenantId = tUtils.createTenant (tenantName, cloudSiteId, metadata, backout.booleanValue ());
-                logger.recordMetricEvent (createTenantStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", OPENSTACK, CREATE_TENANT, null);
+                logger.recordMetricEvent (createTenantStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_RESPONSE_OPENSTACK, OPENSTACK, CREATE_TENANT, null);
             } catch (MsoException me) {
-                logger.recordMetricEvent (createTenantStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with Open Stack", OPENSTACK, CREATE_TENANT, null);
+                logger.recordMetricEvent (createTenantStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, OPENSTACK_COMMUNICATE_EXCEPTION_MSG, OPENSTACK, CREATE_TENANT, null);
                 String error = "Create Tenant " + tenantName + ": " + me;
-                logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, "createTenant", MsoLogger.ErrorCode.DataError, "Exception while communicate with Open Stack", me);
+                logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, CREATE_TENANT, MsoLogger.ErrorCode.DataError, OPENSTACK_COMMUNICATE_EXCEPTION_MSG, me);
                 logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
                 throw new TenantException (me);
             }
@@ -176,7 +179,7 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
                try {
                        tUtils = tFactory.getTenantUtils (cloudSiteId);
                } catch (MsoCloudSiteNotFound me) {
-            logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, "createTenant", MsoLogger.ErrorCode.DataError, "no implementation found for " + cloudSiteId, me);
+            logger.error (MessageEnum.RA_CREATE_TENANT_ERR, me.getMessage(), OPENSTACK, CREATE_TENANT, MsoLogger.ErrorCode.DataError, "no implementation found for " + cloudSiteId, me);
             throw new TenantException (me);
                }
         
@@ -184,7 +187,7 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
         long subStartTime = System.currentTimeMillis ();
         try {
             qTenant = tUtils.queryTenant (tenantNameOrId, cloudSiteId);
-            logger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", OPENSTACK, QUERY_TENANT, null);
+            logger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_RESPONSE_OPENSTACK, OPENSTACK, QUERY_TENANT, null);
             if (qTenant == null) {
                 // Not found by ID, Try by name.
                 qTenant = tUtils.queryTenantByName (tenantNameOrId, cloudSiteId);
index f4bda4a..3e3c675 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
@@ -69,7 +71,9 @@ public class ValetClient {
        private static final String DEFAULT_BASE_URL = "http://localhost:8080/";
        private static final String DEFAULT_BASE_PATH = "api/valet/placement/v1";
        private static final String DEFAULT_AUTH_STRING = "";
-       
+       private static final String REQUEST_ID="requestId";
+       private static final String HEADERS=", headers=";
+       private static final String BODY=", body=";
        @Autowired
        private ObjectMapper mapper;
        
@@ -100,7 +104,7 @@ public class ValetClient {
                GenericValetResponse<ValetCreateResponse> gvr = null;
 
                try {
-                       UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam("requestId", requestId);
+                       UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam(REQUEST_ID, requestId);
                        URI uri = builder.build();
                        
                        ValetCreateRequest vcr = this.createValetCreateRequest(regionId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
@@ -108,7 +112,7 @@ public class ValetClient {
                        String body = mapper.writeValueAsString(vcr);
                        HttpHeaders headers = generateHeaders(requestId);
                        HttpEntity<String> entity = new HttpEntity<>(body, headers);    
-                       LOGGER.debug("valet create req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body.toString());
+                       LOGGER.debug("valet create req: " + uri.toString() + HEADERS + headers.toString() + BODY + body.toString());
                        
                        response = restTemplate.exchange(uri, HttpMethod.POST, entity, ValetCreateResponse.class);
                        gvr = this.getGVRFromResponse(response);
@@ -128,7 +132,7 @@ public class ValetClient {
                GenericValetResponse<ValetUpdateResponse> gvr = null;
 
                try {
-                       UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam("requestId", requestId);
+                       UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam(REQUEST_ID, requestId);
                        URI uri = builder.build();
                        
                        ValetUpdateRequest vur = this.createValetUpdateRequest(regionId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
@@ -136,7 +140,7 @@ public class ValetClient {
                        String body = mapper.writeValueAsString(vur);
                        HttpHeaders headers = generateHeaders(requestId);       
                        HttpEntity<String> entity = new HttpEntity<>(body, headers);
-                       LOGGER.debug("valet update req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body.toString());
+                       LOGGER.debug("valet update req: " + uri.toString() + HEADERS + headers.toString() + ", body=" + body.toString());
                        
                        response = restTemplate.exchange(uri, HttpMethod.PUT, entity, ValetUpdateResponse.class);
                        gvr = this.getGVRFromResponse(response);
@@ -155,7 +159,7 @@ public class ValetClient {
                GenericValetResponse<ValetDeleteResponse> gvr = null;
 
                try {
-                       UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam("requestId", requestId);
+                       UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam(REQUEST_ID, requestId);
                        URI uri = builder.build();
                        
                        ValetDeleteRequest vdr = this.createValetDeleteRequest(regionId, tenantId, vfModuleId, vfModuleName);
@@ -163,7 +167,7 @@ public class ValetClient {
                        String body = mapper.writeValueAsString(vdr);
                        HttpHeaders headers = generateHeaders(requestId);
                        HttpEntity<String> entity = new HttpEntity<>(body, headers);
-                       LOGGER.debug("valet delete req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body.toString());
+                       LOGGER.debug("valet delete req: " + uri.toString() + HEADERS + headers.toString() + ", body=" + body.toString());
                        
                        response = restTemplate.exchange(uri, HttpMethod.DELETE, entity, ValetDeleteResponse.class);
                        gvr = this.getGVRFromResponse(response);
@@ -190,7 +194,7 @@ public class ValetClient {
                        String body = mapper.writeValueAsString(vcr);
                        HttpHeaders headers = generateHeaders(requestId);
                        HttpEntity<String> entity = new HttpEntity<>(body, headers);
-                       LOGGER.debug("valet confirm req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body);
+                       LOGGER.debug("valet confirm req: " + uri.toString() + HEADERS + headers.toString() + BODY + body);
                        
                        response = restTemplate.exchange(uri, HttpMethod.PUT, entity, ValetConfirmResponse.class);
                        gvr = this.getGVRFromResponse(response);
@@ -217,7 +221,7 @@ public class ValetClient {
                        String body = mapper.writeValueAsString(vrr);
                        HttpHeaders headers = generateHeaders(requestId);
                        HttpEntity<String> entity = new HttpEntity<>(body, headers);
-                       LOGGER.debug("valet rollback req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body.toString());
+                       LOGGER.debug("valet rollback req: " + uri.toString() + HEADERS + headers.toString() + BODY + body.toString());
                        
                        response = restTemplate.exchange(uri, HttpMethod.PUT, entity, ValetRollbackResponse.class);
                        gvr = this.getGVRFromResponse(response);
index dfd257b..4f7afa2 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
@@ -26,7 +28,6 @@ import java.util.Map;
 import java.util.Objects;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.woorea.openstack.heat.model.CreateStackParam;
 
 /*
  * This class represents the heat request as sent to OpenStack as defined in the
index 29d8f29..0d7a739 100644 (file)
@@ -947,19 +947,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                        LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.getEnvironment());
                    }
                        }
-            // Replace flavors in environment with those returned by OOF
-                       if (!oldWay) {
-                       Map<String, Object> returnMap = updateFlavorsFromOof(heatEnvironment.getEnvironment(), inputs);
-                       String heatEnvironmentString = returnMap.get("heatEnvironmentString").toString();
-               LOGGER.debug("After OOF Update Heat Env String is: " + heatEnvironmentString);
-                       if (returnMap.get("inputs") instanceof Map) {
-                       inputs = (Map<String, String>) returnMap.get("inputs");
-                       LOGGER.debug("After OOF Update inputs are: " + inputs.toString());
-               } else {
-                       LOGGER.debug("inputs is not an instance of a Map: " + returnMap.get("inputs"));
-                       throw new VnfException("Updating inputs using OOF info failed.", MsoExceptionCategory.INTERNAL);
-               }
-                       }
 
             LOGGER.debug ("In MsoVnfAdapterImpl, about to call db.getNestedTemplates avec templateId="
                           + heatTemplate.getArtifactUuid ());
@@ -2043,19 +2030,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
        return vfModuleName;
     }
 
-    private Map<String, Object> updateFlavorsFromOof(String heatEnvironmentString, Map<String, String> inputs) {
-        Map<String, Object> returnMap = new HashMap<>();
-        for (Map.Entry<String, String> input : inputs.entrySet()){
-            if (heatEnvironmentString.contains("label_" + input.getKey())){
-            heatEnvironmentString = heatEnvironmentString.replace("label_" + input.getKey(),
-            input.getValue());
-            inputs.remove("label_" + input.getKey());
-            }
-        }
-        returnMap.put("heatEnvironmentString", heatEnvironmentString);
-        returnMap.put("inputs", inputs);
-        return returnMap;
-    }
     /*
      * Helper method to check a boolean property value - on error return provided default
      */
index 3e27361..a941c7f 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
@@ -82,6 +84,7 @@ import io.swagger.annotations.ApiResponses;
 public class VnfAdapterRest {
        private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, VnfAdapterRest.class);
        private static final String TESTING_KEYWORD = "___TESTING___";
+       private static final String RESP=", resp=";
        
        @Autowired
        private MsoVnfAdapterImpl vnfAdapter;
@@ -214,7 +217,7 @@ public class VnfAdapterRest {
                                BpelRestClient bpelClient = bpelRestClientProvider.get();
                                bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
                        }
-                       LOGGER.debug ("Delete vfModule exit: code=" + getStatusCode() + ", resp="+ getResponse());
+                       LOGGER.debug ("Delete vfModule exit: code=" + getStatusCode() + RESP+ getResponse());
                }
        }
 
@@ -464,7 +467,7 @@ public class VnfAdapterRest {
                                BpelRestClient bpelClient = bpelRestClientProvider.get();
                                bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
                        }
-                       LOGGER.debug ("CreateVfModuleTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+                       LOGGER.debug ("CreateVfModuleTask exit: code=" + getStatusCode() + RESP+ getResponse());
                }
        }
 
@@ -576,7 +579,7 @@ public class VnfAdapterRest {
                                BpelRestClient bpelClient = bpelRestClientProvider.get();
                                bpelClient.bpelPost (getResponse(), req.getNotificationUrl(), sendxml);
                        }
-                       LOGGER.debug ("Update VfModule exit: code=" + getStatusCode() + ", resp="+ getResponse());
+                       LOGGER.debug ("Update VfModule exit: code=" + getStatusCode() + RESP+ getResponse());
                }
        }
        /*
@@ -685,7 +688,7 @@ public class VnfAdapterRest {
                                BpelRestClient bpelClient = bpelRestClientProvider.get();
                                bpelClient.bpelPost (getResponse(), req.getNotificationUrl(), sendxml);
                        }
-                       LOGGER.debug ("RollbackVfModulesTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+                       LOGGER.debug ("RollbackVfModulesTask exit: code=" + getStatusCode() + RESP+ getResponse());
                }
        }
 }
\ No newline at end of file
index 9a7382f..28c56b3 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 - 2018 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
@@ -76,14 +78,14 @@ public class ArchiveInfraRequestsScheduler {
                        requestsByEndTime = infraActiveRepo.findByEndTimeLessThan(archivingDate, pageRequest);
                        logger.debug(requestsByEndTime.size() + " requests to be archived based on End Time" );
                        archiveInfraRequests(requestsByEndTime);
-               } while(requestsByEndTime.size() > 0);
+               } while(!requestsByEndTime.isEmpty());
                
                List<InfraActiveRequests> requestsByStartTime = new ArrayList<>();
                do {
                        requestsByStartTime = infraActiveRepo.findByStartTimeLessThanAndEndTime(archivingDate, null, pageRequest);
                        logger.debug(requestsByEndTime.size() + " requests to be archived based on Start Time" );
                        archiveInfraRequests(requestsByStartTime);
-               } while(requestsByStartTime.size() > 0);
+               } while(!requestsByStartTime.isEmpty());
                
                logger.debug("End of archiveInfraRequestsScheduler");
        }
index d0eae88..92a9df1 100644 (file)
 package org.onap.so.adapters.requestsdb;
 
 import java.sql.Timestamp;
-
 import javax.jws.WebService;
 import javax.transaction.Transactional;
-
 import org.onap.so.adapters.requestsdb.exceptions.MsoRequestsDbException;
 import org.onap.so.db.request.beans.InfraActiveRequests;
 import org.onap.so.db.request.beans.OperationStatus;
@@ -37,7 +35,6 @@ import org.onap.so.db.request.data.repository.InfraActiveRequestsRepository;
 import org.onap.so.db.request.data.repository.OperationStatusRepository;
 import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
 import org.onap.so.db.request.data.repository.SiteStatusRepository;
-import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoLogger;
 import org.onap.so.requestsdb.RequestsDbConstant;
 import org.onap.so.utils.UUIDChecker;
@@ -48,13 +45,7 @@ import org.springframework.stereotype.Component;
 @WebService(serviceName = "RequestsDbAdapter", endpointInterface = "org.onap.so.adapters.requestsdb.MsoRequestsDbAdapter", targetNamespace = "http://org.onap.so/requestsdb")
 @Component
 @Primary
-public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
-
-       private static final String SUCCESSFUL = "Successful";
-
-       private static final String GET_INFRA_REQUEST = "Get Infra request";
-       
-       private static final String ERROR = "Error ";
+public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {        
 
        private static MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, MsoRequestsDbAdapterImpl.class);
        
@@ -76,8 +67,6 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
                        RequestStatusType requestStatus, String progress, String vnfOutputs, String serviceInstanceId,
                        String networkId, String vnfId, String vfModuleId, String volumeGroupId, String serviceInstanceName,
                        String configurationId, String configurationName, String vfModuleName) throws MsoRequestsDbException {
-               MsoLogger.setLogContext(requestId, serviceInstanceId);
-               long startTime = System.currentTimeMillis();
                try {
                        InfraActiveRequests request = infraActive.findOneByRequestIdOrClientRequestId(requestId, requestId);
                        if (request == null) {
@@ -132,15 +121,11 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
                        }
                        request.setLastModifiedBy(lastModifiedBy);
                        infraActive.save(request);
-
                } catch (Exception e) {
                        String error = "Error retrieving MSO Infra Requests DB for Request ID " + requestId;
-                       logger.error(ERROR + MsoLogger.ErrorCode.BusinessProcesssError + " for " + GET_INFRA_REQUEST + " - " + MessageEnum.RA_DB_REQUEST_NOT_EXIST + " - " + error, e);
-                       logger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error);
-                       throw new MsoRequestsDbException(error, e);
+                       logger.error(error, e);
+                       throw new MsoRequestsDbException(error, MsoLogger.ErrorCode.BusinessProcesssError, e);
                }
-               logger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESSFUL);
-
        }
 
        private void setProgress(String progress, InfraActiveRequests request) {
@@ -153,15 +138,10 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
 
        @Override
        @Transactional
-       public InfraActiveRequests getInfraRequest(String requestId) throws MsoRequestsDbException {
-               long startTime = System.currentTimeMillis();
-               MsoLogger.setLogContext(requestId, null);
-
+       public InfraActiveRequests getInfraRequest(String requestId) throws MsoRequestsDbException {            
                logger.debug("Call to MSO Infra RequestsDb adapter get method with request Id: " + requestId);
-
                InfraActiveRequests request = null;
                try {
-
                        request = infraActive.findOneByRequestIdOrClientRequestId(requestId, requestId);
                        if (request == null) {
                                String error = "Entity not found. Unable to retrieve MSO Infra Requests DB for Request ID " + requestId;
@@ -169,11 +149,9 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
                        }
                } catch (Exception e) {
                        String error = "Error retrieving MSO Infra Requests DB for Request ID " + requestId;
-                       logger.error(ERROR + MsoLogger.ErrorCode.BusinessProcesssError + " for " + GET_INFRA_REQUEST + " - " + MessageEnum.RA_DB_REQUEST_NOT_EXIST + " - " + error, e);
-                       logger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error);
-                       throw new MsoRequestsDbException(error, e);
+                       logger.error(error,e);
+                       throw new MsoRequestsDbException(error,MsoLogger.ErrorCode.BusinessProcesssError , e);
                }
-               logger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESSFUL);
                return request;
        }
 
@@ -188,18 +166,14 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
        @Transactional
        public boolean getSiteStatus(String siteName) {
                UUIDChecker.generateUUID(logger);
-               long startTime = System.currentTimeMillis();
                SiteStatus siteStatus;
                logger.debug("Request database - get Site Status with Site name:" + siteName);
-
                siteStatus = siteRepo.findOneBySiteName(siteName);
                if (siteStatus == null) {
                        // if not exist in DB, it means the site is not disabled, thus
                        // return true
-                       logger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESSFUL);
                        return true;
-               } else {
-                       logger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESSFUL);
+               } else {                        
                        return siteStatus.getStatus();
                }
        }
@@ -226,9 +200,8 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
                if (operStatus == null) {
                        String error = "Entity not found. Unable to retrieve OperationStatus Object ServiceId: " + serviceId + " operationId: "
                                        + operationId;
-                       MsoRequestsDbException e = new MsoRequestsDbException(error);
-                       logger.error(ERROR+ MsoLogger.ErrorCode.BusinessProcesssError + " - " + MessageEnum.RA_DB_REQUEST_NOT_EXIST + " - " + error, e);
-                       throw e;
+                       logger.error(error);
+                       throw new MsoRequestsDbException(error,MsoLogger.ErrorCode.BusinessProcesssError);
                }
 
                operStatus.setUserId(userId);
index a7e9cab..0404c10 100644 (file)
@@ -28,6 +28,8 @@ import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
 import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.transport.servlet.CXFServlet;
 import org.onap.so.adapters.requestsdb.MsoRequestsDbAdapter;
+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;
@@ -43,8 +45,12 @@ public class CXFConfiguration {
        @Autowired
        private MsoRequestsDbAdapter requestDbAdapterImpl;
        
-
-
+       @Autowired
+       private SOAPLoggingInInterceptor soapInInterceptor;
+       
+       @Autowired
+       private SOAPLoggingOutInterceptor soapOutInterceptor;
+       
        @Bean
        public ServletRegistrationBean cxfServlet() {
        
@@ -58,7 +64,10 @@ public class CXFConfiguration {
                LoggingFeature logFeature = new LoggingFeature();
                logFeature.setPrettyLogging(true);
                logFeature.initialize(bus);
-               endpoint.getFeatures().add(logFeature); 
+               endpoint.getFeatures().add(logFeature);
+               endpoint.getInInterceptors().add(soapInInterceptor);
+               endpoint.getOutInterceptors().add(soapOutInterceptor);
+               endpoint.getOutFaultInterceptors().add(soapOutInterceptor);
                return endpoint;
        }
 
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/WebMvcConfig.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/WebMvcConfig.java
new file mode 100644 (file)
index 0000000..69cf6cc
--- /dev/null
@@ -0,0 +1,22 @@
+package org.onap.so.adapters.requestsdb.application;
+
+
+import org.onap.so.logging.spring.interceptor.LoggingInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.handler.MappedInterceptor;
+
+@Configuration
+public class WebMvcConfig extends WebMvcConfigurerAdapter {
+
+    @Autowired
+    LoggingInterceptor loggingInterceptor;
+
+    @Bean
+    public MappedInterceptor mappedLoggingInterceptor() {
+        return new MappedInterceptor(new String[]{"/**"}, loggingInterceptor);
+    }
+
+}
\ No newline at end of file
index 6607611..e6d736d 100644 (file)
@@ -23,6 +23,8 @@ package org.onap.so.adapters.requestsdb.exceptions;
 
 
 import javax.xml.ws.WebFault;
+import org.onap.so.exceptions.MSOException;
+import org.onap.so.logger.MsoLogger.ErrorCode;
 
 /**
  * This class simply extends Exception (without addition additional functionality)
@@ -31,32 +33,41 @@ import javax.xml.ws.WebFault;
  *
  */
 @WebFault (name="MsoRequestsDbException", faultBean="org.onap.so.adapters.requestsdb.exceptions.MsoRequestsDbExceptionBean", targetNamespace="http://org.onap.so/requestsdb")
-public class MsoRequestsDbException extends Exception {
-
-       private static final long serialVersionUID = 1L;
-
-       private MsoRequestsDbExceptionBean faultInfo;
-       
-       public MsoRequestsDbException (String msg) {
-               super(msg);
-               faultInfo = new MsoRequestsDbExceptionBean (msg);
-       }
-       
-       public MsoRequestsDbException (Throwable e) {
-               super(e);
-               faultInfo = new MsoRequestsDbExceptionBean (e.getMessage());
-       }
-       
-       public MsoRequestsDbException (String msg, Throwable e) {
-               super (msg, e);
-               faultInfo = new MsoRequestsDbExceptionBean (msg);
-       }
-
-       public MsoRequestsDbExceptionBean getFaultInfo() {
-               return faultInfo;
-       }
-
-       public void setFaultInfo(MsoRequestsDbExceptionBean faultInfo) {
-               this.faultInfo = faultInfo;
-       }
+public class MsoRequestsDbException extends MSOException {
+
+    private static final long serialVersionUID = 1L;
+
+    private MsoRequestsDbExceptionBean faultInfo;
+
+
+    public MsoRequestsDbException (String msg) {
+        super(msg);
+        faultInfo = new MsoRequestsDbExceptionBean (msg);
+    }
+
+    public MsoRequestsDbException (Throwable e) {
+        super(e);
+        faultInfo = new MsoRequestsDbExceptionBean (e.getMessage());
+    }
+
+    public MsoRequestsDbException (String msg, Throwable e) {
+        super (msg, e);
+        faultInfo = new MsoRequestsDbExceptionBean (msg);
+    }
+
+    public MsoRequestsDbException(String msg, ErrorCode errorCode) {
+        super(msg,errorCode.getValue());
+    }
+
+    public MsoRequestsDbException(String msg, ErrorCode errorCode, Throwable t) {
+        super(msg,errorCode.getValue(), t);
+    }
+
+    public MsoRequestsDbExceptionBean getFaultInfo() {
+        return faultInfo;
+    }
+
+    public void setFaultInfo(MsoRequestsDbExceptionBean faultInfo) {
+        this.faultInfo = faultInfo;
+    }
 }
index 102b529..ade3daa 100644 (file)
@@ -15,8 +15,8 @@ mso:
 spring:
   datasource:
     url: jdbc:mariadb://localhost:3306/requestdb
-    username: mso
-    password: mso123
+    username: catalog
+    password: catalog123
     driver-class-name: org.mariadb.jdbc.Driver
     initialize: true
     initialization-mode: never
index 58eb008..11f8ff0 100644 (file)
@@ -8,6 +8,7 @@ import org.junit.runner.RunWith;
 import org.onap.so.adapters.requestsdb.application.MSORequestDBApplication;
 import org.onap.so.db.request.beans.InfraActiveRequests;
 import org.onap.so.db.request.data.controller.InstanceNameDuplicateCheckRequest;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.context.embedded.LocalServerPort;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.web.client.TestRestTemplate;
@@ -39,6 +40,9 @@ public class InfraActiveRequestsRepositoryCustomControllerTest {
 
     @LocalServerPort
     private int port;
+    
+    @Value("${mso.adapters.requestDb.auth}")
+    private String msoAdaptersAuth;
 
     private String createURLWithPort(String uri) {
         return "http://localhost:" + port + uri;
@@ -82,6 +86,7 @@ public class InfraActiveRequestsRepositoryCustomControllerTest {
 
         headers.set("Accept", MediaType.APPLICATION_JSON);
         headers.set("Content-Type", MediaType.APPLICATION_JSON);
+        headers.set("Authorization", msoAdaptersAuth);
 
         infraActiveRequests = new InfraActiveRequests();
 
@@ -181,12 +186,13 @@ public class InfraActiveRequestsRepositoryCustomControllerTest {
     @Test
     public void checkVnfIdStatusTest() {
 
-        HttpEntity<List<String>> entityList = new HttpEntity("", headers);
+        
         UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests" + "/checkVnfIdStatus/" + infraActiveRequests.getOperationalEnvId()));
+        HttpEntity<String> entity = new HttpEntity(HttpEntity.EMPTY, headers);
 
         ResponseEntity<InfraActiveRequests> response = restTemplate.exchange(
                 builder.toUriString(),
-                HttpMethod.GET, HttpEntity.EMPTY, InfraActiveRequests.class);
+                HttpMethod.GET,entity , InfraActiveRequests.class);
 
         infraActiveRequestsResponse = response.getBody();
 
index 005eba0..159eb01 100644 (file)
 package org.onap.so.adapters.requestsdb.adapters;
 
 import static org.junit.Assert.*;
-
-
-
+import java.util.Map;
 import javax.ws.rs.core.Response;
 
 import org.json.JSONException;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
 import org.onap.so.adapters.requestsdb.application.MSORequestDBApplication;
-
+import org.onap.so.adapters.requestsdb.application.TestAppender;
+import org.onap.so.logger.MsoLogger;
 import org.springframework.boot.context.embedded.LocalServerPort;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.web.client.TestRestTemplate;
@@ -40,6 +40,7 @@ import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
+import ch.qos.logback.classic.spi.ILoggingEvent;
 
 
 @RunWith(SpringRunner.class)
@@ -65,6 +66,27 @@ public class HealthCheckHandlerTest {
                                HttpMethod.GET, entity, String.class);
                
                assertEquals(Response.Status.OK.getStatusCode(),response.getStatusCode().value());
+        for(ILoggingEvent logEvent : TestAppender.events)
+            if(logEvent.getLoggerName().equals("org.onap.so.logging.spring.interceptor.LoggingInterceptor") &&
+                    logEvent.getMarker().getName().equals("ENTRY")
+                    ){
+                Map<String,String> mdc = logEvent.getMDCPropertyMap();
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.INSTANCE_UUID));
+                assertNotNull(mdc.get(MsoLogger.REQUEST_ID));
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+                assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+                assertEquals("/manage/health",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+                assertEquals("INPROGRESS",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+            }else if(logEvent.getLoggerName().equals("org.onap.so.logging.spring.interceptor.LoggingInterceptor") &&
+                    logEvent.getMarker()!= null && logEvent.getMarker().getName().equals("EXIT")){
+                Map<String,String> mdc = logEvent.getMDCPropertyMap();
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+                assertEquals("200",mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
+                assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+                assertEquals("/manage/health",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+                assertEquals("COMPLETED",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+            }
        }
        
        private String createURLWithPort(String uri) {
index 4d00421..9ac0cce 100644 (file)
@@ -23,15 +23,20 @@ package org.onap.so.adapters.requestsdb.adapters;
 import static com.shazam.shazamcrest.MatcherAssert.assertThat;
 import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.List;
-
+import java.util.Map;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.junit.runner.RunWith;
+import org.onap.so.adapters.requestsdb.application.TestAppender;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
 import org.onap.so.adapters.requestsdb.MsoRequestsDbAdapter;
 import org.onap.so.adapters.requestsdb.RequestStatusType;
 import org.onap.so.adapters.requestsdb.application.MSORequestDBApplication;
@@ -41,12 +46,17 @@ import org.onap.so.db.request.beans.OperationStatus;
 import org.onap.so.db.request.beans.ResourceOperationStatus;
 import org.onap.so.db.request.data.repository.OperationStatusRepository;
 import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.onap.so.logger.MsoLogger;
 import org.onap.so.requestsdb.RequestsDbConstant;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.boot.context.embedded.LocalServerPort;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Bean;
 import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringRunner;
+import ch.qos.logback.classic.spi.ILoggingEvent;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(classes = MSORequestDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@@ -55,8 +65,7 @@ public class MSORequestDBImplTest {
 
        @LocalServerPort
        private int port;
-       
-       @Autowired
+
        private MsoRequestsDbAdapter dbAdapter;
                
     @Autowired
@@ -71,6 +80,16 @@ public class MSORequestDBImplTest {
        public InfraActiveRequests setupTestEntities()   {      
                return buildTestRequest();
        }       
+       
+       @Before
+       public void before(){
+        JaxWsProxyFactoryBean jaxWsProxyFactory = new JaxWsProxyFactoryBean();
+        jaxWsProxyFactory.setServiceClass(MsoRequestsDbAdapter.class);
+        jaxWsProxyFactory.setAddress("http://localhost:" + port + "/services/RequestsDbAdapter");
+        jaxWsProxyFactory.setUsername("bpel");
+        jaxWsProxyFactory.setPassword("password1$");
+        dbAdapter = (MsoRequestsDbAdapter) jaxWsProxyFactory.create();
+       }
 
        private InfraActiveRequests buildTestRequest() {        
                InfraActiveRequests testRequest= new InfraActiveRequests();
@@ -94,11 +113,9 @@ public class MSORequestDBImplTest {
                return testRequest;
        }
 
-       
-
-
        @Test
        public void getByRequestId() throws MsoRequestsDbException  {
+           
                InfraActiveRequests testRequest = setupTestEntities();
                // Given
                String requestId = "00032ab7-3fb3-42e5-965d-8ea592502017";
@@ -121,10 +138,8 @@ public class MSORequestDBImplTest {
                try {
                        dbAdapter.getInfraRequest(requestId);
                        fail("Expected MsoRequestsDbException to be thrown");
-               } catch (MsoRequestsDbException e) {
-                       assertEquals(e.getMessage(),"Error retrieving MSO Infra Requests DB for Request ID invalidRequestId");
                } catch (Exception e) {
-                       fail("Expected MsoRequestsDbException to be thrown, unknown exception thrown");
+                   assertEquals(e.getMessage(),"Error retrieving MSO Infra Requests DB for Request ID invalidRequestId");
                }               
        }
        
@@ -230,11 +245,9 @@ public class MSORequestDBImplTest {
                                        null,
                                        null,
                                        null);
-                       fail("Expected MsoRequestsDbException to be thrown");
-               } catch (MsoRequestsDbException e) {
-                       assertEquals(e.getMessage(),"Error retrieving MSO Infra Requests DB for Request ID invalidRequestId");
+                       fail("Expected MsoRequestsDbException to be thrown");   
                } catch (Exception e) {
-                       fail("Expected MsoRequestsDbException to be thrown, unknown exception thrown");
+                   assertEquals(e.getMessage(),"Error retrieving MSO Infra Requests DB for Request ID invalidRequestId");
                }               
        }
        
@@ -328,6 +341,7 @@ public class MSORequestDBImplTest {
        
        @Test 
        public void updateServiceOperation_Not_Found() throws MsoRequestsDbException{
+           TestAppender.events.clear();
                String serviceId = "badserviceId";
                String operationId = "operationid";
                String operation = "newOperationType";
@@ -349,12 +363,35 @@ public class MSORequestDBImplTest {
                updatedOperationStatus.setProgress(progress);
                updatedOperationStatus.setReason(reason);
                updatedOperationStatus.setOperationContent(operationContent);
-               
-               thrown.expect(MsoRequestsDbException.class);
-               thrown.expectMessage("Unable to retrieve OperationStatus Object ServiceId: " + serviceId + " operationId: " + operationId);
-               
-               dbAdapter.updateServiceOperationStatus(serviceId, operationId, operation,  userId,
-                    result, operationContent,  progress, reason);              
+
+               try {
+            dbAdapter.updateServiceOperationStatus(serviceId, operationId, operation,  userId,
+                     result, operationContent,  progress, reason);
+            fail("Expected MsoRequestsDbException to be thrown");   
+        } catch (Exception e) {
+            assertEquals("Entity not found. Unable to retrieve OperationStatus Object ServiceId: " + serviceId + " operationId: " + operationId,e.getMessage());
+            for(ILoggingEvent logEvent : TestAppender.events)
+                if(logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor") &&
+                        logEvent.getMarker().getName().equals("ENTRY")
+                        ){
+                    Map<String,String> mdc = logEvent.getMDCPropertyMap();
+                    assertNotNull(mdc.get(ONAPLogConstants.MDCs.INSTANCE_UUID));
+                    assertNotNull(mdc.get(MsoLogger.REQUEST_ID));
+                    assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+                    assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+                    assertEquals("/services/RequestsDbAdapter",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+                    assertEquals("INPROGRESS",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+                }else if(logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor") &&
+                        logEvent.getMarker()!= null && logEvent.getMarker().getName().equals("EXIT")){
+                    Map<String,String> mdc = logEvent.getMDCPropertyMap();
+                    assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
+                    assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+                    assertEquals("500",mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
+                    assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+                    assertEquals("/services/RequestsDbAdapter",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+                    assertEquals("ERROR",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+                }
+        }              
                
        }
        
@@ -423,6 +460,7 @@ public class MSORequestDBImplTest {
 
        @Test
        public void updateResourceOperationStatus() throws MsoRequestsDbException{
+           TestAppender.events.clear();
                String resourceTemplateUUID = "template1";
                String serviceId = "serviceId";
                String operationId = "operationId";
@@ -454,6 +492,28 @@ public class MSORequestDBImplTest {
 
                ResourceOperationStatus actualResource = dbAdapter.getResourceOperationStatus(serviceId, operationId,"template1");
                assertThat(actualResource, sameBeanAs(expectedResource));
+               
+               for(ILoggingEvent logEvent : TestAppender.events)
+            if(logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor") &&
+                    logEvent.getMarker().getName().equals("ENTRY")
+                    ){
+                Map<String,String> mdc = logEvent.getMDCPropertyMap();
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.INSTANCE_UUID));
+                assertNotNull(mdc.get(MsoLogger.REQUEST_ID));
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+                assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+                assertEquals("/services/RequestsDbAdapter",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+                assertEquals("INPROGRESS",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+            }else if(logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor") &&
+                    logEvent.getMarker().getName().equals("EXIT")){
+                Map<String,String> mdc = logEvent.getMDCPropertyMap();
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
+                assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+                assertEquals(null,mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
+                assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
+                assertEquals("/services/RequestsDbAdapter",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
+                assertEquals("COMPLETED",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+            }
        }
 
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.cloud;
+package org.onap.so.adapters.requestsdb.application;
 
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.domain.EntityScan;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import java.util.ArrayList;
+import java.util.List;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.AppenderBase;
 
-@SpringBootApplication(scanBasePackages = { "org.onap"})
-@EnableJpaRepositories({"org.onap.so.db.catalog.data.repository", "org.onap.so.db.request.data.repository"})
-@EntityScan({"org.onap.so.db.catalog.beans", "org.onap.so.db.request.beans"})
-public class Application {
 
-    public static void main(String[] args) {
-        SpringApplication.run(Application.class, args);
-        System.getProperties().setProperty("mso.db", "MARIADB");
-        System.getProperties().setProperty("server.name", "Springboot");    
-    }    
+
+public class TestAppender  extends AppenderBase<ILoggingEvent> {
+    public static List<ILoggingEvent> events = new ArrayList<>();
+       @Override
+       public void append(ILoggingEvent loggingEvent) {
+               events.add(loggingEvent);               
+       }
 }
index 49582ec..165b667 100644 (file)
@@ -1,5 +1,7 @@
 # will be used as entry in DB to say SITE OFF/ON for healthcheck
-
+security:
+  basic:
+    enabled: false
 server:
     port: 8080
     tomcat:
@@ -8,7 +10,7 @@ ssl-enable: false
 mso:
   adapters:
     requestDb:
-      auth: Basic YnBlbDptc28tZGItMTUwNyE=
+      auth: Basic YnBlbDpwYXNzd29yZDEk
       endpoint: http://localhost:8081
   logPath: logs
   site-name: localSite
@@ -34,8 +36,8 @@ spring:
   security:
     usercredentials:
     -  
-      username: test
-      password: '$2a$12$Zi3AuYcZoZO/gBQyUtST2.F5N6HqcTtaNci2Et.ufsQhski56srIu'
+      username: bpel
+      password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
       role: BPEL-Client
 mariaDB4j:
   dataDir: 
index 54fa1cd..d1596cd 100644 (file)
@@ -1,33 +1,55 @@
 <configuration>
-  
-  
-  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n</pattern>
-    </encoder>
-  </appender>
-
-
-  <logger name="com.att.ecomp.audit" level="info" additivity="false">
-    <appender-ref ref="STDOUT" />
-  </logger>
-  
-  <logger name="com.att.eelf.metrics" level="info" additivity="false">
-        <appender-ref ref="STDOUT" />
-  </logger>
+       <property name="p_tim" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}"/>
+    <property name="p_lvl" value="%level"/>
+    <property name="p_log" value="%logger"/>
+    <property name="p_mdc" value="%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}"/>
+    <property name="p_msg" value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+    <property name="p_exc" value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+    <property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+    <property name="p_thr" value="%thread"/>
+    <property name="pattern" value="%nopexception${p_tim}\t${p_thr}\t${p_lvl}\t${p_log}\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t%n"/>
+
+
+       <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+               <encoder>
+                       <pattern>${pattern}</pattern>
+               </encoder>
+       </appender>
+
+       <appender name="test"
+               class="org.onap.so.adapters.requestsdb.application.TestAppender" />
+
+       <logger name="com.att.ecomp.audit" level="info" additivity="false">
+               <appender-ref ref="STDOUT" />
+       </logger>
+
+       <logger name="com.att.eelf.metrics" level="info" additivity="false">
+               <appender-ref ref="STDOUT" />
+       </logger>
+
+       <logger name="com.att.eelf.error" level="WARN" additivity="false">
+               <appender-ref ref="STDOUT" />
+       </logger>
 
-  <logger name="com.att.eelf.error" level="trace" additivity="false">
-    <appender-ref ref="STDOUT" />
-  </logger> 
-  
        <logger name="org.onap" level="${so.log.level:-DEBUG}" additivity="false">
                <appender-ref ref="STDOUT" />
+               <appender-ref ref="test" />
        </logger>
-        <logger name="org.flywaydb" level="DEBUG" additivity="false">
+       
+       <logger name="org.flywaydb" level="DEBUG" additivity="false">
         <appender-ref ref="STDOUT" />
     </logger>
-  <root level="WARN">
-    <appender-ref ref="STDOUT" />
-  </root>
-  
+       
+
+       <logger name="ch.vorburger" level="WARN" additivity="false">
+               <appender-ref ref="STDOUT" />
+       </logger>
+       
+
+       <root level="WARN">
+               <appender-ref ref="STDOUT" />
+               <appender-ref ref="test" />
+       </root>
+
+
 </configuration>
\ No newline at end of file
index 4a50fb3..f6fd8d5 100644 (file)
@@ -33,7 +33,9 @@ import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.transport.servlet.CXFServlet;
 import org.onap.so.adapters.sdnc.sdncrest.SNIROResponse;
 import org.onap.so.logger.MsoLogger;
-import org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging;
+import org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor;
+import org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor;
+import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.web.servlet.ServletRegistrationBean;
 import org.springframework.context.annotation.Bean;
@@ -63,6 +65,11 @@ public class CXFConfiguration {
        @Autowired 
        private SNIROResponse sniroResponse;
 
+       @Autowired
+       private SOAPLoggingInInterceptor soapInInterceptor;
+           
+       @Autowired
+       private SOAPLoggingOutInterceptor soapOutInterceptor;
     
        @Autowired
        private ObjectMapper mapper;
@@ -85,9 +92,12 @@ public class CXFConfiguration {
 
     @Bean
     public Endpoint sndcAdapter() {
-        EndpointImpl endpoint = new EndpointImpl(bus, sdncAdapterPortImpl);
-        endpoint.publish("/SDNCAdapter");
-        return endpoint;
+        EndpointImpl wsdlEndpoint = new EndpointImpl(bus, sdncAdapterPortImpl);
+        wsdlEndpoint.getInInterceptors().add(soapInInterceptor);
+        wsdlEndpoint.getOutInterceptors().add(soapOutInterceptor);
+        wsdlEndpoint.getOutFaultInterceptors().add(soapOutInterceptor);
+        wsdlEndpoint.publish("/SDNCAdapter");
+        return wsdlEndpoint;
     }
 
 
index b456fb2..a5800fc 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
@@ -87,7 +89,7 @@ public class MapRequestTunables {
                                }
                        }
 
-                       if (reqTunable.getSdncUrl() == null || reqTunable.getSdncUrl().equals("")) {
+                       if (reqTunable.getSdncUrl() == null || ("").equals(reqTunable.getSdncUrl())) {
                                error = "Invalid configuration, sdncUrl required for:" + key + " value:" + value;
                        }
                } else {
index 8541889..da00a6f 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
@@ -35,6 +37,10 @@ public class MapTypedRequestTunablesData {
        private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,MapTypedRequestTunablesData.class);
        
        private static final MsoAlarmLogger alarmLogger = new MsoAlarmLogger(); 
+       
+       private static final String MISSING_CONFIGURATION_ERROR_MSG= "Missing configuration for: ";
+       private static final String MISSING_CONFIG_PARAM_ERROR_MSG="Missing config param";
+       private static final String MSO_INTERNAL_ERROR="MsoInternalError";
                
        @Autowired
        private Environment env;
@@ -47,9 +53,9 @@ public class MapTypedRequestTunablesData {
                String value = env.getProperty(reqTunable.getKey().toLowerCase(), "");
 
                if ("".equals(value)) {
-                       error= "Missing configuration for: " + reqTunable.getKey();
-                       msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, reqTunable.getKey(), "SDNC", "", MsoLogger.ErrorCode.DataError, "Missing config param");
-                       alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, reqTunable.getError());              
+                       error= MISSING_CONFIGURATION_ERROR_MSG + reqTunable.getKey();
+                       msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, reqTunable.getKey(), "SDNC", "", MsoLogger.ErrorCode.DataError, MISSING_CONFIG_PARAM_ERROR_MSG);
+                       alarmLogger.sendAlarm(MSO_INTERNAL_ERROR, MsoAlarmLogger.CRITICAL, reqTunable.getError());              
                        throw new SDNCAdapterException(error);
                }
 
@@ -58,7 +64,7 @@ public class MapTypedRequestTunablesData {
                if (parts.length != 5) {
                        error="Invalid configuration for: " + reqTunable.getKey();
                        msoLogger.error(MessageEnum.RA_SDNC_INVALID_CONFIG, reqTunable.getKey(), value, "SDNC", "", MsoLogger.ErrorCode.DataError, "Invalid config");
-                       alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, reqTunable.getError());      
+                       alarmLogger.sendAlarm(MSO_INTERNAL_ERROR, MsoAlarmLogger.CRITICAL, reqTunable.getError());      
                        throw new SDNCAdapterException(error);
                }
 
@@ -72,9 +78,9 @@ public class MapTypedRequestTunablesData {
                reqTunable.setSdncUrl(env.getProperty(urlPropKey, ""));
 
                if ("".equals(reqTunable.getSdncUrl())) {
-                       error="Missing configuration for: " + urlPropKey;
-                       msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, urlPropKey, "SDNC", "", MsoLogger.ErrorCode.DataError, "Missing config param");
-                       alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, reqTunable.getError());
+                       error=MISSING_CONFIGURATION_ERROR_MSG + urlPropKey;
+                       msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, urlPropKey, "SDNC", "", MsoLogger.ErrorCode.DataError, MISSING_CONFIG_PARAM_ERROR_MSG);
+                       alarmLogger.sendAlarm(MSO_INTERNAL_ERROR, MsoAlarmLogger.CRITICAL, reqTunable.getError());
                        throw new SDNCAdapterException(error);
                }
 
@@ -89,10 +95,10 @@ public class MapTypedRequestTunablesData {
                reqTunable.setMyUrl(env.getProperty(Constants.MY_URL_PROP, ""));
 
                if ("".equals(reqTunable.getMyUrl())) {
-                       error="Missing configuration for: " + Constants.MY_URL_PROP;
+                       error=MISSING_CONFIGURATION_ERROR_MSG + Constants.MY_URL_PROP;
                        msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, Constants.MY_URL_PROP, "SDNC", "",
-                               MsoLogger.ErrorCode.DataError, "Missing config param");
-                       alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, reqTunable.getError());              
+                               MsoLogger.ErrorCode.DataError, MISSING_CONFIG_PARAM_ERROR_MSG);
+                       alarmLogger.sendAlarm(MSO_INTERNAL_ERROR, MsoAlarmLogger.CRITICAL, reqTunable.getError());              
                        throw new SDNCAdapterException(error);
                }
 
index 2fd39df..8ca1450 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
@@ -149,7 +151,7 @@ public class SDNCServiceRequestConnector extends SDNCConnector {
                                ackFinalIndicator = "Y";
                        }
 
-                       if (!ackFinalIndicator.equals("Y") && !"N".equals(ackFinalIndicator)) {
+                       if (!"Y".equals(ackFinalIndicator) && !"N".equals(ackFinalIndicator)) {
                                throw new ParseException("Invalid ack-final-indicator in SDNC response: '" + ackFinalIndicator + "'", 0);
                        }
 
@@ -161,7 +163,7 @@ public class SDNCServiceRequestConnector extends SDNCConnector {
 
                        // If the response code in the message from SDNC was not 2XX, return SDNCServiceError.
 
-                       if (!responseCode.matches("2[0-9][0-9]") && !responseCode.equals("0")) {
+                       if (!responseCode.matches("2[0-9][0-9]") && !("0").equals(responseCode)) {
                                // Not a 2XX response.  Return SDNCServiceError.
                                return new SDNCServiceError(svcRequestId, responseCode, responseMessage, ackFinalIndicator);
                        }
index 29a1db8..9716bb6 100644 (file)
@@ -24,7 +24,6 @@ import org.junit.After;
 import org.junit.Rule;
 import org.junit.rules.ExpectedException;
 import org.junit.runner.RunWith;
-import org.onap.so.cloud.Application;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.web.client.TestRestTemplate;
@@ -33,7 +32,7 @@ import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@SpringBootTest(classes = SDNCAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
 @ActiveProfiles("test")
 @AutoConfigureWireMock(port = 0)
 public abstract class BaseTest {
index 3034cbc..031bc2e 100644 (file)
@@ -32,7 +32,7 @@ import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.transport.servlet.CXFServlet;
 import org.onap.so.adapters.vfc.rest.HealthCheckHandler;
 import org.onap.so.adapters.vfc.rest.VfcAdapterRest;
-import org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging;
+import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.web.servlet.ServletRegistrationBean;
 import org.springframework.context.annotation.Bean;
index 9489ef1..b560690 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
@@ -51,7 +53,7 @@ import org.springframework.stereotype.Component;
 public class VfcAdapterRest {
 
     private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, VfcAdapterRest.class);
-
+    private static final String REQUEST_DEBUG_MSG="body from request is {}";
     @Autowired
     private VfcManager driverMgr ;
 
@@ -73,7 +75,7 @@ public class VfcAdapterRest {
     public Response createNfvoNs(String data) {
         try {
             ValidateUtil.assertObjectNotNull(data);
-            LOGGER.debug("body from request is {}" + data);
+            LOGGER.debug(REQUEST_DEBUG_MSG + data);
             NSResourceInputParameter nsInput = JsonUtil.unMarshal(data, NSResourceInputParameter.class);
             RestfulResponse rsp = driverMgr.createNs(nsInput);
             return buildResponse(rsp);
@@ -99,7 +101,7 @@ public class VfcAdapterRest {
         try {
 
             ValidateUtil.assertObjectNotNull(data);
-            LOGGER.debug("body from request is {}" + data);
+            LOGGER.debug(REQUEST_DEBUG_MSG + data);
             NsOperationKey nsOperationKey = JsonUtil.unMarshal(data, NsOperationKey.class);
             RestfulResponse rsp = driverMgr.deleteNs(nsOperationKey, nsInstanceId);
             return buildResponse(rsp);
@@ -124,7 +126,7 @@ public class VfcAdapterRest {
     public Response queryNfvoJobStatus(String data, @PathParam("jobId") String jobId) {
         try {
             ValidateUtil.assertObjectNotNull(data);
-            LOGGER.debug("body from request is {}" + data);
+            LOGGER.debug(REQUEST_DEBUG_MSG + data);
             NsOperationKey nsOperationKey = JsonUtil.unMarshal(data, NsOperationKey.class);
             RestfulResponse rsp = driverMgr.getNsProgress(nsOperationKey, jobId);
             return buildResponse(rsp);
@@ -149,7 +151,7 @@ public class VfcAdapterRest {
     public Response instantiateNfvoNs(String data, @PathParam("nsInstanceId") String nsInstanceId) {
         try {
             ValidateUtil.assertObjectNotNull(data);
-            LOGGER.debug("body from request is {}" + data);
+            LOGGER.debug(REQUEST_DEBUG_MSG + data);
             NSResourceInputParameter nsInput = JsonUtil.unMarshal(data, NSResourceInputParameter.class);
             RestfulResponse rsp = driverMgr.instantiateNs(nsInstanceId, nsInput);
             return buildResponse(rsp);
@@ -174,7 +176,7 @@ public class VfcAdapterRest {
     public Response terminateNfvoNs(String data, @PathParam("nsInstanceId") String nsInstanceId) {
         try {
             ValidateUtil.assertObjectNotNull(data);
-            LOGGER.debug("body from request is {}" + data);
+            LOGGER.debug(REQUEST_DEBUG_MSG + data);
             NsOperationKey nsOperationKey = JsonUtil.unMarshal(data, NsOperationKey.class);
             RestfulResponse rsp = driverMgr.terminateNs(nsOperationKey, nsInstanceId);
             return buildResponse(rsp);
index c12cd7d..64032e2 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
@@ -51,7 +53,7 @@ public class JsonUtil {
    * Mapper.
    */
   private static final ObjectMapper MAPPER = new ObjectMapper();
-
+  private static final String UNMARSHAL_FAIL_MSG="fail to unMarshal json";
   static {
     MAPPER.setConfig(MAPPER.getDeserializationConfig().without(
         DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES));
@@ -82,8 +84,8 @@ public class JsonUtil {
       return MAPPER.readValue(jsonstr, type);
     } catch (IOException e) {
       LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
-          "fail to unMarshal json", e);
-      throw new ApplicationException(HttpCode.BAD_REQUEST, "fail to unMarshal json");
+          UNMARSHAL_FAIL_MSG, e);
+      throw new ApplicationException(HttpCode.BAD_REQUEST, UNMARSHAL_FAIL_MSG);
     }
   }
 
@@ -100,8 +102,8 @@ public class JsonUtil {
       return MAPPER.readValue(jsonstr, type);
     } catch (IOException e) {
       LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
-          "fail to unMarshal json", e);
-      throw new ApplicationException(HttpCode.BAD_REQUEST, "fail to unMarshal json");
+          UNMARSHAL_FAIL_MSG, e);
+      throw new ApplicationException(HttpCode.BAD_REQUEST, UNMARSHAL_FAIL_MSG);
     }
   }
 
index 5b8779a..0536dd3 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (C) 2018.
+ * ================================================================================
  * 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
@@ -73,6 +75,8 @@ public class RestfulUtil {
     private static final String DEFAULT_MSB_IP = "127.0.0.1";
 
     private static final Integer DEFAULT_MSB_PORT = 80;
+    
+    private static final String VFC_ADAPTER="VFC Adapter";
 
    @Autowired
    private Environment env;
@@ -95,7 +99,7 @@ public class RestfulUtil {
 
     public RestfulResponse send(String url, String methodType, String content) {
         String msbUrl = getMsbHost() + url;
-        LOGGER.info(MessageEnum.RA_NS_EXC, "Begin to sent message " + methodType +": " + msbUrl, "org.onap.so.adapters.vfc.util.RestfulUtil","VFC Adapter");
+        LOGGER.info(MessageEnum.RA_NS_EXC, "Begin to sent message " + methodType +": " + msbUrl, "org.onap.so.adapters.vfc.util.RestfulUtil",VFC_ADAPTER);
 
         HttpRequestBase method = null;
         HttpResponse httpResponse = null;
@@ -196,12 +200,12 @@ public class RestfulUtil {
     }
 
     private static void logError(String errMsg, Throwable t) {
-        LOGGER.error(MessageEnum.RA_NS_EXC, "VFC Adapter", "", MsoLogger.ErrorCode.AvailabilityError, errMsg, t);
+        LOGGER.error(MessageEnum.RA_NS_EXC, VFC_ADAPTER, "", MsoLogger.ErrorCode.AvailabilityError, errMsg, t);
         ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, errMsg);
     }
 
     private static void logError(String errMsg) {
-        LOGGER.error(MessageEnum.RA_NS_EXC, "VFC Adapter", "", MsoLogger.ErrorCode.AvailabilityError, errMsg);
+        LOGGER.error(MessageEnum.RA_NS_EXC, VFC_ADAPTER, "", MsoLogger.ErrorCode.AvailabilityError, errMsg);
         ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, errMsg);
     }
 
index 7019131..5da47c9 100644 (file)
@@ -22,8 +22,8 @@ package org.onap.so.bpmn.common.recipe;
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.bpmn.core.domain.ModelInfo;
+import org.onap.so.BaseTest;
 
 public class ResourceInputTest extends BaseTest{
    
index 5f90f1e..634e0a6 100644 (file)
@@ -30,7 +30,6 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
-import org.onap.so.BaseTest;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.common.DelegateExecutionImpl;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.*;
@@ -38,6 +37,7 @@ import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
 import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
 import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
 import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.onap.so.BaseTest;
 
 public class ExtractPojosForBBTest extends BaseTest{
        ExtractPojosForBB extractPojos = new ExtractPojosForBB();
index 5e22750..79cb33b 100644 (file)
@@ -28,13 +28,13 @@ import static org.mockito.Mockito.doThrow;
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.junit.Before;
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.bpmn.core.WorkflowException;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
 import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
 import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
+import org.onap.so.BaseTest;
 import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
 import org.springframework.beans.factory.annotation.Autowired;
 
index 3a4d6a0..c8e1266 100644 (file)
@@ -44,7 +44,6 @@ import javax.ws.rs.core.Response.Status;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.onap.so.BaseTest;
-
 import junitparams.JUnitParamsRunner;
 import junitparams.Parameters;
 
index 8d33a08..6fad47d 100644 (file)
@@ -38,9 +38,8 @@ import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.onap.appc.client.lcm.model.Action;
 import org.onap.appc.client.lcm.model.Status;
-import org.onap.so.BaseTest;
 import org.onap.so.bpmn.appc.payload.PayloadClient;
-
+import org.onap.so.BaseTest;
 import com.fasterxml.jackson.core.JsonProcessingException;
 
 
index 7fabb2a..0aeb3a2 100644 (file)
@@ -33,7 +33,6 @@ import org.onap.appc.client.lcm.model.ActionIdentifiers;
 import org.onap.appc.client.lcm.model.CheckLockInput;
 import org.onap.appc.client.lcm.model.Status;
 import org.onap.so.BaseTest;
-
 import java.util.Properties;
 import java.util.UUID;
 
index 5ef26b3..b388d8b 100644 (file)
@@ -25,9 +25,8 @@ import static org.assertj.core.api.Assertions.assertThat;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.onap.appc.client.lcm.model.Status;
-import org.onap.so.BaseTest;
 import org.onap.so.client.appc.ApplicationControllerSupport.StatusCategory;
-
+import org.onap.so.BaseTest;
 import junitparams.JUnitParamsRunner;
 import junitparams.Parameters;
 
index 35586cc..dbf2eb7 100644 (file)
@@ -32,9 +32,9 @@ import java.io.IOException;
 
 import org.apache.http.HttpStatus;
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.client.avpn.dmaap.beans.AVPNDmaapBean;
 import org.onap.so.client.exception.MapperException;
+import org.onap.so.BaseTest;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
index 9ada85f..d1013e7 100644 (file)
@@ -24,8 +24,8 @@ import static org.junit.Assert.assertEquals;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.bpmn.mock.FileUtil;
+import org.onap.so.BaseTest;
 
 public class ExceptionBuilderTest extends BaseTest {
 
index 8231c2f..08c92d3 100644 (file)
@@ -36,9 +36,9 @@ import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.client.RestPropertiesLoader;
 import org.onap.so.client.aai.AAIProperties;
+import org.onap.so.BaseTest;
 
 public class ThreadedReadTest {
        @Test
index 8fe7ebe..7721588 100644 (file)
@@ -37,7 +37,9 @@ import org.onap.so.bpmn.common.workflow.service.WorkflowAsyncResource;
 import org.onap.so.bpmn.common.workflow.service.WorkflowMessageResource;
 import org.onap.so.bpmn.common.workflow.service.WorkflowResource;
 import org.onap.so.logger.MsoLogger;
-import org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging;
+import org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor;
+import org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor;
+import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.web.servlet.ServletRegistrationBean;
 import org.springframework.context.annotation.Bean;
@@ -76,6 +78,12 @@ public class CXFConfiguration {
        @Autowired
        private VnfAdapterNotify vnfAdapterNotifyServiceImpl;
        
+       @Autowired
+       private SOAPLoggingInInterceptor soapInInterceptor;
+
+       @Autowired
+       private SOAPLoggingOutInterceptor soapOutInterceptor;
+       
        @Bean
     public ServletRegistrationBean cxfServlet() {
         return new ServletRegistrationBean(new CXFServlet(), "/mso/*");
@@ -85,6 +93,9 @@ public class CXFConfiguration {
     public Endpoint vnfAdapterCallback() {
         EndpointImpl endpoint = new EndpointImpl(bus, vnfAdapterNotifyServiceImpl);
         endpoint.publish("/VNFAdaptercallback");
+        endpoint.getInInterceptors().add(soapInInterceptor);
+        endpoint.getOutInterceptors().add(soapOutInterceptor);
+        endpoint.getOutFaultInterceptors().add(soapOutInterceptor);
         return endpoint;
     }
        
@@ -92,6 +103,9 @@ public class CXFConfiguration {
     public Endpoint sndcAdapterCallback() {
         EndpointImpl endpoint = new EndpointImpl(bus, sdncAdapterCallbackServiceImpl);
         endpoint.publish("/SDNCAdapterCallbackService");
+        endpoint.getInInterceptors().add(soapInInterceptor);
+        endpoint.getOutInterceptors().add(soapOutInterceptor);
+        endpoint.getOutFaultInterceptors().add(soapOutInterceptor);
         return endpoint;
     }
                
index 9843a95..884c2ac 100644 (file)
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.bpmn.common.adapter.sdnc.CallbackHeader;
 import org.onap.so.bpmn.common.adapter.sdnc.SDNCAdapterCallbackRequest;
 
index c05d42c..d4496d3 100644 (file)
@@ -28,9 +28,9 @@ import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
 import org.junit.Ignore;
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.bpmn.buildingblock.SniroHomingV2;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.BaseTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
 
 
index bed5915..4626615 100644 (file)
@@ -41,7 +41,6 @@ import org.json.JSONObject;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
-import org.onap.so.BaseTest;
 import org.onap.so.bpmn.mock.FileUtil;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
@@ -55,7 +54,7 @@ import org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate;
 import org.onap.so.bpmn.servicedecomposition.homingobjects.CandidateType;
 import org.onap.so.client.exception.BadResponseException;
 import org.onap.so.client.sniro.beans.SniroManagerRequest;
-
+import org.onap.so.BaseTest;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
index 808bbc1..df4698d 100644 (file)
@@ -311,8 +311,8 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
                        //Get Service Instance Info
                        String serviceInstanceId = getVariableEnforced(execution, "DoCVNF_serviceInstanceId")
 
-                       String globalCustId = execution.getVariable("global-customer-id")
-                       String serviceType = execution.getVariable("service-type")
+                       String globalCustId = execution.getVariable("globalCustomerId")
+                       String serviceType = execution.getVariable("serviceType")
 
                        Map<String, String> payload = new LinkedHashMap<>();
                        payload.put("vnf-id", vnfId);
@@ -337,7 +337,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
                        resourceClient.connect(uri, siUri)
 
                }catch(Exception ex) {
-                       msoLogger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process " + ex.getMessage())
+                       msoLogger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process ", ex)
                        exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf CreateGenericVnf Process")
                }
                msoLogger.trace("COMPLETED DoCreateVnf CreateGenericVnf Process")
index 5833244..515a9bb 100644 (file)
@@ -518,7 +518,6 @@ CreateVcpeResCustService.prepareCreateAllottedResourceBRG(execution)]]></bpmn2:s
         <camunda:in source="serviceModelInfo" target="serviceModelInfo" />
         <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
         <camunda:in source="serviceDecomposition" target="serviceDecomposition" />
-        <camunda:in source="RegionOne_flavorList" target="RegionOne_flavorList" />
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_0ws7fjn</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1mkdhw9</bpmn2:outgoing>
index d817f57..0d48719 100644 (file)
@@ -40,7 +40,6 @@ doCreateVnfAndModules.preProcessRequest(execution)]]></bpmn:script>
         <camunda:in source="tenantId" target="tenantId" />
         <camunda:in source="false" target="usePreload" />
         <camunda:in source="aLaCarte" target="aLaCarte" />
-        <camunda:in source="RegionOne_flavorList" target="RegionOne_flavorList" />
       </bpmn:extensionElements>
       <bpmn:incoming>SequenceFlow_1hf7k7q</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1ixcnb6</bpmn:outgoing>
@@ -128,7 +127,6 @@ doCreateVnfAndModules.validateAddOnModule(execution)]]></bpmn:script>
         <camunda:in source="tenantId" target="tenantId" />
         <camunda:in source="rollbackData" target="rollbackData" />
         <camunda:in source="vnfResourceDecomposition" target="vnfResourceDecomposition" />
-        <camunda:in source="RegionOne_flavorList" target="RegionOne_flavorList" />
       </bpmn:extensionElements>
       <bpmn:incoming>SequenceFlow_19ohb1a</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_07u8e3l</bpmn:outgoing>
index 207b9f3..352eb20 100644 (file)
@@ -30,7 +30,6 @@ import static org.junit.Assert.assertEquals;
 
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.adapters.nwrest.CreateNetworkError;
 import org.onap.so.adapters.nwrest.CreateNetworkRequest;
 import org.onap.so.adapters.nwrest.CreateNetworkResponse;
@@ -45,6 +44,7 @@ import org.onap.so.adapters.nwrest.RollbackNetworkResponse;
 import org.onap.so.adapters.nwrest.UpdateNetworkError;
 import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
 import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
+import org.onap.so.BaseTest;
 import org.onap.so.openstack.beans.NetworkRollback;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
index 85f787f..f7ad5f5 100644 (file)
@@ -31,7 +31,6 @@ import static org.junit.Assert.assertEquals;
 
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.onap.so.BaseTest;
 import org.onap.so.adapters.vnfrest.CreateVfModuleRequest;
 import org.onap.so.adapters.vnfrest.CreateVfModuleResponse;
 import org.onap.so.adapters.vnfrest.DeleteVfModuleRequest;
@@ -43,7 +42,7 @@ import org.onap.so.adapters.vnfrest.UpdateVfModuleRequest;
 import org.onap.so.adapters.vnfrest.UpdateVfModuleResponse;
 import org.onap.so.adapters.vnfrest.VfModuleExceptionResponse;
 import org.onap.so.adapters.vnfrest.VfModuleRollback;
-
+import org.onap.so.BaseTest;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
index b356b21..e3d849f 100644 (file)
@@ -33,7 +33,6 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.MockitoAnnotations;
 import org.mockito.runners.MockitoJUnitRunner;
-import org.onap.so.BaseTest;
 import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest;
 import org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse;
 import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest;
@@ -43,6 +42,7 @@ import org.onap.so.adapters.vnfrest.RollbackVolumeGroupResponse;
 import org.onap.so.adapters.vnfrest.UpdateVolumeGroupRequest;
 import org.onap.so.adapters.vnfrest.UpdateVolumeGroupResponse;
 import org.onap.so.client.adapter.rest.AdapterRestClient;
+import org.onap.so.BaseTest;
 
 
 @RunWith(MockitoJUnitRunner.class)
index dccebb2..490f2c7 100644 (file)
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-web</artifactId>
                </dependency>
+               <dependency>
+               <groupId>org.springframework</groupId>
+               <artifactId>spring-webmvc</artifactId>
+               </dependency>
                <dependency>
                        <groupId>org.onap.aai.aai-common</groupId>
                        <artifactId>aai-schema</artifactId>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-rt-rs-client</artifactId>
                        <version>${cxf.version}</version>
-                       <scope>test</scope>
+               </dependency>
+               <dependency>
+               <groupId>org.apache.cxf</groupId>
+               <artifactId>cxf-rt-bindings-soap</artifactId>
+                       <version>${cxf.version}</version>
+               </dependency>
+               <dependency>
+               <groupId>org.apache.cxf</groupId>
+               <artifactId>cxf-rt-transports-http</artifactId>
+               <version>${cxf.version}</version>
                </dependency>
                <dependency>
                        <groupId>com.shazam</groupId>
             <artifactId>spring-security-web</artifactId>
             <version>5.0.5.RELEASE</version>
         </dependency>
-
+               <dependency>
+                       <groupId>org.onap.logging-analytics</groupId>
+                       <artifactId>logging-slf4j</artifactId>
+                       <version>1.2.2-SNAPSHOT</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>com.att.eelf</groupId>
+                                       <artifactId>eelf-core</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
     </dependencies>
        <build>
                <resources>
index 0f4bbea..cb8e1f0 100644 (file)
@@ -50,7 +50,7 @@ import javax.ws.rs.core.UriBuilder;
 import org.onap.so.client.policy.CommonObjectMapperProvider;
 import org.onap.so.client.policy.LoggingFilter;
 import org.onap.so.logger.MsoLogger;
-import org.onap.so.logging.jaxrs.filter.jersey.JaxRsClientLogging;
+import org.onap.so.logging.jaxrs.filter.JaxRsClientLogging;
 import org.onap.so.utils.CryptoUtils;
 import org.onap.so.utils.TargetEntity;
 import org.slf4j.MDC;
diff --git a/common/src/main/java/org/onap/so/exceptions/MSOException.java b/common/src/main/java/org/onap/so/exceptions/MSOException.java
new file mode 100644 (file)
index 0000000..c4be075
--- /dev/null
@@ -0,0 +1,36 @@
+package org.onap.so.exceptions;
+
+
+public class MSOException extends Exception{
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 4563920496855255206L;
+    private Integer errorCode;
+
+    public MSOException(String msg){
+        super(msg);
+    }
+    
+    public MSOException (Throwable e) {
+        super(e);
+    }
+    
+    public MSOException (String msg, Throwable e) {
+        super (msg, e);
+    }
+    
+    public MSOException(String msg, int errorCode){
+        super(msg);
+        this.errorCode=errorCode;
+    }
+    
+    public MSOException(String msg, int errorCode, Throwable t){
+        super(msg,t);
+        this.errorCode=errorCode;
+    }
+    
+    public Integer getErrorCode(){
+        return errorCode;
+    }
+}
index 0d20dd8..1ed18ea 100644 (file)
@@ -15,6 +15,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * Modifications Copyright (C) 2018 IBM.
  * ============LICENSE_END=========================================================
  */
 
@@ -23,6 +24,7 @@ package org.onap.so.logger;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
+import org.onap.so.utils.UUIDChecker;
 import org.springframework.stereotype.Component;
 
 import ch.qos.logback.classic.Level;
@@ -37,6 +39,7 @@ import ch.qos.logback.core.spi.LifeCycle;
 public class LoggerStartupListener extends ContextAwareBase implements LoggerContextListener, LifeCycle {
 
     private boolean started = false;
+    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL, LoggerStartupListener.class);
 
     @Override
     public void start() {
@@ -46,7 +49,8 @@ public class LoggerStartupListener extends ContextAwareBase implements LoggerCon
                try {
                        addr = InetAddress.getLocalHost();
                } catch (UnknownHostException e) {
-                       e.printStackTrace();
+                       LOGGER.error("UnknownHostException",e);
+                       
                }    
         Context context = getContext();
         if (addr != null) {
index e4cac06..3ef01f5 100644 (file)
@@ -60,13 +60,26 @@ public class MsoLogger {
     public static final String RESPONSECODE                = "ResponseCode";
     public static final String RESPONSEDESC                = "ResponseDesc";
     public static final String FQDN                        = "ServerFQDN";
+    public static final String ENTRY_TIMESTAMP             = "EntryTimestamp";
+    public static final String CLIENT_IPADDRESS            = "EntryTimestamp";
     
     
-    public static final String SERVICE_INSTANCE_ID         = "ServiceInstanceId";
+    //HTTP Headers
+    public static final String HEADER_FROM_APP_ID          = "X-FromAppId";
+    public static final String ONAP_PARTNER_NAME           = "X-ONAP-PartnerName";
+    public static final String HEADER_REQUEST_ID           = "X-RequestId";
+    public static final String TRANSACTION_ID              = "X-TransactionID";
+    public static final String ECOMP_REQUEST_ID            = "X-ECOMP-RequestID";
+    public static final String ONAP_REQUEST_ID            = "X-ONAP-RequestID";
+    public static final String CLIENT_ID                   = "X-ClientID";
+    public static final String INVOCATION_ID_HEADER        = "X-InvocationID";
     
+    //Default values for not found
+    public static final String UNKNOWN_PARTNER                 = "UnknownPartner";
+    
+    public static final String SERVICE_INSTANCE_ID         = "ServiceInstanceId";    
     public static final String SERVICE_NAME_IS_METHOD_NAME = "ServiceNameIsMethodName";
-    public static final String SERVER_IP                   = "ServerIPAddress";
-   
+    public static final String SERVER_IP                   = "ServerIPAddress";   
     
     public static final String REMOTE_HOST                 = "RemoteHost";
     public static final String ALERT_SEVERITY              = "AlertSeverity";
@@ -77,16 +90,15 @@ public class MsoLogger {
     public static final String CAT_LOG_LEVEL                      = "CategoryLogLevel";
     public static final String AUDI_CAT_LOG_LEVEL                 = "AuditCategoryLogLevel";
     
-    //For getting an identity of calling application
-    public static final String HEADER_FROM_APP_ID          = "X-FromAppId";
-    public static final String FROM_APP_ID                 = "FromAppId";
-    public static final String HEADER_REQUEST_ID           = "X-RequestId";
-    public static final String TRANSACTION_ID                     = "X-TransactionID";
-    public static final String ECOMP_REQUEST_ID                           = "X-ECOMP-RequestID";
-    public static final String ONAP_REQUEST_ID            = "X-ONAP-RequestID";
+
+
+    public static final String PARTNER_NAME                 = "PartnerName";
+
     
-    public static final String CLIENT_ID                                  = "X-ClientID";
-    public static final String INVOCATION_ID_HEADER        = "X-InvocationID";
+
+
+    
+
     
     // Audit/Metric log specific
     public static final String BEGINTIME                   = "BeginTimestamp";
diff --git a/common/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java b/common/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingInInterceptor.java
new file mode 100644 (file)
index 0000000..9aed537
--- /dev/null
@@ -0,0 +1,96 @@
+package org.onap.so.logging.cxf.interceptor;
+
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.namespace.QName;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.OperationInfo;
+import org.apache.cxf.transport.http.AbstractHTTPDestination;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
+import org.onap.so.logging.jaxrs.filter.MDCSetup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SOAPLoggingInInterceptor extends AbstractSoapInterceptor{
+
+    protected static Logger logger = LoggerFactory.getLogger(SOAPLoggingInInterceptor.class);
+    
+    @Autowired
+    MDCSetup mdcSetup;
+    
+    public SOAPLoggingInInterceptor() {
+        super(Phase.READ);
+    }
+
+    @Override
+    public void handleMessage(SoapMessage message) throws Fault {
+        try {
+  
+            Map<String, List<String>> headers  = (Map<String,List<String>>) message.get(Message.PROTOCOL_HEADERS);
+            HttpServletRequest request = (HttpServletRequest)message.get(AbstractHTTPDestination.HTTP_REQUEST);
+            request.getRemoteAddr();
+            
+            setRequestId(headers);
+            setInvocationId(headers);
+            setServiceName(message);
+            setMDCPartnerName(headers);
+            mdcSetup.setServerFQDN();
+            mdcSetup.setClientIPAddress(request);
+            mdcSetup.setInstanceUUID();
+            mdcSetup.setEntryTimeStamp();
+            MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, "INPROGRESS");
+            logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
+        } catch (Exception e) {
+            logger.warn("Error in incoming SOAP Message Inteceptor", e);
+        }
+    }
+    private void setServiceName(SoapMessage message) {
+        String requestURI = (String) message.get(Message.REQUEST_URI);
+        MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, requestURI);
+    }
+
+    //CXF Appears to flatten headers to lower case
+    private void setMDCPartnerName(Map<String, List<String>> headers){
+        String partnerName=getValueOrDefault(headers, ONAPLogConstants.Headers.PARTNER_NAME.toLowerCase(),"");
+        MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME,partnerName);
+    }
+
+    private void setInvocationId(Map<String, List<String>> headers) {
+        String invocationId=getValueOrDefault(headers, ONAPLogConstants.Headers.INVOCATION_ID.toLowerCase(),UUID.randomUUID().toString());
+        MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
+    }
+
+    private void setRequestId(Map<String, List<String>> headers) {
+        String requestId=getValueOrDefault(headers, ONAPLogConstants.Headers.REQUEST_ID.toLowerCase(),UUID.randomUUID().toString());
+        MDC.put(ONAPLogConstants.MDCs.REQUEST_ID,requestId);
+    }
+
+    private String getValueOrDefault(Map<String, List<String>> headers, String headerName, String defaultValue){
+        String headerValue;
+        List<String> headerList=headers.get(headerName);
+        if(headerList != null && !headerList.isEmpty()){
+            headerValue= headerList.get(0);
+            if(headerValue == null || headerValue.isEmpty())
+                headerValue = defaultValue;
+        }else
+            headerValue = defaultValue;
+        return headerValue;
+    }
+
+}
diff --git a/common/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java b/common/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java
new file mode 100644 (file)
index 0000000..c50e505
--- /dev/null
@@ -0,0 +1,63 @@
+package org.onap.so.logging.cxf.interceptor;
+
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.namespace.QName;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.OperationInfo;
+import org.apache.cxf.transport.http.AbstractHTTPDestination;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.exceptions.MSOException;
+import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
+import org.onap.so.logging.jaxrs.filter.MDCSetup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SOAPLoggingOutInterceptor extends AbstractSoapInterceptor{
+
+    private static final String _500 = "500";
+
+    protected static Logger logger = LoggerFactory.getLogger(SOAPLoggingOutInterceptor.class);
+    
+    @Autowired
+    MDCSetup mdcSetup;
+    
+    public SOAPLoggingOutInterceptor() {
+        super(Phase.WRITE);
+    }
+
+    @Override
+    public void handleMessage(SoapMessage message) throws Fault {
+        try {
+            Exception ex = message.getContent(Exception.class);
+            if (ex == null) {
+                MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.COMPLETED.toString());
+            }else{
+                int responseCode = 0;
+                responseCode = (int) message.get(Message.RESPONSE_CODE);
+                if(responseCode != 0 )
+                    MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(responseCode));
+                else
+                    MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, _500);
+                
+                MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.ERROR.toString());
+            }
+            logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+        } catch (Exception e) {
+            logger.warn("Error in incoming SOAP Message Inteceptor", e);
+        }
+    }
+}
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.logging.jaxrs.filter.jersey;
+package org.onap.so.logging.jaxrs.filter;
 
 
 import org.apache.commons.io.IOUtils;
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.logging.jaxrs.filter.jersey;
+package org.onap.so.logging.jaxrs.filter;
 
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
-import java.time.Instant;
-import java.time.ZoneId;
-import java.time.format.DateTimeFormatter;
-import java.util.Locale;
 import java.util.UUID;
-
 import javax.annotation.Priority;
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.container.ContainerRequestContext;
@@ -44,7 +39,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.ext.MessageBodyWriter;
 import javax.ws.rs.ext.Provider;
 import javax.ws.rs.ext.Providers;
-import org.onap.so.logger.MsoLogger;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.MDC;
@@ -56,120 +51,65 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 @Provider
 @Component
 public class JaxRsFilterLogging implements ContainerRequestFilter,ContainerResponseFilter {
-
-    protected static Logger logger = LoggerFactory.getLogger(JaxRsFilterLogging.class); 
+    
+    protected static Logger logger = LoggerFactory.getLogger(JaxRsFilterLogging.class);
 
     @Context
     private HttpServletRequest httpServletRequest;
 
     @Context 
     private Providers providers;
-
+    
     @Autowired
-    ObjectMapper objectMapper;
+    private MDCSetup mdcSetup;
 
     @Override
-    public void filter(ContainerRequestContext containerRequest) {             
-
+    public void filter(ContainerRequestContext containerRequest) {
         try {
-            String clientID = null;
-            //check headers for request id
             MultivaluedMap<String, String> headers = containerRequest.getHeaders();
-            String requestId = findRequestId(headers);
-            containerRequest.setProperty("requestId", requestId);
-            if(headers.containsKey(MsoLogger.CLIENT_ID)){
-                clientID = headers.getFirst(MsoLogger.CLIENT_ID);
-            }else{
-                clientID = "UNKNOWN";
-                headers.add(MsoLogger.CLIENT_ID, clientID);
-            }
-            
-            String remoteIpAddress = "";
-            if (httpServletRequest != null) {                  
-                remoteIpAddress = httpServletRequest.getRemoteAddr();
-            } 
-            Instant instant = Instant.now();
-            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX" )
-                    .withLocale( Locale.US )
-                    .withZone( ZoneId.systemDefault() );
-
-            String partnerName =  headers.getFirst(MsoLogger.HEADER_FROM_APP_ID );
-            if(partnerName == null || partnerName.isEmpty())
-                partnerName="UNKNOWN"; 
-
-            MDC.put(MsoLogger.REQUEST_ID,requestId);
-            MDC.put(MsoLogger.INVOCATION_ID,requestId);
-            MDC.put(MsoLogger.FROM_APP_ID,partnerName);         
-            MDC.put(MsoLogger.SERVICE_NAME, containerRequest.getUriInfo().getPath());
-            MDC.put(MsoLogger.INVOCATION_ID, findInvocationId(headers));
-            MDC.put(MsoLogger.STATUSCODE, MsoLogger.INPROGRESS);
-            MDC.put(MsoLogger.BEGINTIME, formatter.format(instant));
-            MDC.put(MsoLogger.PARTNERNAME,partnerName);                        
-            MDC.put(MsoLogger.REMOTE_HOST, String.valueOf(remoteIpAddress));
-            MDC.put(MsoLogger.STARTTIME, String.valueOf(System.currentTimeMillis()));
-            logger.debug(MsoLogger.ENTRY, "Entering.");
+            setRequestId(headers);
+            containerRequest.setProperty("requestId", MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
+            setInvocationId(headers);
+            setServiceName(containerRequest);
+            setMDCPartnerName(headers);
+            mdcSetup.setServerFQDN();
+            mdcSetup.setClientIPAddress(httpServletRequest);
+            mdcSetup.setInstanceUUID();
+            mdcSetup.setEntryTimeStamp();
+            MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, "INPROGRESS");
+            logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
         } catch (Exception e) {
             logger.warn("Error in incoming JAX-RS Inteceptor", e);
         }
     }
 
-
-    private String findRequestId(MultivaluedMap<String, String> headers) {
-        String requestId = (String) headers.getFirst(MsoLogger.HEADER_REQUEST_ID );
-        if(requestId == null || requestId.isEmpty()){
-            if(headers.containsKey(MsoLogger.ONAP_REQUEST_ID)){
-                requestId = headers.getFirst(MsoLogger.ONAP_REQUEST_ID);
-            }else if(headers.containsKey(MsoLogger.ECOMP_REQUEST_ID)){
-                requestId = headers.getFirst(MsoLogger.ECOMP_REQUEST_ID);
-            }else{
-                requestId = UUID.randomUUID().toString();
-            }
-        }
-        return requestId;
-    }
-    
-    private String findInvocationId(MultivaluedMap<String, String> headers) {
-        String invocationId = (String) headers.getFirst(MsoLogger.INVOCATION_ID_HEADER );
-        if(invocationId == null || invocationId.isEmpty())
-            invocationId =UUID.randomUUID().toString();
-        return invocationId;
-    }
-
     @Override
     public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
             throws IOException {
         try {
-            Instant instant = Instant.now();
-            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX" )
-                    .withLocale( Locale.US )
-                    .withZone( ZoneId.systemDefault() );
-            String startTime= MDC.get(MsoLogger.STARTTIME);
-            long elapsedTime;
-            try {
-                elapsedTime = System.currentTimeMillis() - Long.parseLong(startTime);
-            }catch(NumberFormatException e){
-                elapsedTime = 0;
-            }
-            String statusCode;
-            if(Response.Status.Family.familyOf(responseContext.getStatus()).equals(Response.Status.Family.SUCCESSFUL)){                
-                statusCode=MsoLogger.COMPLETE;
-            }else{                                                     
-                statusCode= MsoLogger.StatusCode.ERROR.toString();                             
-            }                  
-
-            MDC.put(MsoLogger.RESPONSEDESC,payloadMessage(responseContext));
-            MDC.put(MsoLogger.STATUSCODE, statusCode);
-            MDC.put(MsoLogger.RESPONSECODE,String.valueOf(responseContext.getStatus()));                       
-            MDC.put(MsoLogger.TIMER, String.valueOf(elapsedTime));
-            MDC.put(MsoLogger.ENDTIME,formatter.format(instant));                      
-            logger.debug(MsoLogger.EXIT, "Exiting.");
+            setResponseStatusCode(responseContext);
+            MDC.put(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION,payloadMessage(responseContext));      
+            MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE,String.valueOf(responseContext.getStatus()));
+            logger.info(ONAPLogConstants.Markers.EXIT, "Exiting.");
+            MDC.clear();
         } catch ( Exception e) {
+            MDC.clear();
             logger.warn("Error in outgoing JAX-RS Inteceptor", e);
         } 
+    }
+
+    private void setResponseStatusCode(ContainerResponseContext responseContext) {
+        String statusCode;
+        if(Response.Status.Family.familyOf(responseContext.getStatus()).equals(Response.Status.Family.SUCCESSFUL)){            
+            statusCode=ONAPLogConstants.ResponseStatus.COMPLETED.toString();
+        }else{                                                 
+            statusCode= ONAPLogConstants.ResponseStatus.ERROR.toString();                              
+        }                      
+        MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
     } 
 
     private String payloadMessage(ContainerResponseContext responseContext) throws IOException {
-        String message = new String();
+        String message = "";
         if (responseContext.hasEntity()) {
             ByteArrayOutputStream baos = new ByteArrayOutputStream();           
             Class<?> entityClass = responseContext.getEntityClass();
@@ -192,4 +132,38 @@ public class JaxRsFilterLogging implements ContainerRequestFilter,ContainerRespo
         }
         return message;
     }
+
+
+    private void setRequestId(MultivaluedMap<String, String> headers){
+        String requestId=headers.getFirst(ONAPLogConstants.Headers.REQUEST_ID);
+        if(requestId == null || requestId.isEmpty())
+            requestId = UUID.randomUUID().toString();
+        MDC.put(ONAPLogConstants.MDCs.REQUEST_ID,requestId);
+    }
+
+    private void setInvocationId(MultivaluedMap<String, String> headers){
+        MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, findInvocationId(headers));
+    }
+
+    private void setMDCPartnerName(MultivaluedMap<String, String> headers){
+        String partnerName=headers.getFirst(ONAPLogConstants.Headers.PARTNER_NAME);
+        if(partnerName == null || partnerName.isEmpty())
+            partnerName = "";
+        MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME,partnerName);
+    }
+    
+    private String findInvocationId(MultivaluedMap<String, String> headers) {
+        String invocationId = headers.getFirst(ONAPLogConstants.Headers.INVOCATION_ID);
+        if(invocationId == null || invocationId.isEmpty())
+            invocationId =UUID.randomUUID().toString();
+        return invocationId;
+    }
+
+    private void setServiceName(ContainerRequestContext containerRequest){
+        MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, containerRequest.getUriInfo().getPath());
+    }
+
+
+
+
 }
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCSetup.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCSetup.java
new file mode 100644 (file)
index 0000000..efc0aa8
--- /dev/null
@@ -0,0 +1,90 @@
+package org.onap.so.logging.jaxrs.filter;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Map;
+import java.util.UUID;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.Response;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MDCSetup {
+    
+    protected static Logger logger = LoggerFactory.getLogger(MDCSetup.class); 
+    
+    private static final String INSTANCE_UUID = UUID.randomUUID().toString();
+    
+    public void setInstanceUUID(){
+        MDC.put(ONAPLogConstants.MDCs.INSTANCE_UUID, INSTANCE_UUID);
+    }
+
+    public void setServerFQDN(){
+        String serverFQDN = "";
+        InetAddress addr= null;
+        try {
+            addr = InetAddress.getLocalHost();
+            serverFQDN = addr.toString();
+        } catch (UnknownHostException e) {
+            logger.warn("Cannot Resolve Host Name");
+            serverFQDN = "";
+        }
+        MDC.put(ONAPLogConstants.MDCs.SERVER_FQDN, serverFQDN);
+    }
+
+    public void setClientIPAddress(HttpServletRequest httpServletRequest){
+        String remoteIpAddress = "";
+        if (httpServletRequest != null) {
+            remoteIpAddress = httpServletRequest.getRemoteAddr();
+        } 
+        MDC.put(ONAPLogConstants.MDCs.CLIENT_IP_ADDRESS, remoteIpAddress);
+    }
+
+    public void setEntryTimeStamp() {
+        MDC.put(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP,ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT));
+    }
+    
+    public void setServiceName(HttpServletRequest request) {
+        MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, request.getRequestURI());
+    }
+
+    public void setRequestId(Map<String, String> headers) {
+        String requestId=headers.get(ONAPLogConstants.Headers.REQUEST_ID);
+        if(requestId == null || requestId.isEmpty())
+            requestId = UUID.randomUUID().toString();
+        MDC.put(ONAPLogConstants.MDCs.REQUEST_ID,requestId);
+    }
+
+    public void setInvocationId(Map<String, String> headers) {
+        String invocationId = headers.get(ONAPLogConstants.Headers.INVOCATION_ID);
+        if(invocationId == null || invocationId.isEmpty())
+            invocationId =UUID.randomUUID().toString();
+        MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
+    }
+
+    public void setMDCPartnerName(Map<String, String> headers) {
+        String partnerName=headers.get(ONAPLogConstants.Headers.PARTNER_NAME);
+        if(partnerName == null || partnerName.isEmpty())
+            partnerName = "";
+        MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME,partnerName);
+    }
+    
+
+    public void setResponseStatusCode(HttpServletResponse response) {
+        String statusCode;
+        if(Response.Status.Family.familyOf(response.getStatus()).equals(Response.Status.Family.SUCCESSFUL)){     
+            statusCode=ONAPLogConstants.ResponseStatus.COMPLETED.toString();
+        }else{                          
+            statusCode= ONAPLogConstants.ResponseStatus.ERROR.toString();               
+        }           
+        MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
+    }
+}
\ No newline at end of file
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.logging.jaxrs.filter.jersey;
+package org.onap.so.logging.jaxrs.filter;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java b/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java
new file mode 100644 (file)
index 0000000..755d18b
--- /dev/null
@@ -0,0 +1,99 @@
+package org.onap.so.logging.spring.interceptor;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Providers;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logging.jaxrs.filter.MDCSetup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+@Component
+public class LoggingInterceptor extends HandlerInterceptorAdapter {
+
+    Logger logger = LoggerFactory.getLogger(LoggingInterceptor.class);
+
+    @Autowired
+    MDCSetup mdcSetup;
+    
+    @Context 
+    private Providers providers;
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
+            throws Exception {
+        Map<String, String> headers = Collections.list(((HttpServletRequest) request).getHeaderNames())
+                .stream()
+                .collect(Collectors.toMap(h -> h, request::getHeader));
+        setRequestId(headers);
+        setInvocationId(headers);
+        setServiceName(request);
+        setMDCPartnerName(headers);
+        mdcSetup.setClientIPAddress(request);
+        mdcSetup.setEntryTimeStamp();
+        mdcSetup.setInstanceUUID();
+        mdcSetup.setServerFQDN();
+        MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, "INPROGRESS");
+        logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
+        return true;
+    }
+    
+    @Override
+    public void postHandle(
+            HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)
+            throws Exception {
+        setResponseStatusCode(response);
+        MDC.put(ONAPLogConstants.MDCs.RESPONSE_DESCRIPTION,"");      
+        MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE,String.valueOf(response.getStatus()));
+        logger.info(ONAPLogConstants.Markers.EXIT, "Exiting.");
+        MDC.clear();
+    }
+
+    private void setResponseStatusCode(HttpServletResponse response) {
+        String statusCode;
+        if(Response.Status.Family.familyOf(response.getStatus()).equals(Response.Status.Family.SUCCESSFUL)){     
+            statusCode=ONAPLogConstants.ResponseStatus.COMPLETED.toString();
+        }else{                          
+            statusCode= ONAPLogConstants.ResponseStatus.ERROR.toString();               
+        }           
+        MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, statusCode);
+    }
+
+    private void setServiceName(HttpServletRequest request) {
+        MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, request.getRequestURI());
+    }
+
+    private void setRequestId(Map<String, String> headers) {
+        String requestId=headers.get(ONAPLogConstants.Headers.REQUEST_ID);
+        if(requestId == null || requestId.isEmpty())
+            requestId = UUID.randomUUID().toString();
+        MDC.put(ONAPLogConstants.MDCs.REQUEST_ID,requestId);
+    }
+
+    private void setInvocationId(Map<String, String> headers) {
+        String invocationId = headers.get(ONAPLogConstants.Headers.INVOCATION_ID);
+        if(invocationId == null || invocationId.isEmpty())
+            invocationId =UUID.randomUUID().toString();
+        MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId);
+    }
+
+    private void setMDCPartnerName(Map<String, String> headers) {
+        String partnerName=headers.get(ONAPLogConstants.Headers.PARTNER_NAME);
+        if(partnerName == null || partnerName.isEmpty())
+            partnerName = "";
+        MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME,partnerName);
+    }
+    
+
+}
\ No newline at end of file
index 754c6f8..7965e1d 100644 (file)
@@ -86,7 +86,8 @@ SO Sub-Components
 
   Support self-service updates to models and artifacts
 
-** SO Monitoring**
+**SO Monitoring**
+
   Monitor BPMN Workflow execution by providing
   * Service list search based on search criteria
   * Service statistic
diff --git a/docs/developer_info/developer_information.rst b/docs/developer_info/developer_information.rst
new file mode 100644 (file)
index 0000000..8613f26
--- /dev/null
@@ -0,0 +1,20 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+SO Developer Information
+========================
+
+.. toctree::
+   :maxdepth: 1
+   
+.. developer_info/developer_info_Project_Structure.rst
+   developer_info/Camunda_Modeler.rst
+.. developer_info/developer_info_Main_Process_Flows.rst
+.. developer_info/developer_info_Subprocess_Process_Flows.rst
+.. developer_info/developer_info_Project_Deployment_Strategy.rst
+   developer_info/Building_SO.rst
+   developer_info/Working_with_SO_Docker.rst
+   developer_info/Camunda_Cockpit_Community_Edition.rst
+   developer_info/Camunda_Cockpit_Enterprise_Edition.rst
+   
\ No newline at end of file
diff --git a/docs/developer_information.rst b/docs/developer_information.rst
deleted file mode 100644 (file)
index 739a1f2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2017 Huawei Technologies Co., Ltd.\r
-\r
-SO Developer Information\r
-========================\r
-\r
-.. toctree::\r
-   :maxdepth: 1\r
-   \r
-   BPMN_Project_Structure.rst\r
-   Camunda_Modeler.rst\r
-   BPMN_Main_Process_Flows.rst\r
-   BPMN_Subprocess_Process_Flows.rst\r
-   BPMN_Project_Deployment_Strategy.rst\r
-   Building_SO.rst\r
-   Working_with_SO_Docker.rst\r
-   Camunda_Cockpit_Community_Edition.rst\r
-   Camunda_Cockpit_Enterprise_Edition.rst\r
-   
\ No newline at end of file
index 553b7f4..ebb8b0b 100644 (file)
@@ -10,6 +10,6 @@ ONAP SO
 \r
    installconfigure/Install_Configure_SO.rst\r
    architecture/architecture.rst\r
-   offered_consumed_apis.rst\r
-   developer_information.rst\r
-   release-notes.rst
\ No newline at end of file
+   api/offered_consumed_apis.rst\r
+   developer_info/developer_information.rst\r
+   release_notes/release-notes.rst
\ No newline at end of file
similarity index 93%
rename from docs/Install_Configure_SO.rst
rename to docs/installconfigure/Install_Configure_SO.rst
index e06385e..bdfd328 100644 (file)
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2017 Huawei Technologies Co., Ltd.\r
-\r
-SO Install & Configure\r
-==========================================\r
-\r
-Get Ubuntu\r
-----------\r
-Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS (Long Term Support), desktop edition.\r
-\r
-Get VirtualBox and VirtualBox Guest Additions\r
----------------------------------------------\r
-Make sure you have the VirtualBox Guest Additions ISO for your version of VirtualBox.  I'm using VirtualBox 5.1.28.  Save the Guest Additions ISO on your host computer along with the Ubuntu ISO.  Get the Guest Additions ISO from here:\r
-    http://download.virtualbox.org/virtualbox\r
-*NOTE*: Guest Additions versions prior to 5.1 will not work with Ubuntu 16.04.3.  If you have an earlier version of VirtualBox, you should upgrade to the latest 5.1 version.\r
-\r
-Create a new VM in VirtualBox for Ubuntu\r
-----------------------------------------\r
-Type: Linux\r
-\r
-Version: Ubuntu (64-bit)\r
-\r
-At least 2048 MB memory\r
-\r
-At least 40 GB VDI\r
-\r
-Network: Attached to: NAT\r
-\r
-Create a port-forwarding rule for SSH\r
--------------------------------------\r
-Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.\r
-\r
-Go to "Network" settings in VirtualBox, add a port forwarding rule:\r
-\r
-Name: SSH\r
-\r
-Protocol: TCP\r
-\r
-Host IP: 127.0.0.1\r
-\r
-Host Port: 1022\r
-\r
-Guest IP: <leave blank>\r
-\r
-Guest Port: 22\r
-\r
-.. image:: ../images/Configure_ubuntu_SO_1.png\r
-\r
-.\r
-\r
-.. image:: ../images/Configure_ubuntu_SO_2.png\r
-\r
-Create Shared Folder\r
---------------------\r
-This is oriented to Windows users.  If you're using a MAC or a Linux host computer, the details may be different.  You can share any folder on the host computer with the Ubuntu VM.  On Windows, a practical choice is to share the C:\Users folder, so that your Windows home directory will be accessible from the Ubuntu VM.\r
-\r
-Go to "Shared Folders" settings in VirtualBox, add a share:\r
-\r
-Folder Path: C:\Users\r
-\r
-Folder Name: Users\r
-\r
-Auto-mount: <checked>\r
-\r
-Read-only: <unchecked>\r
-\r
-.. image:: ../images/Configure_ubuntu_SO_3.png\r
-\r
-.\r
-\r
-.. image:: ../images/Configure_ubuntu_SO_4.png\r
-\r
-Install Ubuntu in the VM\r
-------------------------\r
-On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your Ubuntu ISO image.\r
-\r
-.. image:: images/Configure_ubuntu_SO_5.png\r
-\r
-After selecting the ISO image, start the VM.\r
-\r
-Follow the prompts to install Ubuntu.\r
-\r
-Proxy Configuration (optional)\r
-------------------------------\r
-If you're behind a corporate firewall, configure some proxy settings.  NOTE: your proxy configuration may require username and password credentials, not shown here.\r
-**Ubuntu system proxy setting:**\r
-\r
-       System Settings â†’ Network â†’ Network proxy\r
-       \r
-       (Replace "proxyhost" and port with your actual proxy information)\r
-\r
-.. image:: images/Configure_ubuntu_SO_6.png\r
-       \r
-**apt proxy setting:**\r
-       Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):\r
-       \r
-               Acquire::http::Proxy "http://proxyhost:port";\r
-               \r
-       Reboot the VM.\r
-       \r
-Install SSH Server\r
-------------------\r
-\r
-.. code-block:: bash\r
-\r
-    sudo apt update\r
-    sudo apt install openssh-server\r
-\r
-Connect to the VM from your host computer\r
------------------------------------------\r
-       The PuTTY SSH client is popular.  A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.\r
-\r
-.. image:: ../images/Configure_ubuntu_SO_7.png\r
-       \r
-Install VirtualBox Guest Additions\r
-----------------------------------\r
-On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your VirtualBox Guest Additions ISO image.\r
-\r
-.. image:: images/Configure_ubuntu_SO_8.png\r
-\r
-In a VM terminal window, mount the cdrom:\r
-\r
-.. code-block:: bash\r
-\r
-       sudo mkdir -p /media/cdrom\r
-       sudo mount /dev/cdrom /media/cdrom\r
-       \r
-Install necessary dependencies:\r
-\r
-.. code-block:: bash\r
-\r
-    sudo apt update\r
-    sudo apt install gcc g++ dkms\r
-       \r
-Install the guest additions.  NOTE: look for errors in the command output!  If you see an error that says you are missing kernel headers, the most likely cause is that you are using a VirtualBox version that is too old.  The error message is misleading.\r
-\r
-.. code-block:: bash\r
-\r
-       cd /media/cdrom\r
-       sudo ./VBoxLinuxAdditions.run\r
-\r
-.. image:: ../images/Configure_ubuntu_SO_9.png \r
-       \r
-Add yourself to the vboxsf user group (replace "userid" with your user ID):\r
-       \r
-.. code-block:: bash   \r
-       \r
-       sudo usermod -a -G vboxsf userid\r
-       \r
-Reboot the VM.\r
-\r
-In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:\r
-       /media/sf_Users\r
-       \r
-Further Reading\r
-----------------------------------------       \r
-\r
-.. toctree::\r
-   :maxdepth: 1\r
-\r
-   installconfigure/Install_Docker.rst\r
-   installconfigure/Configure_git_and_gerrit.rst\r
-   installconfigure/Workspace_and_Development_Tools.rst
\ No newline at end of file
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+SO Install & Configure
+==========================================
+
+Get Ubuntu
+----------
+Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS (Long Term Support), desktop edition.
+
+Get VirtualBox and VirtualBox Guest Additions
+---------------------------------------------
+Make sure you have the VirtualBox Guest Additions ISO for your version of VirtualBox.  I'm using VirtualBox 5.1.28.  Save the Guest Additions ISO on your host computer along with the Ubuntu ISO.  Get the Guest Additions ISO from here:
+    http://download.virtualbox.org/virtualbox
+*NOTE*: Guest Additions versions prior to 5.1 will not work with Ubuntu 16.04.3.  If you have an earlier version of VirtualBox, you should upgrade to the latest 5.1 version.
+
+Create a new VM in VirtualBox for Ubuntu
+----------------------------------------
+Type: Linux
+
+Version: Ubuntu (64-bit)
+
+At least 2048 MB memory
+
+At least 40 GB VDI
+
+Network: Attached to: NAT
+
+Create a port-forwarding rule for SSH
+-------------------------------------
+Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.
+
+Go to "Network" settings in VirtualBox, add a port forwarding rule:
+
+Name: SSH
+
+Protocol: TCP
+
+Host IP: 127.0.0.1
+
+Host Port: 1022
+
+Guest IP: <leave blank>
+
+Guest Port: 22
+
+.. image:: ../images/Configure_ubuntu_SO_1.png
+
+.
+
+.. image:: ../images/Configure_ubuntu_SO_2.png
+
+Create Shared Folder
+--------------------
+This is oriented to Windows users.  If you're using a MAC or a Linux host computer, the details may be different.  You can share any folder on the host computer with the Ubuntu VM.  On Windows, a practical choice is to share the C:\Users folder, so that your Windows home directory will be accessible from the Ubuntu VM.
+
+Go to "Shared Folders" settings in VirtualBox, add a share:
+
+Folder Path: C:\Users
+
+Folder Name: Users
+
+Auto-mount: <checked>
+
+Read-only: <unchecked>
+
+.. image:: ../images/Configure_ubuntu_SO_3.png
+
+.
+
+.. image:: ../images/Configure_ubuntu_SO_4.png
+
+Install Ubuntu in the VM
+------------------------
+On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your Ubuntu ISO image.
+
+.. image:: images/Configure_ubuntu_SO_5.png
+
+After selecting the ISO image, start the VM.
+
+Follow the prompts to install Ubuntu.
+
+Proxy Configuration (optional)
+------------------------------
+If you're behind a corporate firewall, configure some proxy settings.  NOTE: your proxy configuration may require username and password credentials, not shown here.
+**Ubuntu system proxy setting:**
+
+       System Settings â†’ Network â†’ Network proxy
+       
+       (Replace "proxyhost" and port with your actual proxy information)
+
+.. image:: images/Configure_ubuntu_SO_6.png
+       
+**apt proxy setting:**
+       Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):
+       
+               Acquire::http::Proxy "http://proxyhost:port";
+               
+       Reboot the VM.
+       
+Install SSH Server
+------------------
+
+.. code-block:: bash
+
+    sudo apt update
+    sudo apt install openssh-server
+
+Connect to the VM from your host computer
+-----------------------------------------
+       The PuTTY SSH client is popular.  A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.
+
+.. image:: ../images/Configure_ubuntu_SO_7.png
+       
+Install VirtualBox Guest Additions
+----------------------------------
+On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your VirtualBox Guest Additions ISO image.
+
+.. image:: images/Configure_ubuntu_SO_8.png
+
+In a VM terminal window, mount the cdrom:
+
+.. code-block:: bash
+
+       sudo mkdir -p /media/cdrom
+       sudo mount /dev/cdrom /media/cdrom
+       
+Install necessary dependencies:
+
+.. code-block:: bash
+
+    sudo apt update
+    sudo apt install gcc g++ dkms
+       
+Install the guest additions.  NOTE: look for errors in the command output!  If you see an error that says you are missing kernel headers, the most likely cause is that you are using a VirtualBox version that is too old.  The error message is misleading.
+
+.. code-block:: bash
+
+       cd /media/cdrom
+       sudo ./VBoxLinuxAdditions.run
+
+.. image:: ../images/Configure_ubuntu_SO_9.png 
+       
+Add yourself to the vboxsf user group (replace "userid" with your user ID):
+       
+.. code-block:: bash   
+       
+       sudo usermod -a -G vboxsf userid
+       
+Reboot the VM.
+
+In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:
+       /media/sf_Users
+       
+Further Reading
+----------------------------------------       
+
+.. toctree::
+   :maxdepth: 1
+
+   Install_Docker.rst
+   Configure_git_and_gerrit.rst
+   Workspace_and_Development_Tools.rst
\ No newline at end of file
index b1963f1..0743a2d 100644 (file)
                        <groupId>org.onap.so</groupId>
                        <artifactId>common</artifactId>
                        <version>${project.version}</version>
+                       <exclusions>
+                               <exclusion>
+                               <groupId>org.apache.cxf</groupId>
+                               <artifactId>cxf-rt-rs-client</artifactId>
+                       </exclusion>
+                       <exclusion>
+                               <groupId>org.apache.cxf</groupId>
+                               <artifactId>cxf-rt-bindings-soap</artifactId>
+                       </exclusion>
+                       <exclusion>
+                               <groupId>org.apache.cxf</groupId>
+                               <artifactId>cxf-rt-transports-http</artifactId>
+                       </exclusion>
+               </exclusions>
                </dependency>
        </dependencies>
 
index 1700e12..e6bbc4d 100644 (file)
@@ -29,7 +29,7 @@ import org.onap.so.apihandler.filters.RequestUriFilter;
 import org.onap.so.apihandlerinfra.exceptions.ApiExceptionMapper;
 import org.onap.so.apihandlerinfra.tenantisolation.CloudOrchestration;
 import org.onap.so.apihandlerinfra.tenantisolation.CloudResourcesOrchestration;
-import org.onap.so.logging.jaxrs.filter.jersey.JaxRsFilterLogging;
+import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
 import org.onap.so.web.exceptions.RuntimeExceptionMapper;
 import org.springframework.context.annotation.Configuration;
 
index 0a996dc..6d61d3b 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
@@ -20,7 +22,6 @@
 
 package org.onap.so.apihandlerinfra;
 
-import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.stereotype.Component;
@@ -31,7 +32,7 @@ public class SpringContextHelper implements ApplicationContextAware {
        private static ApplicationContext context;
 
        @Override
-       public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+       public void setApplicationContext(ApplicationContext applicationContext) {
                context = applicationContext;
        }
 
index c16f7bb..b09bbae 100644 (file)
@@ -76,8 +76,8 @@ public class CreateEcompOperationalEnvironment {
             requestDb.updateInfraFailureCompletion(e.getMessage(), requestId, request.getOperationalEnvironmentId());
             throw validateException;
         }
-                       //Update request database
-                       requestDb.updateInfraSuccessCompletion("SUCCESSFULLY Created ECOMP OperationalEnvironment.", requestId, request.getOperationalEnvironmentId());
+               //Update request database
+               requestDb.updateInfraSuccessCompletion("SUCCESSFULLY Created ECOMP OperationalEnvironment.", requestId, request.getOperationalEnvironmentId());
 
        }
 }
index 5b37d77..76f4bb0 100644 (file)
@@ -29,6 +29,7 @@ import com.github.tomakehurst.wiremock.http.Fault;
 import org.apache.http.HttpStatus;
 import org.junit.Before;
 import org.junit.Test;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
 import org.onap.so.db.catalog.beans.Service;
 import org.onap.so.db.catalog.beans.ServiceRecipe;
 import org.onap.so.db.request.beans.InfraActiveRequests;
@@ -1934,7 +1935,7 @@ public class ServiceInstancesTest extends BaseTest{
     @Test
     public void invalidRequestId() throws IOException {
         String illegalRequestId = "1234";
-        headers.set("X-ECOMP-RequestID", illegalRequestId);
+        headers.set(ONAPLogConstants.Headers.REQUEST_ID, illegalRequestId);
 
         uri = servInstanceuri + "v5/serviceInstances";
         ResponseEntity<String> response = sendRequest(inputStream("/ServiceInstanceDefault.json"), uri, HttpMethod.POST);
index 0ace9d5..585eff2 100644 (file)
@@ -23,7 +23,7 @@ package org.onap.so.apihandlerinfra.tenantisolation.process;
 import static com.github.tomakehurst.wiremock.client.WireMock.*;
 import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
 import static org.junit.Assert.assertThat;
-
+import java.util.UUID;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.http.HttpStatus;
@@ -107,22 +107,23 @@ public class CreateEcompOperationalEnvironmentTest extends BaseTest{
                 .errorInfo(errorLoggerInfo).build();
         
         InfraActiveRequests iar = new InfraActiveRequests();
-               iar.setRequestId("123");
+        String uuid = UUID.randomUUID().toString();
+               iar.setRequestId(uuid);
                iar.setOperationalEnvName("myOpEnv");
                iar.setRequestScope("create");
                iar.setRequestStatus("PENDING");
                iar.setRequestAction("UNKNOWN");
-               stubFor(get(urlPathEqualTo("/infraActiveRequests/123"))
+               stubFor(get(urlPathEqualTo("/infraActiveRequests/"+uuid))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withBody(mapper.writeValueAsString(iar))
                                                .withStatus(HttpStatus.SC_OK)));
                stubFor(post(urlPathEqualTo("/infraActiveRequests/"))
-                               .withRequestBody(containing("{\"requestId\":\"123\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"FAILED\",\"statusMessage\":\"FAILURE, operationalEnvironmentId - operationalEnvId; Error message: empty"))
+                               .withRequestBody(containing("{\"requestId\":\""+uuid+ "\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"FAILED\",\"statusMessage\":\"FAILURE, operationalEnvironmentId - operationalEnvId; Error message:"))
                                .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
                                                .withStatus(HttpStatus.SC_OK)));
 
                try {
-            createEcompOpEn.execute("123", getCloudOrchestrationRequest());
+            createEcompOpEn.execute(uuid, getCloudOrchestrationRequest());
         }catch(ApiException e){
             assertThat(e, sameBeanAs((ApiException) expectedException).ignoring("cause"));
         }
index 7f86cba..cd4f25e 100644 (file)
                        <groupId>org.onap.so</groupId>
                        <artifactId>common</artifactId>
                        <version>${project.version}</version>
+                       <exclusions>
+                               <exclusion>
+                               <groupId>org.apache.cxf</groupId>
+                               <artifactId>cxf-rt-rs-client</artifactId>
+                       </exclusion>
+                       <exclusion>
+                               <groupId>org.apache.cxf</groupId>
+                               <artifactId>cxf-rt-bindings-soap</artifactId>
+                       </exclusion>
+                       <exclusion>
+                               <groupId>org.apache.cxf</groupId>
+                               <artifactId>cxf-rt-transports-http</artifactId>
+                       </exclusion>
+               </exclusions>
                </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
index a0e2409..8da24c9 100644 (file)
@@ -46,7 +46,7 @@ import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
 import org.onap.so.db.catalog.beans.macro.NorthBoundRequest;
 import org.onap.so.db.catalog.beans.macro.OrchestrationFlow;
 import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
-import org.onap.so.logging.jaxrs.filter.jersey.SpringClientFilter;
+import org.onap.so.logging.jaxrs.filter.SpringClientFilter;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.client.BufferingClientHttpRequestFactory;
@@ -433,13 +433,6 @@ public class CatalogDbClient {
                                .queryParam(ACTION,action).build());
        }
        
-       public ControllerSelectionReference getControllerSelectionReferenceByVnfType(String vnfType) {
-               return this.getSingleResource(controllerSelectionReferenceClient, UriBuilder
-                               .fromUri(endpoint + "/controllerSelectionReference/search/findControllerSelectionReferenceByVnfType")
-                                               .queryParam("VNF_TYPE", vnfType).build());
-
-       }
-       
        public ControllerSelectionReference getControllerSelectionReferenceByVnfTypeAndActionCategory(String vnfType, String actionCategory) {
                return this.getSingleResource(controllerSelectionReferenceClient, UriBuilder
                                .fromUri(endpoint + "/controllerSelectionReference/search/findControllerSelectionReferenceByVnfTypeAndActionCategory")
index ad1bbc3..ad162b5 100644 (file)
@@ -29,9 +29,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource;
        @RepositoryRestResource(collectionResourceRel = "controllerSelectionReference", path = "controllerSelectionReference")
        public interface ControllerSelectionReferenceRepository extends JpaRepository<ControllerSelectionReference, String> {
                
-               public ControllerSelectionReference findControllerSelectionReferenceByVnfType(@Param("VNF_TYPE") String vnfType);
-               
                public ControllerSelectionReference findControllerSelectionReferenceByVnfTypeAndActionCategory(@Param("VNF_TYPE") String vnfType, 
                                @Param("ACTION_CATEGORY") String actionCategory);
                
-       }
\ No newline at end of file
+       }
index 7a9fc19..73f1ef4 100644 (file)
@@ -24,7 +24,6 @@ import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.onap.so.TestApplication;
 import org.onap.so.db.catalog.beans.BuildingBlockDetail;
 import org.onap.so.db.catalog.beans.OrchestrationAction;
 import org.onap.so.db.catalog.beans.ResourceType;
index f793fd7..016d1d6 100644 (file)
@@ -26,7 +26,6 @@ import static org.junit.Assert.assertTrue;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.onap.so.TestApplication;
 import org.onap.so.db.catalog.beans.ControllerSelectionReference;
 import org.onap.so.db.catalog.data.repository.ControllerSelectionReferenceRepository;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,16 +41,6 @@ public class ControllerSelectionReferenceTest {
        @Autowired
        private ControllerSelectionReferenceRepository controllerSelectionReferenceRepository;
        
-       
-       @Test
-       public void Find_ControllerNameByVnfType_Test() {
-               String vnfType = "vLoadBalancerMS/vLoadBalancerMS 0";
-               String controllerName = "APPC";
-               ControllerSelectionReference controller = controllerSelectionReferenceRepository.findControllerSelectionReferenceByVnfType(vnfType);
-               assertEquals(vnfType, controller.getVnfType());
-               assertEquals(controllerName, controller.getControllerName());
-       }
-       
        @Test
        public void Find_ControllerNameByVnfTypeAndAction_Test() {
                String vnfType = "vLoadBalancerMS/vLoadBalancerMS 0";
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so;
+package org.onap.so.db.catalog;
 import ch.vorburger.exec.ManagedProcessException;
 import ch.vorburger.mariadb4j.DBConfigurationBuilder;
 import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
index 55c5c83..456c826 100644 (file)
@@ -24,7 +24,6 @@ import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.onap.so.TestApplication;
 import org.onap.so.db.catalog.beans.NetworkResource;
 import org.onap.so.db.catalog.data.repository.NetworkResourceRepository;
 import org.springframework.beans.factory.annotation.Autowired;
index 52cac88..b6aa408 100644 (file)
@@ -24,7 +24,6 @@ import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.onap.so.TestApplication;
 import org.onap.so.db.catalog.beans.OrchestrationAction;
 import org.onap.so.db.catalog.beans.OrchestrationStatus;
 import org.onap.so.db.catalog.beans.OrchestrationStatusStateTransitionDirective;
index 0ecaa5f..ffa56a9 100644 (file)
@@ -26,7 +26,6 @@ import java.util.List;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.onap.so.TestApplication;
 import org.onap.so.db.catalog.beans.Service;
 import org.onap.so.db.catalog.data.repository.ServiceRepository;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so;
+package org.onap.so.db.catalog;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -26,9 +26,9 @@ import org.springframework.boot.autoconfigure.domain.EntityScan;
 import org.springframework.context.annotation.Profile;
 import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
 
-@SpringBootApplication(scanBasePackages = { "org.onap"})
+@SpringBootApplication(scanBasePackages = { "org.onap.so.db.catalog"})
 @EnableJpaRepositories("org.onap.so.db.catalog.data.repository")
-@EntityScan("org.onap.so.db.catalog.beans")
+@EntityScan("org.onap.so.db.catalog")
 @Profile("test")
 public class TestApplication {
        private static final String LOGS_DIR = "logs_dir";
index 44e7a03..1f13bd9 100644 (file)
@@ -26,7 +26,6 @@ import java.util.List;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.onap.so.TestApplication;
 import org.onap.so.db.catalog.beans.VfModule;
 import org.onap.so.db.catalog.data.repository.VFModuleRepository;
 import org.springframework.beans.factory.annotation.Autowired;
index 5a0770e..37a43aa 100644 (file)
@@ -2,7 +2,7 @@ package org.onap.so.db.catalog.data.repository;
 
 import org.junit.Assert;
 import org.junit.Test;
-import org.onap.so.BaseTest;
+import org.onap.so.db.catalog.BaseTest;
 import org.onap.so.db.catalog.beans.CloudSite;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
index 21f95a7..db62759 100644 (file)
@@ -2,7 +2,7 @@ package org.onap.so.db.catalog.data.repository;
 
 import org.junit.Assert;
 import org.junit.Test;
-import org.onap.so.BaseTest;
+import org.onap.so.db.catalog.BaseTest;
 import org.onap.so.db.catalog.beans.CloudifyManager;
 import org.springframework.beans.factory.annotation.Autowired;
 
index 58bde0e..9da6d13 100644 (file)
@@ -649,4 +649,5 @@ INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `AD
 INSERT INTO `cloud_sites` (`ID`, `REGION_ID`, `IDENTITY_SERVICE_ID`, `CLOUD_VERSION`, `CLLI`, `CLOUDIFY_ID`, `PLATFORM`, `ORCHESTRATOR`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('mtn13', 'mtn13', 'MTN13', '2.5', 'MDT13', 'mtn13', NULL, 'orchestrator', 'MSO_USER', '2018-07-17 14:06:28', '2018-07-17 14:06:28');
 
 INSERT INTO `controller_selection_reference` (`VNF_TYPE`, `CONTROLLER_NAME`, `ACTION_CATEGORY`) VALUES
-('vLoadBalancerMS/vLoadBalancerMS 0', 'APPC', 'ConfigScaleOut');
+('vLoadBalancerMS/vLoadBalancerMS 0', 'APPC', 'ConfigScaleOut'),
+('vLoadBalancerMS/vLoadBalancerMS 0', 'APPC', 'HealthCheck');
index df6d921..8f541d6 100644 (file)
@@ -28,9 +28,6 @@
     <property name="errorPattern"
         value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestId}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode}|%X{ErrorDesc}|%msg%n" />
 
-    <property name="debugPattern"
-        value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestId}|%msg%n" />
-
     <property name="auditPattern"
         value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{Timer}|%X{ServerFQDN}|%X{RemoteHost}||||||||%msg%n" />
 
                 \t%thread
                 \t%n" />
 
-    <appender name="SANE"
-        class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${logs_dir:-.}/${saneLogName}.log</file>
-        <rollingPolicy
-            class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
-            <fileNamePattern>${logs_dir:-.}/${saneLogName}.%d{yyyy-MM-dd}.%i.log.zip
-            </fileNamePattern>
-             
-           
-            <maxFileSize>${maxFileSize}</maxFileSize>
-            <maxHistory>${maxHistory}</maxHistory>
-            <totalSizeCap>${totalSizeCap}</totalSizeCap>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${defaultPattern}</pattern>
-        </encoder>
-    </appender>
-
     <appender name="Audit"
         class="ch.qos.logback.core.rolling.RollingFileAppender">
         <file>${logs_dir:-.}/${auditLogName}.log</file>
             <totalSizeCap>${totalSizeCap}</totalSizeCap>
         </rollingPolicy>
         <encoder>
-            <pattern>${debugPattern}</pattern>
+            <pattern>${defaultPattern}</pattern>
         </encoder>
     </appender>
 
     <logger name="org.apache.wire" level="DEBUG" />
     <logger name="org.onap" level="DEBUG" />
     <logger name="com.att.ecomp" level="DEBUG" />
-    <logger name="org.apache.cxf.interceptor" level="DEBUG" />
+    <logger name="org.apache.cxf" level="INFO" />
 
     <logger name="AUDIT" level="INFO" additivity="false">
         <appender-ref ref="asyncAudit" />