summaryrefslogtreecommitdiffstats
path: root/adapters/mso-sdnc-adapter
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-sdnc-adapter')
-rw-r--r--adapters/mso-sdnc-adapter/WebContent/META-INF/MANIFEST.MF4
-rw-r--r--adapters/mso-sdnc-adapter/WebContent/WEB-INF/jboss-deployment-structure.xml17
-rw-r--r--adapters/mso-sdnc-adapter/WebContent/WEB-INF/jboss-web.xml4
-rw-r--r--adapters/mso-sdnc-adapter/WebContent/WEB-INF/web.xml126
-rw-r--r--adapters/mso-sdnc-adapter/WebContent/check.html10
-rw-r--r--adapters/mso-sdnc-adapter/null/mso-config/uuid/uuid_null1
-rw-r--r--adapters/mso-sdnc-adapter/pom.xml104
-rw-r--r--adapters/mso-sdnc-adapter/readme67
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/ObjectFactory.java76
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/RequestHeader.java219
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterPortType.java53
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterRequest.java129
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterResponse.java53
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterService.java128
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/CallbackHeader.java154
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/ObjectFactory.java68
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCAdapterCallbackRequest.java136
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java51
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterService.java126
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/package-info.java23
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Constants.java47
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunables.java223
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.java105
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImpl.java191
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCResponse.java73
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCRestClient.java345
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Utils.java195
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResource.java200
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/package-info.java23
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtil.java39
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/SDNCAdapter.wsdl55
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/SDNCAdapterSchema.xsd72
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/SDNCCallbackAdapter.wsdl56
-rw-r--r--adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/ObjectFactoryTest.java100
-rw-r--r--adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunablesTest.java74
-rw-r--r--adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtilTest.java43
-rw-r--r--adapters/mso-sdnc-adapter/src/test/resources/logback-test.xml47
-rw-r--r--adapters/mso-sdnc-adapter/src/test/resources/mso.properties52
38 files changed, 3489 insertions, 0 deletions
diff --git a/adapters/mso-sdnc-adapter/WebContent/META-INF/MANIFEST.MF b/adapters/mso-sdnc-adapter/WebContent/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..bbf7aa0cf9
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/WebContent/META-INF/MANIFEST.MF
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Dependencies: org.jboss.logging
+Class-Path:
+
diff --git a/adapters/mso-sdnc-adapter/WebContent/WEB-INF/jboss-deployment-structure.xml b/adapters/mso-sdnc-adapter/WebContent/WEB-INF/jboss-deployment-structure.xml
new file mode 100644
index 0000000000..88d5024f0d
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/WebContent/WEB-INF/jboss-deployment-structure.xml
@@ -0,0 +1,17 @@
+<jboss-deployment-structure>
+ <deployment>
+ <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
+ <exclusions>
+ <module name="org.apache.log4j" />
+ <module name="org.slf4j" />
+ <module name="org.slf4j.impl" />
+ </exclusions>
+ <dependencies>
+ <module name="org.jboss.jandex" slot="main" />
+ <module name="org.javassist" slot="main" />
+ <module name="org.antlr" slot="main" />
+ <module name="org.dom4j" slot="main" />
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
+
diff --git a/adapters/mso-sdnc-adapter/WebContent/WEB-INF/jboss-web.xml b/adapters/mso-sdnc-adapter/WebContent/WEB-INF/jboss-web.xml
new file mode 100644
index 0000000000..fa0fe9bab6
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/WebContent/WEB-INF/jboss-web.xml
@@ -0,0 +1,4 @@
+<jboss-web>
+ <context-root>adapters</context-root>
+ <security-domain>other</security-domain>
+</jboss-web> \ No newline at end of file
diff --git a/adapters/mso-sdnc-adapter/WebContent/WEB-INF/web.xml b/adapters/mso-sdnc-adapter/WebContent/WEB-INF/web.xml
new file mode 100644
index 0000000000..bb58197bf1
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/WebContent/WEB-INF/web.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
+ <display-name>mso-sdnc-adapter</display-name>
+ <welcome-file-list>
+ <welcome-file>check.html</welcome-file>
+ </welcome-file-list>
+
+ <context-param>
+ <param-name>resteasy.jndi.resources</param-name>
+ <param-value>java:module/MsoPropertiesFactory,java:module/CloudConfigFactory</param-value>
+ </context-param>
+ <context-param>
+ <param-name>log.configuration</param-name>
+ <param-value>logback.sdnc.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>mso.configuration</param-name>
+ <param-value>MSO_PROP_SDNC_ADAPTER=mso.sdnc.properties,MSO_PROP_TOPOLOGY=topology.properties</param-value>
+ </context-param>
+ <context-param>
+ <param-name>mso.cloud_config.configuration</param-name>
+ <param-value>cloud_config.json=2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>resteasy.resources</param-name>
+ <param-value>org.openecomp.mso.logger.MsoLoggingServlet,org.openecomp.mso.adapters.sdnc.notify.SDNCNotifyResource,org.openecomp.mso.adapters.sdnc.impl.SDNCAdapterRestImpl,org.openecomp.mso.MsoStatusHandler</param-value>
+ </context-param>
+ <context-param>
+ <param-name>resteasy.servlet.mapping.prefix</param-name>
+ <param-value>/rest</param-value>
+ </context-param>
+ <servlet>
+ <display-name>SDNCAdapter</display-name>
+ <servlet-name>SDNCAdapter</servlet-name>
+ <servlet-class>org.openecomp.mso.adapters.sdnc.impl.SDNCAdapterPortTypeImpl</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>SDNCAdapter</servlet-name>
+ <url-pattern>/SDNCAdapter</url-pattern>
+ </servlet-mapping>
+ <servlet>
+ <servlet-name>Resteasy</servlet-name>
+ <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Resteasy</servlet-name>
+ <url-pattern>/rest/*</url-pattern>
+ </servlet-mapping>
+
+ <filter>
+ <filter-name>LogFilter</filter-name>
+ <filter-class>org.openecomp.mso.logger.LogFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>LogFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <listener>
+ <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+ </listener>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>RestRequests</web-resource-name>
+ <description>Rest Ingress Requests</description>
+ <url-pattern>/rest/logging/*</url-pattern>
+ <url-pattern>/rest/properties/*</url-pattern>
+ <url-pattern>/rest/MSORequest</url-pattern>
+ <http-method>POST</http-method>
+ <http-method>GET</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>MSO-Client</role-name>
+ </auth-constraint>
+ </security-constraint>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>SDNCNotification</web-resource-name>
+ <description>Rest Async Notification from SDNC</description>
+ <url-pattern>/rest/SDNCNotify</url-pattern>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>SDNC-Client</role-name>
+ </auth-constraint>
+ </security-constraint>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>SoapRequests</web-resource-name>
+ <description>Soap Ingress Requests</description>
+ <url-pattern>/SDNCAdapter</url-pattern>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>BPEL-Client</role-name>
+ </auth-constraint>
+ </security-constraint>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>SiteStatus</web-resource-name>
+ <description>SiteStatus APIs</description>
+ <url-pattern>/rest/setStatus/*</url-pattern>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>SiteControl-Client</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>ApplicationRealm</realm-name>
+ </login-config>
+ <security-role>
+ <role-name>SDNC-Client</role-name>
+ </security-role>
+ <security-role>
+ <role-name>MSO-Client</role-name>
+ </security-role>
+ <security-role>
+ <role-name>BPEL-Client</role-name>
+ </security-role>
+ <security-role>
+ <role-name>SiteControl-Client</role-name>
+ </security-role>
+</web-app>
diff --git a/adapters/mso-sdnc-adapter/WebContent/check.html b/adapters/mso-sdnc-adapter/WebContent/check.html
new file mode 100644
index 0000000000..454997901e
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/WebContent/check.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="ISO-8859-1">
+<title>Health Check</title>
+</head>
+<body>
+Application ready
+</body>
+</html> \ No newline at end of file
diff --git a/adapters/mso-sdnc-adapter/null/mso-config/uuid/uuid_null b/adapters/mso-sdnc-adapter/null/mso-config/uuid/uuid_null
new file mode 100644
index 0000000000..1e111235e7
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/null/mso-config/uuid/uuid_null
@@ -0,0 +1 @@
+57df7036-93ea-48bb-9667-f97098b99742 \ No newline at end of file
diff --git a/adapters/mso-sdnc-adapter/pom.xml b/adapters/mso-sdnc-adapter/pom.xml
new file mode 100644
index 0000000000..11648aa4dc
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/pom.xml
@@ -0,0 +1,104 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.openecomp.mso</groupId>
+ <artifactId>adapters</artifactId>
+ <version>0.0.4-SNAPSHOT</version>
+ </parent>
+ <groupId>org.openecomp.mso.adapters</groupId>
+ <artifactId>mso-sdnc-adapter</artifactId>
+ <packaging>war</packaging>
+ <name>mso-sdnc-adapter</name>
+ <description>mso sdnc adapter</description>
+
+ <build>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <warSourceDirectory>${basedir}/WebContent</warSourceDirectory>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ <attachClasses>true</attachClasses>
+ </configuration>
+ </plugin>
+<!-- <plugin> -->
+<!-- <groupId>org.jboss.as.plugins</groupId> -->
+<!-- <artifactId>jboss-as-maven-plugin</artifactId> -->
+<!-- <version>7.6.Final</version> -->
+<!-- <configuration> -->
+<!-- <force>true</force> -->
+<!-- <port>${jboss.port}</port> -->
+<!-- <hostname>${jboss.hostname}</hostname> -->
+<!-- <username>${jboss.username}</username> -->
+<!-- <password>${jboss.password}</password> -->
+<!-- <ignoreMissingDeployment>true</ignoreMissingDeployment> -->
+<!-- <domain> -->
+<!-- <server-groups> -->
+<!-- <server-group>server-group-one</server-group> -->
+<!-- <server-group>server-group-two</server-group> -->
+<!-- </server-groups> -->
+<!-- </domain> -->
+<!-- <fileNames> -->
+<!-- <fileName>target/${project.build.finalName}.${project.packaging}</fileName> -->
+<!-- </fileNames> -->
+<!-- </configuration> -->
+<!-- <executions> -->
+<!-- <execution> -->
+<!-- <id>undeploy</id> -->
+<!-- <phase>clean</phase> -->
+<!-- <goals> -->
+<!-- <goal>undeploy</goal> -->
+<!-- </goals> -->
+<!-- </execution> -->
+<!-- <execution> -->
+<!-- <id>deploy</id> -->
+<!-- <phase>install</phase> -->
+<!-- <goals> -->
+<!-- <goal>deploy</goal> -->
+<!-- </goals> -->
+<!-- </execution> -->
+<!-- </executions> -->
+<!-- </plugin> -->
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.mso.adapters</groupId>
+ <artifactId>mso-adapter-utils</artifactId>
+ <version>${project.version}</version>
+
+ </dependency>
+ <dependency>
+ <groupId>javax</groupId>
+ <artifactId>javaee-web-api</artifactId>
+ <version>6.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.ejb</groupId>
+ <artifactId>jboss-ejb-api_3.2_spec</artifactId>
+ <version>1.0.0.Final</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-ext-api</artifactId>
+ <version>2.2.0.Final</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.mso</groupId>
+ <artifactId>status-control</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.mso.adapters</groupId>
+ <artifactId>mso-adapters-rest-interface</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project> \ No newline at end of file
diff --git a/adapters/mso-sdnc-adapter/readme b/adapters/mso-sdnc-adapter/readme
new file mode 100644
index 0000000000..34c09fdf7c
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/readme
@@ -0,0 +1,67 @@
+SDNC Adapter is a conduit between MSO BPEL and SDNC
+SOAP requests from BPEL are sent as REST requests to SDNC
+BPEL get a SYNC response (with no data) right away
+On SDNC SYNC response, BPEL is sent an ASYNC (callback) response
+On SDNC ASYNC responses/notifications, BPEL is sent ASYNC responses
+Failure to send request to SDNC results in header to BPEL with respCode(4xx,5xx) and msg
+Success in sending requests to SDNC results in header to BPEL with 2xx respCode to BPEL and data received from SDNC
+SDNC data might have failures or success
+
+SDNCAdapter behaviour on being deployed in JBOSS
+-------------------------------------------------
+http://host:port/ - JBOSS Default Msg (Welcome to JBoss EAP 6)
+
+http://host:port/adapters/[check.html] - Application Ready
+
+http://host:port/adapters/rest/[anything] - SDNC Adapter Rest Services [: Anything]
+
+http://host:port/adapters/rest/properties/show - Lists all the properties loaded
+ org.openecomp.mso.adapters.sdnc.bpelcauth=avosAdmin:jboss123
+ org.openecomp.mso.adapters.sdnc.sdncconnecttime=2000
+ org.openecomp.mso.adapters.sdnc.myurl=http://192.20.205.182:8380/adapters/rest/SDNCNotify
+ org.openecomp.mso.adapters.sdnc.sdncurl=https://odl.node01.it.app.sdn.labs.att.com:8443/restconf/operations/L3SDN-API:
+ org.openecomp.mso.adapters.sdnc.sdncauth=admin:admin
+ org.openecomp.mso.adapters.sdnc.bpelurl=http://NJCDTL21RA1926.ITServices.sbc.com:8088/mockSDNCCallbackAdapterSoapHttpBinding?wsdl
+ org.openecomp.mso.adapters.sdnc.sdncreadtime=5000
+
+http://host:port/adapters/rest/properties/reload - Reloads all the properties
+ from $configDir/$configFile : /etc/ecomp/mso/config/mso.sdnc.properties
+
+http://host:port/adapters/rest/logging/setLevel//{logContext}/{level}") - changes application loglevel
+ where level is one of (ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF)
+ e.g
+ http://192.20.205.182:8380/adapters/rest/logging/setLevel/ROOT/INFO
+ log Level set to: INFO for
+ http://192.20.205.182:8380/adapters/rest/logging/setLevel/ROOT/INFO
+ log Level set to: DEBUG for com.att
+ http://192.20.205.182:8380/adapters/rest/logging/setLevel/garbage/DEBUG
+ Unknown logger: garbage
+
+http://host:port/adapters/rest/logging/loggers - shows all the loggers
+ :DEBUG (DEBUG)
+ com.att:INFO (INFO)
+ org.openecomp.mso:DEBUG (DEBUG)
+ org.openecomp.mso.adapters.sdnc.impl.SDNCAdapterPortTypeImpl:null (DEBUG)
+ org.openecomp.mso.adapters.sdnc.impl.SDNCRestClient:null (DEBUG)
+ org.openecomp.mso.adapters.sdnc.client.SDNCCallbackAdapterService:null (DEBUG)
+ org.openecomp.mso.adapters.sdnc.client.SDNCAdapterCallbackRequest:null (DEBUG)
+ org.openecomp.mso.adapters.sdnc.SDNCAdapterRequest:null (DEBUG)
+ org.openecomp.mso.adapters.sdnc.notify.SDNCNotifyResource:null (DEBUG)
+ org.openecomp.mso.adapters.vnf.MsoVnfAdapterImpl:null (DEBUG)
+ org.openecomp.mso.adapters.network.MsoNetworkAdapterImpl:null (DEBUG)
+ org.openecomp.mso.logger.MsoLoggingServlet:null (DEBUG)
+ org.openecomp.mso.logger.MsoLogger:null (DEBUG)
+ org.openecomp.mso.properties.MsoProperties:null (DEBUG)
+ org.openecomp.mso.properties.MsoPropertyInitializer:null (DEBUG)
+ org.jboss.resteasy.plugins.providers.YamlProvider:null (DEBUG)
+ org.jboss.resteasy.plugins.providers.RegisterBuiltin:null (DEBUG)
+ org.jboss.resteasy.plugins.providers.DocumentProvider:null (DEBUG)
+ org.jboss.resteasy.plugins.providers.IIOImageProvider:null (DEBUG)
+ org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap:null (DEBUG)
+ org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher:null (DEBUG)
+ org.jboss.resteasy.spi.ResteasyDeployment:null (DEBUG)
+ org.jboss.resteasy.core.SynchronousDispatcher:null (DEBUG)
+ org.jboss.resteasy.core.ResourceMethodRegistry:null (DEBUG)
+ org.jboss.resteasy.util.PickConstructor:null (DEBUG)
+
+SDNC Adapter will use ActiveRequests DB to track SDNC_CALLBACK_BPEL_URL \ No newline at end of file
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/ObjectFactory.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/ObjectFactory.java
new file mode 100644
index 0000000000..1f63eb8a61
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/ObjectFactory.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc;
+
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.openecomp.mso.adapters.sdnc package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.openecomp.mso.adapters.sdnc
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link RequestHeader }
+ *
+ */
+ public RequestHeader createRequestHeader() {
+ return new RequestHeader();
+ }
+
+ /**
+ * Create an instance of {@link SDNCAdapterResponse }
+ *
+ */
+ public SDNCAdapterResponse createSDNCAdapterResponse() {
+ return new SDNCAdapterResponse();
+ }
+
+ /**
+ * Create an instance of {@link SDNCAdapterRequest }
+ *
+ */
+ public SDNCAdapterRequest createSDNCAdapterRequest() {
+ return new SDNCAdapterRequest();
+ }
+
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/RequestHeader.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/RequestHeader.java
new file mode 100644
index 0000000000..c26d48b4a2
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/RequestHeader.java
@@ -0,0 +1,219 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc;
+
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType>
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="RequestId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="SvcInstanceId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="SvcAction" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="SvcOperation" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="CallbackUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+//BPEL to SDNCAdapter request header
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "requestId",
+ "svcInstanceId",
+ "svcAction",
+ "svcOperation",
+ "callbackUrl",
+ "msoAction"
+})
+@XmlRootElement(name = "RequestHeader")
+public class RequestHeader {
+
+ @XmlElement(name = "RequestId", required = true)
+ protected String requestId;
+ @XmlElement(name = "SvcInstanceId")
+ protected String svcInstanceId;
+ @XmlElement(name = "SvcAction", required = true)
+ protected String svcAction;
+ @XmlElement(name = "SvcOperation", required = true)
+ protected String svcOperation;
+ @XmlElement(name = "CallbackUrl", required = true)
+ protected String callbackUrl;
+ @XmlElement(name = "MsoAction")
+ protected String msoAction;
+
+ /**
+ * Gets the value of the requestId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRequestId() {
+ return requestId;
+ }
+
+ /**
+ * Sets the value of the requestId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRequestId(String value) {
+ this.requestId = value;
+ }
+
+ public String getSvcInstanceId() {
+ return svcInstanceId;
+ }
+
+ public void setSvcInstanceId(String svcInstanceId) {
+ this.svcInstanceId = svcInstanceId;
+ }
+
+ /**
+ * Gets the value of the svcAction property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSvcAction() {
+ return svcAction;
+ }
+
+ /**
+ * Sets the value of the svcAction property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSvcAction(String value) {
+ this.svcAction = value;
+ }
+
+ /**
+ * Gets the value of the svcOperation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSvcOperation() {
+ return svcOperation;
+ }
+
+ /**
+ * Sets the value of the svcOperation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSvcOperation(String value) {
+ this.svcOperation = value;
+ }
+
+ /**
+ * Gets the value of the callbackUrl property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCallbackUrl() {
+ return callbackUrl;
+ }
+
+ /**
+ * Sets the value of the callbackUrl property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCallbackUrl(String value) {
+ this.callbackUrl = value;
+ }
+
+ /**
+ * Gets the value of the callbackUrl property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMsoAction() {
+ return msoAction;
+ }
+
+ /**
+ * Sets the value of the callbackUrl property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMsoAction(String value) {
+ this.msoAction = value;
+ }
+
+
+ @Override
+ public String toString() {
+ return "RequestHeader [requestId=" + requestId +
+ ", svcInstanceId=" + svcInstanceId +
+ ", svcAction=" + svcAction +
+ ", svcOperation=" + svcOperation +
+ ", callbackUrl=" + callbackUrl +
+ ", msoAction=" + msoAction + "]";
+ }
+
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterPortType.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterPortType.java
new file mode 100644
index 0000000000..254fea0ba3
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterPortType.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc;
+
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.bind.annotation.XmlSeeAlso;
+
+
+/**
+ * This class was generated by Apache CXF 2.7.11.redhat-3
+ * 2015-01-27T18:25:50.914-05:00
+ * Generated source version: 2.7.11.redhat-3
+ *
+ */
+//BPEL SDNCAdapter SOAP WebService - impl class in impl pkg
+@WebService(targetNamespace = "http://domain2.att.com/workflow/sdnc/adapter/wsdl/v1", name = "SDNCAdapterPortType")
+@XmlSeeAlso({ObjectFactory.class})
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface SDNCAdapterPortType {
+
+ @WebResult(name = "SDNCAdapterResponse", targetNamespace = "http://domain2.att.com/workflow/sdnc/adapter/schema/v1", partName = "SDNCAdapterResponse")
+ @WebMethod(operationName = "SDNCAdapter")
+ public SDNCAdapterResponse sdncAdapter(
+ @WebParam(partName = "SDNCAdapterRequest", name = "SDNCAdapterRequest", targetNamespace = "http://domain2.att.com/workflow/sdnc/adapter/schema/v1")
+ SDNCAdapterRequest sdncAdapterRequest
+ );
+
+ @WebMethod
+ public void healthCheck();
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterRequest.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterRequest.java
new file mode 100644
index 0000000000..6b75949453
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterRequest.java
@@ -0,0 +1,129 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc;
+
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import org.openecomp.mso.adapters.sdnc.impl.Utils;
+/**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType>
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element ref="{http://domain2.att.com/workflow/sdnc/adapter/schema/v1}RequestHeader"/>
+ * &lt;element name="RequestData" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+//BPEL to SDNCAdapter request
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "requestHeader",
+ "requestData"
+})
+@XmlRootElement(name = "SDNCAdapterRequest")
+public class SDNCAdapterRequest {
+
+ @XmlElement(name = "RequestHeader", required = true)
+ protected RequestHeader requestHeader;
+ @XmlElement(name = "RequestData", required = true)
+ protected Object requestData;
+
+ /**
+ * Gets the value of the requestHeader property.
+ *
+ * @return
+ * possible object is
+ * {@link RequestHeader }
+ *
+ */
+ public RequestHeader getRequestHeader() {
+ return requestHeader;
+ }
+
+ /**
+ * Sets the value of the requestHeader property.
+ *
+ * @param value
+ * allowed object is
+ * {@link RequestHeader }
+ *
+ */
+ public void setRequestHeader(RequestHeader value) {
+ this.requestHeader = value;
+ }
+
+ /**
+ * Gets the value of the requestData property.
+ *
+ * @return
+ * possible object is
+ * {@link Object }
+ *
+ */
+ public Object getRequestData() {
+ return requestData;
+ }
+
+ /**
+ * Sets the value of the requestData property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Object }
+ *
+ */
+ public void setRequestData(Object value) {
+ this.requestData = value;
+ }
+
+ @Override
+ public String toString() {
+
+ String rd = "";
+ if (requestData != null)
+ {
+ Node node = (Node) requestData;
+ Document doc = node.getOwnerDocument();
+ rd = Utils.domToStr(doc);
+ }
+ return "SDNCAdapterRequest [requestHeader=" + requestHeader.toString()
+ + ", requestData=" + rd + "]";
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterResponse.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterResponse.java
new file mode 100644
index 0000000000..edbd3297c0
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterResponse.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc;
+
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType>
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+//SDNCAdapter to BPEL Sync Response(ACK) - async response(s) follow
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "SDNCAdapterResponse")
+public class SDNCAdapterResponse {
+
+
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterService.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterService.java
new file mode 100644
index 0000000000..0b63ad6dea
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterService.java
@@ -0,0 +1,128 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc;
+
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+
+//import org.openecomp.mso.adapters.sdnc.impl.MsoLogger;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.logger.MessageEnum;
+
+/**
+ * This class was generated by Apache CXF 2.7.11.redhat-3
+ * 2015-01-27T18:25:50.994-05:00
+ * Generated source version: 2.7.11.redhat-3
+ *
+ */
+//BPEL SDNCAdapter SOAP WebService
+@WebServiceClient(name = "SDNCAdapterService",
+ wsdlLocation = "main/resources/SDNCAdapter.wsdl",
+ targetNamespace = "http://domain2.att.com/workflow/sdnc/adapter/wsdl/v1")
+public class SDNCAdapterService extends Service {
+
+ private static MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+
+ public final static URL WSDL_LOCATION;
+
+ public final static QName SERVICE = new QName("http://domain2.att.com/workflow/sdnc/adapter/wsdl/v1", "SDNCAdapterService");
+ public final static QName SDNCAdapterSoapHttpPort = new QName("http://domain2.att.com/workflow/sdnc/adapter/wsdl/v1", "SDNCAdapterSoapHttpPort");
+ static {
+ URL wsdlUrl = null;
+ try {
+ wsdlUrl = Thread.currentThread().getContextClassLoader().getResource("main/resources/SDNCAdapter.wsdl");
+ //wsdlUrl = SDNCAdapterService.class.getClassLoader().getResource("SDNCAdapter.wsdl");
+ } catch (Exception e) {
+ logger.error(MessageEnum.RA_WSDL_NOT_FOUND, "SDNCAdapter.wsdl", "", "", MsoLogger.ErrorCode.DataError, "Exception - WSDL not found", e);
+ }
+ if(wsdlUrl == null) {
+ logger.error(MessageEnum.RA_WSDL_NOT_FOUND, "SDNCAdapter.wsdl", "", "", MsoLogger.ErrorCode.DataError, "WSDL not found");
+ } else {
+ try {
+ logger.info(MessageEnum.RA_PRINT_URL, "SDNCAdpater.wsdl", wsdlUrl.toURI().toString(), "", "");
+ } catch (Exception e) {
+ logger.error(MessageEnum.RA_WSDL_URL_CONVENTION_EXC, "SDNCAdapter.wsdl", "", "", MsoLogger.ErrorCode.DataError, "Exception - print URL", e);
+ }
+ }
+ WSDL_LOCATION = wsdlUrl;
+ }
+
+ public SDNCAdapterService(URL wsdlLocation) {
+ super(wsdlLocation, SERVICE);
+ }
+
+ public SDNCAdapterService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public SDNCAdapterService() {
+ super(WSDL_LOCATION, SERVICE);
+ }
+
+ //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
+ //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
+ //compliant code instead.
+ public SDNCAdapterService(WebServiceFeature ... features) {
+ super(WSDL_LOCATION, SERVICE, features);
+ }
+
+ //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
+ //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
+ //compliant code instead.
+ public SDNCAdapterService(URL wsdlLocation, WebServiceFeature ... features) {
+ super(wsdlLocation, SERVICE, features);
+ }
+
+ //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
+ //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
+ //compliant code instead.
+ public SDNCAdapterService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
+ super(wsdlLocation, serviceName, features);
+ }
+
+ /**
+ *
+ * @return
+ * returns SDNCAdapterPortType
+ */
+ @WebEndpoint(name = "SDNCAdapterSoapHttpPort")
+ public SDNCAdapterPortType getSDNCAdapterSoapHttpPort() {
+ return super.getPort(SDNCAdapterSoapHttpPort, SDNCAdapterPortType.class);
+ }
+
+ /**
+ *
+ * @param features
+ * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
+ * @return
+ * returns SDNCAdapterPortType
+ */
+ @WebEndpoint(name = "SDNCAdapterSoapHttpPort")
+ public SDNCAdapterPortType getSDNCAdapterSoapHttpPort(WebServiceFeature... features) {
+ return super.getPort(SDNCAdapterSoapHttpPort, SDNCAdapterPortType.class, features);
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/CallbackHeader.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/CallbackHeader.java
new file mode 100644
index 0000000000..a49f55b596
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/CallbackHeader.java
@@ -0,0 +1,154 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.client;
+
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType>
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="RequestId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="ResponseCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="ResponseMessage" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+//SDNCAdapter to BPEL Async response header
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "requestId",
+ "responseCode",
+ "responseMessage"
+})
+@XmlRootElement(name = "CallbackHeader")
+public class CallbackHeader {
+
+ @XmlElement(name = "RequestId", required = true)
+ protected String requestId;
+ @XmlElement(name = "ResponseCode", required = true)
+ protected String responseCode;
+ @XmlElement(name = "ResponseMessage", required = true)
+ protected String responseMessage;
+
+ public CallbackHeader() {
+ }
+
+ public CallbackHeader(String reqId, String respCode, String respMsg) {
+ this.requestId = reqId;
+ this.responseCode = respCode;
+ this.responseMessage = respMsg;
+ }
+
+ /**
+ * Gets the value of the requestId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRequestId() {
+ return requestId;
+ }
+
+ /**
+ * Sets the value of the requestId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRequestId(String value) {
+ this.requestId = value;
+ }
+
+ /**
+ * Gets the value of the responseCode property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getResponseCode() {
+ return responseCode;
+ }
+
+ /**
+ * Sets the value of the responseCode property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setResponseCode(String value) {
+ this.responseCode = value;
+ }
+
+ /**
+ * Gets the value of the responseMessage property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getResponseMessage() {
+ return responseMessage;
+ }
+
+ /**
+ * Sets the value of the responseMessage property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setResponseMessage(String value) {
+ this.responseMessage = value;
+ }
+
+ @Override
+ public String toString() {
+ return "CallbackHeader [requestId=" + requestId + ", responseCode="
+ + responseCode + ", responseMessage=" + responseMessage + "]";
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/ObjectFactory.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/ObjectFactory.java
new file mode 100644
index 0000000000..6e7e599c7d
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/ObjectFactory.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.client;
+
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.openecomp.mso.adapters.sdnc.client package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.openecomp.mso.adapters.sdnc.client
+ *
+ */
+ public ObjectFactory() {
+ }
+
+
+ /**
+ * Create an instance of {@link SDNCAdapterCallbackRequest }
+ *
+ */
+ public SDNCAdapterCallbackRequest createSDNCAdapterCallbackRequest() {
+ return new SDNCAdapterCallbackRequest();
+ }
+
+ /**
+ * Create an instance of {@link CallbackHeader }
+ *
+ */
+ public CallbackHeader createCallbackHeader() {
+ return new CallbackHeader();
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCAdapterCallbackRequest.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCAdapterCallbackRequest.java
new file mode 100644
index 0000000000..fd16e4754c
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCAdapterCallbackRequest.java
@@ -0,0 +1,136 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.client;
+
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+import java.io.StringWriter;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.logger.MessageEnum;
+/**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType>
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element ref="{http://domain2.att.com/workflow/sdnc/adapter/schema/v1}CallbackHeader"/>
+ * &lt;element name="RequestData" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+//SDNCAdapter to BPEL Async response
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "callbackHeader",
+ "requestData"
+})
+@XmlRootElement(name = "SDNCAdapterCallbackRequest")
+public class SDNCAdapterCallbackRequest {
+
+ @XmlElement(name = "CallbackHeader", required = true)
+ protected CallbackHeader callbackHeader;
+ @XmlElement(name = "RequestData")
+ protected Object requestData;
+
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+
+ /**
+ * Gets the value of the callbackHeader property.
+ *
+ * @return
+ * possible object is
+ * {@link CallbackHeader }
+ *
+ */
+ public CallbackHeader getCallbackHeader() {
+ return callbackHeader;
+ }
+
+ /**
+ * Sets the value of the callbackHeader property.
+ *
+ * @param value
+ * allowed object is
+ * {@link CallbackHeader }
+ *
+ */
+ public void setCallbackHeader(CallbackHeader value) {
+ this.callbackHeader = value;
+ }
+
+ /**
+ * Gets the value of the requestData property.
+ *
+ * @return
+ * possible object is
+ * {@link Object }
+ *
+ */
+ public Object getRequestData() {
+ return requestData;
+ }
+
+ /**
+ * Sets the value of the requestData property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Object }
+ *
+ */
+ public void setRequestData(Object value) {
+ this.requestData = value;
+ }
+
+ @Override
+ public String toString() {
+ try {
+ JAXBContext ctx = JAXBContext.newInstance("org.openecomp.mso.adapters.sdnc.client");
+ Marshaller m = ctx.createMarshaller();
+ m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+ m.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ StringWriter w = new StringWriter();
+ m.marshal(this, w);
+ return (w.toString());
+ }
+ catch (Exception e)
+ {
+ msoLogger.error(MessageEnum.RA_MARSHING_ERROR, "", "", MsoLogger.ErrorCode.DataError, "Exception - MARSHING_ERROR", e);
+ }
+ return("");
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java
new file mode 100644
index 0000000000..6818e67e75
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.client;
+
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import org.openecomp.mso.adapters.sdnc.SDNCAdapterResponse;
+
+
+/**
+ * This class was generated by Apache CXF 2.7.11.redhat-3
+ * 2015-01-28T11:07:01.997-05:00
+ * Generated source version: 2.7.11.redhat-3
+ *
+ */
+//SDNCAdapter to BPEL Async response WEB Service
+@WebService(targetNamespace = "http://domain2.att.com/workflow/sdnc/adapter/callback/wsdl/v1", name = "SDNCCallbackAdapterPortType")
+@XmlSeeAlso({ObjectFactory.class})
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface SDNCCallbackAdapterPortType {
+
+ @WebResult(name = "SDNCAdapterResponse", targetNamespace = "http://domain2.att.com/workflow/sdnc/adapter/schema/v1", partName = "SDNCAdapterCallbackResponse")
+ @WebMethod(operationName = "SDNCAdapterCallback")
+ public SDNCAdapterResponse sdncAdapterCallback(
+ @WebParam(partName = "SDNCAdapterCallbackRequest", name = "SDNCAdapterCallbackRequest", targetNamespace = "http://domain2.att.com/workflow/sdnc/adapter/schema/v1")
+ SDNCAdapterCallbackRequest sdncAdapterCallbackRequest
+ );
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterService.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterService.java
new file mode 100644
index 0000000000..6fa8e035a5
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterService.java
@@ -0,0 +1,126 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.client;
+
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoLogger;
+
+/**
+ * This class was generated by Apache CXF 2.7.11.redhat-3
+ * 2015-01-28T11:07:02.074-05:00
+ * Generated source version: 2.7.11.redhat-3
+ *
+ */
+//SDNCAdapter to BPEL Async response WEB Service
+@WebServiceClient(name = "SDNCCallbackAdapterService",
+ wsdlLocation = "main/resources/SDNCCallbackAdapter.wsdl",
+ targetNamespace = "http://domain2.att.com/workflow/sdnc/adapter/callback/wsdl/v1")
+public class SDNCCallbackAdapterService extends Service {
+
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+
+ public final static URL WSDL_LOCATION;
+ public final static QName SERVICE = new QName("http://domain2.att.com/workflow/sdnc/adapter/callback/wsdl/v1", "SDNCCallbackAdapterService");
+ public final static QName SDNCCallbackAdapterSoapHttpPort = new QName("http://domain2.att.com/workflow/sdnc/adapter/callback/wsdl/v1", "SDNCCallbackAdapterSoapHttpPort");
+ static {
+ URL wsdlUrl = null;
+ try {
+ wsdlUrl = Thread.currentThread().getContextClassLoader().getResource("main/resources/SDNCCallbackAdapter.wsdl");
+ //wsdlUrl = SDNCCallbackAdapterService.class.getClassLoader().getResource("SDNCCallbackAdapter.wsdl");
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.RA_WSDL_NOT_FOUND, "SDNCCallbackAdapter.wsdl", "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception - WSDL not found", e);
+ }
+ if(wsdlUrl == null) {
+ msoLogger.error(MessageEnum.RA_WSDL_NOT_FOUND, "SDNCCallbackAdapter.wsdl", "SDNC", "", MsoLogger.ErrorCode.DataError, "WSDL not found");
+ } else {
+ try {
+ msoLogger.info(MessageEnum.RA_PRINT_URL, "SDNCCallbackAdapter.wsdl", wsdlUrl.toURI().toString(), "SDNC", "");
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.RA_WSDL_URL_CONVENTION_EXC, "SDNCCallbackAdapter.wsdl", "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception - URL convention problem", e);
+ }
+ }
+ WSDL_LOCATION = wsdlUrl;
+ }
+
+ public SDNCCallbackAdapterService(URL wsdlLocation) {
+ super(wsdlLocation, SERVICE);
+ }
+
+ public SDNCCallbackAdapterService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public SDNCCallbackAdapterService() {
+ super(WSDL_LOCATION, SERVICE);
+ }
+
+ //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
+ //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
+ //compliant code instead.
+ public SDNCCallbackAdapterService(WebServiceFeature ... features) {
+ super(WSDL_LOCATION, SERVICE, features);
+ }
+
+ //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
+ //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
+ //compliant code instead.
+ public SDNCCallbackAdapterService(URL wsdlLocation, WebServiceFeature ... features) {
+ super(wsdlLocation, SERVICE, features);
+ }
+
+ //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
+ //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
+ //compliant code instead.
+ public SDNCCallbackAdapterService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
+ super(wsdlLocation, serviceName, features);
+ }
+
+ /**
+ *
+ * @return
+ * returns SDNCCallbackAdapterPortType
+ */
+ @WebEndpoint(name = "SDNCCallbackAdapterSoapHttpPort")
+ public SDNCCallbackAdapterPortType getSDNCCallbackAdapterSoapHttpPort() {
+ return super.getPort(SDNCCallbackAdapterSoapHttpPort, SDNCCallbackAdapterPortType.class);
+ }
+
+ /**
+ *
+ * @param features
+ * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
+ * @return
+ * returns SDNCCallbackAdapterPortType
+ */
+ @WebEndpoint(name = "SDNCCallbackAdapterSoapHttpPort")
+ public SDNCCallbackAdapterPortType getSDNCCallbackAdapterSoapHttpPort(WebServiceFeature... features) {
+ return super.getPort(SDNCCallbackAdapterSoapHttpPort, SDNCCallbackAdapterPortType.class, features);
+ }
+
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/package-info.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/package-info.java
new file mode 100644
index 0000000000..0d6f900f47
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/package-info.java
@@ -0,0 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://domain2.att.com/workflow/sdnc/adapter/schema/v1", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.openecomp.mso.adapters.sdnc.client;
+
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Constants.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Constants.java
new file mode 100644
index 0000000000..6cc0ecbd92
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Constants.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.impl;
+
+
+public interface Constants {
+
+ public static final String BPEL_URL_PROP = "org.openecomp.mso.adapters.sdnc.bpelurl";
+ public static final String DEFAULT_BPEL_URL = "http://msobpel.mtcnj.aic.cip.att.com:8080//active-bpel/services/SDNCAdapterCallbackV1";
+
+ public static final String MY_URL_PROP = "org.openecomp.mso.adapters.sdnc.myurl";
+ public static final String DEFAULT_MY_URL = "https://msojra.mtcnj.aic.cip.att.com:8443/adapters/rest/SDNCNotify";
+
+ public static final String SDNC_AUTH_PROP = "org.openecomp.mso.adapters.sdnc.sdncauth";
+ public static final String DEFAULT_SDNC_AUTH = "406B2AE613211B6FB52466DE6E1769AC";
+
+ public static final String DEFAULT_BPEL_AUTH = "05FDA034C27D1CA51AAB8FAE512EDE45241E16FC8C137D292AA3A964431C82DB";
+ public static final String BPEL_AUTH_PROP = "org.openecomp.mso.adapters.sdnc.bpelauth";
+
+
+ public static final String SDNC_SVCCFGRESP_ROOT = "input";
+ public static final String SDNC_REQ_ID = "/svc-request-id";
+ public static final String SDNC_RESP_CODE = "/response-code";
+ public static final String SDNC_RESP_MSG = "/response-message";
+ public static final String SDNC_CONNECTTIME_PROP = "org.openecomp.mso.adapters.sdnc.sdncconnecttime";
+ public static final String ENCRYPTION_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
+
+ public static final String REQUEST_TUNABLES = "org.openecomp.mso.adapters.sdnc";
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunables.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunables.java
new file mode 100644
index 0000000000..6c8c8819ed
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunables.java
@@ -0,0 +1,223 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.impl;
+
+
+import org.openecomp.mso.logger.MsoAlarmLogger;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.properties.MsoJavaProperties;
+import org.openecomp.mso.properties.MsoPropertiesException;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+
+import org.openecomp.mso.logger.MessageEnum;
+public class RequestTunables {
+
+ private MsoPropertiesFactory msoPropertiesFactory;
+
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+ private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();
+ public static final String MSO_PROP_SDNC_ADAPTER="MSO_PROP_SDNC_ADAPTER";
+
+ //criteria
+ private String reqId = "";
+ private String msoAction = "";
+ private String operation = "";
+ private String action = "";
+
+ //tunables
+ private String reqMethod = "POST";
+ private String sdncUrl = null;
+ private String timeout = "60000";
+ private String headerName = "sdnc-request-header";
+ private String namespace = "";
+ private String asyncInd = "N"; //future use
+
+ private String sdncaNotificationUrl = null;
+
+ public RequestTunables(String reqId, String msoAction, String operation, String action, MsoPropertiesFactory msoPropFactory) {
+ super();
+ msoPropertiesFactory = msoPropFactory;
+ if (reqId != null) {
+ this.reqId = reqId;
+ }
+ if (msoAction != null) {
+ this.msoAction = msoAction;
+ }
+ if (operation != null) {
+ this.operation = operation;
+ }
+ if (action != null) {
+ this.action = action;
+ }
+ }
+
+ public String getReqId() {
+ return reqId;
+ }
+ public void setReqId(String reqId) {
+ this.reqId = reqId;
+ }
+ public String getReqMethod() {
+ return reqMethod;
+ }
+ public void setReqMethod(String reqMethod) {
+ this.reqMethod = reqMethod;
+ }
+ public String getMsoAction() {
+ return msoAction;
+ }
+ public void setMsoAction(String msoAction) {
+ this.msoAction = msoAction;
+ }
+ public String getAction() {
+ return action;
+ }
+ public void setAction(String action) {
+ this.action = action;
+ }
+ public String getOperation() {
+ return operation;
+ }
+ public void setOperation(String operation) {
+ this.operation = operation;
+ }
+ public String getSdncUrl() {
+ return sdncUrl;
+ }
+ public void setSdncUrl(String sdncUrl) {
+ this.sdncUrl = sdncUrl;
+ }
+ public String getTimeout() {
+ return timeout;
+ }
+ public void setTimeout(String timeout) {
+ this.timeout = timeout;
+ }
+ public String getAsyncInd() {
+ return asyncInd;
+ }
+ public void setAsyncInd(String asyncInd) {
+ this.asyncInd = asyncInd;
+ }
+ public String getHeaderName() {
+ return headerName;
+ }
+ public void setHeaderName(String headerName) {
+ this.headerName = headerName;
+ }
+
+
+ public String getSdncaNotificationUrl() {
+ return sdncaNotificationUrl;
+ }
+
+ public void setSdncaNotificationUrl(String sdncaNotificationUrl) {
+ this.sdncaNotificationUrl = sdncaNotificationUrl;
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ @Override
+ public String toString() {
+ return "RequestTunables [reqId=" + reqId + ", msoAction=" + msoAction
+ + ", operation=" + operation + ", action=" + action
+ + ", reqMethod=" + reqMethod + ", sdncUrl=" + sdncUrl
+ + ", timeout=" + timeout + ", headerName=" + headerName
+ + ", sdncaNotificationUrl=" + sdncaNotificationUrl
+ + ", namespace=" + namespace + "]";
+ }
+
+ public void setTunables()
+ {
+ String error = null;
+ String key = null;
+ if ("query".equals(action)) { //due to variable format for operation eg services/layer3-service-list/8fe4ba4f-35cf-4d9b-a04a-fd3f5d4c5cc9
+ key = Constants.REQUEST_TUNABLES + "." + msoAction + ".." + action;
+ msoLogger.debug("Generated key: " + key);
+ }
+ else if ("put".equals(action) || "restdelete".equals(action)) { //due to variable format for operation eg services/layer3-service-list/8fe4ba4f-35cf-4d9b-a04a-fd3f5d4c5cc9
+ key = Constants.REQUEST_TUNABLES + "..." + action;
+ msoLogger.debug("Generated key: " + key);
+ } else {
+ key = Constants.REQUEST_TUNABLES + "." + msoAction + "." + operation +"." + action;
+ msoLogger.debug("Generated key: " + key);
+ }
+
+ String value;
+ try {
+ value = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_SDNC_ADAPTER).getProperty(key, "");
+ } catch (MsoPropertiesException e) {
+ msoLogger.error (MessageEnum.LOAD_PROPERTIES_FAIL, "Unknown. Mso Properties ID not found in cache: " + MSO_PROP_SDNC_ADAPTER, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception - Mso Properties ID not found in cache", e);
+ value="";
+ }
+
+ if (value != null && value.length() > 0) {
+
+ String[] parts = value.split("\\|"); //escape pipe
+ if (parts.length < 3) {
+ msoLogger.warn(MessageEnum.RA_SDNC_INVALID_CONFIG, key, value, "SDNC", "", MsoLogger.ErrorCode.DataError, "Invalid config");
+ }
+
+ for (int i = 0; i < parts.length; i++) {
+ if (i == 0) {
+ reqMethod = parts[i];
+ msoLogger.debug("Request Method is set to: " + reqMethod);
+ } else if (i == 1) {
+ timeout = parts[i];
+ msoLogger.debug("Timeout is set to: " + timeout);
+ } else if (i == 2) {
+ sdncUrl = SDNCAdapterPortTypeImpl.getProperty(Constants.REQUEST_TUNABLES + "." + parts[i], "",msoPropertiesFactory);
+ if (operation != null && sdncUrl != null) {
+ sdncUrl = sdncUrl + operation;
+ }
+ msoLogger.debug("SDNC Url is set to: " + sdncUrl);
+ } else if (i == 3) {
+ headerName = parts[i];
+ msoLogger.debug("HeaderName is set to: " + headerName);
+ } else if (i == 4) {
+ namespace = parts[i];
+ msoLogger.debug("NameSpace is set to: " + namespace);
+ } else if (i == 5) {
+ asyncInd = parts[i];
+ msoLogger.debug("AsyncInd is set to: " + asyncInd);
+ }
+ }
+
+ if (sdncUrl == null) {
+ error = "Invalid configuration, sdncUrl required for:" + key + " value:" + value;
+ }
+ } else {
+ error = "Missing configuration for:" + key;
+ }
+ if (error != null) {
+ msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, key, "SDNC", "", MsoLogger.ErrorCode.DataError, "Missing config param");
+ alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, error);
+ }
+ msoLogger.debug ("RequestTunables Key:" + key + " Value:" + value + " Tunables:" + this.toString());
+ return;
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.java
new file mode 100644
index 0000000000..887c0a9990
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.impl;
+
+import javax.annotation.PostConstruct;
+import javax.jws.WebService;
+import javax.servlet.http.HttpServletResponse;
+
+import org.openecomp.mso.adapters.sdnc.SDNCAdapterPortType;
+import org.openecomp.mso.adapters.sdnc.SDNCAdapterRequest;
+import org.openecomp.mso.adapters.sdnc.SDNCAdapterResponse;
+import org.openecomp.mso.adapters.sdnc.util.SDNCRequestIdUtil;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoAlarmLogger;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.properties.MsoPropertiesException;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+
+//BPEL SDNCAdapter SOAP Web Service implementation
+@WebService(serviceName = "SDNCAdapterService", endpointInterface = "org.openecomp.mso.adapters.sdnc.SDNCAdapterPortType", targetNamespace = "http://domain2.att.com/workflow/sdnc/adapter/wsdl/v1")
+public class SDNCAdapterPortTypeImpl implements SDNCAdapterPortType {
+
+ private MsoPropertiesFactory msoPropertiesFactory=new MsoPropertiesFactory();
+
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+ private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();
+ private static final String LOG_SERVICE_NAME = "MSO-BPMN:MSO-SDNCAdapter.";
+ private static final String LOG_REPLY_NAME = "MSO-SDNCAdapter:MSO-BPMN.";
+ public static final String MSO_PROP_SDNC_ADAPTER="MSO_PROP_SDNC_ADAPTER";
+
+ @PostConstruct
+ public void init () {
+ msoLogger.info(MessageEnum.RA_INIT_SDNC_ADAPTER, "SDNC", "SDNCAdapterPortType");
+ }
+
+ /**
+ * Health Check web method. Does nothing but return to show the adapter is deployed.
+ */
+ @Override
+ public void healthCheck ()
+ {
+ msoLogger.debug("Health check call in SDNC Adapter");
+ }
+
+ public static String getProperty(String key, String defaultValue, MsoPropertiesFactory msoPropertiesFactoryp) {
+ String value;
+ try {
+ value = msoPropertiesFactoryp.getMsoJavaProperties(MSO_PROP_SDNC_ADAPTER).getProperty(key, defaultValue);
+ } catch (MsoPropertiesException e) {
+ msoLogger.error (MessageEnum.NO_PROPERTIES, "Unknown. Mso Properties ID not found in cache: " + MSO_PROP_SDNC_ADAPTER, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception - Mso Properties ID not found in cache", e);
+ return null;
+ }
+ msoLogger.debug("Config read for " + MSO_PROP_SDNC_ADAPTER + " - key:" + key + " value:" + value);
+ return value;
+ }
+
+ @Override
+ public SDNCAdapterResponse sdncAdapter(SDNCAdapterRequest bpelRequest) {
+ String bpelReqId = bpelRequest.getRequestHeader().getRequestId();
+ String callbackUrl = bpelRequest.getRequestHeader().getCallbackUrl();
+ long startTime = System.currentTimeMillis ();
+ MsoLogger.setLogContext(SDNCRequestIdUtil.getSDNCOriginalRequestId (bpelReqId), bpelRequest.getRequestHeader().getSvcInstanceId());
+ MsoLogger.setServiceName (bpelRequest.getRequestHeader().getSvcAction());
+ msoLogger.info(MessageEnum.RA_RECEIVE_BPEL_REQUEST, bpelReqId, callbackUrl, "SDNC", "");
+
+ SDNCRestClient sdncClient = new SDNCRestClient(bpelRequest,msoPropertiesFactory);
+ long subStartTime = System.currentTimeMillis ();
+ try {
+ Thread sdncClientThread = new Thread(sdncClient);
+ sdncClientThread.start();
+ }
+ catch (Exception e){
+ String respMsg = "Error sending request to SDNC. Failed to start SDNC Client thread " + e.getMessage();
+ msoLogger.error(MessageEnum.RA_SEND_REQUEST_SDNC_ERR, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception sending request to SDNC. Failed to start SDNC Client thread", e);
+ alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, respMsg);
+ SDNCResponse sdncResp = new SDNCResponse(bpelReqId);
+ sdncResp.setRespCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ sdncResp.setRespMsg(respMsg);
+ SDNCRestClient.sendRespToBpel(callbackUrl, sdncResp, msoPropertiesFactory);
+ }
+
+ msoLogger.debug("Sending synchronous response to BPEL");
+ SDNCAdapterResponse wsResp = new SDNCAdapterResponse();
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+ return (wsResp);
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImpl.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImpl.java
new file mode 100644
index 0000000000..c873c9215e
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImpl.java
@@ -0,0 +1,191 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.impl;
+
+
+import java.io.StringReader;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.HEAD;
+import javax.ws.rs.POST;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Response;
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.openecomp.mso.HealthCheckUtils;
+import org.openecomp.mso.utils.UUIDChecker;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+import org.openecomp.mso.logger.MessageEnum;
+@Path("/")
+public class SDNCAdapterRestImpl {
+
+ private MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
+ public final static String MSO_PROP_ADAPTER="MSO_PROP_SDNC_ADAPTER";
+
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+
+ @Context
+ private HttpHeaders headers;
+ @Context HttpServletRequest request;
+
+ @POST
+ @Path("/MSORequest")
+ @Consumes("application/xml")
+ @Produces("application/xml")
+ public Response MSORequest(String reqXML) {
+ msoLogger.debug("***Received MSO Rest Request. XML:" + reqXML);
+
+ Document reqDoc = null;
+ SDNCResponse sdncResp = null;
+ RequestTunables rt = null;
+ String reqId = "";
+ long startTime = System.currentTimeMillis();
+ MsoLogger.setServiceName("UNKNOWN");
+ String action = "";
+ String operation = "";
+ try {
+
+ reqId = headers.getRequestHeader("att-mso-request-id").get(0);
+ action = headers.getRequestHeader("att-mso-request-action").get(0);
+ operation = headers.getRequestHeader("att-mso-request-operation").get(0);
+
+ MsoLogger.setLogContext(reqId, "");
+
+ msoLogger.debug ("Received MSO Rest Request XML: " + reqXML);
+ rt = new RequestTunables(reqId, "", operation, action, msoPropertiesFactory);
+ rt.setTunables();
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setFeature (XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ DocumentBuilder db = dbf.newDocumentBuilder();
+
+ InputSource source = new InputSource(new StringReader(reqXML));
+
+ reqDoc = db.parse(source);
+
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.RA_PARSING_REQUEST_ERROR, reqXML, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception - Invalid XML request format", e);
+ sdncResp = new SDNCResponse(reqId, HttpServletResponse.SC_BAD_REQUEST, "Invalid XML request format");
+ }
+
+ if (reqDoc != null) {
+ msoLogger.debug("***Getting response from sdnc***");
+ long subStartTime = System.currentTimeMillis ();
+ sdncResp = SDNCRestClient.getSdncResp(Utils.genSdncReq(reqDoc, rt), rt,msoPropertiesFactory);
+ msoLogger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from SDNC", "SDNC", action + "." + operation, null);
+ }
+
+ if (sdncResp == null) {
+ msoLogger.debug("An Internal Server error has occurred in SDNC Adapter");
+ sdncResp = new SDNCResponse(reqId, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "MSO - SDNCA Internal Error");
+ }
+
+ if (sdncResp.getSdncRespXml() == null) {
+ sdncResp.setSdncRespXml(Utils.genMsoFailResp(sdncResp));
+ }
+
+ msoLogger.debug("***Completed MSO Rest Request." + sdncResp.toString());
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+ return Response.status(sdncResp.getRespCode()).entity(sdncResp.getSdncRespXml()).build();
+ }
+
+ @HEAD
+ @GET
+ @Path("/healthcheck")
+ @Produces("text/html")
+ public Response healthcheck (@QueryParam("requestId") String requestId) {
+ long startTime = System.currentTimeMillis ();
+ MsoLogger.setServiceName ("Healthcheck");
+ UUIDChecker.verifyOldUUID(requestId, msoLogger);
+ HealthCheckUtils healthCheck = new HealthCheckUtils ();
+ if (!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+ return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
+ }
+
+ if (!healthCheck.configFileCheck(msoLogger, startTime, MSO_PROP_ADAPTER)) {
+ return HealthCheckUtils.NOT_STARTED_RESPONSE;
+ }
+ msoLogger.debug("healthcheck - Successful");
+ return HealthCheckUtils.HEALTH_CHECK_RESPONSE;
+ }
+
+ @HEAD
+ @GET
+ @Path("/globalhealthcheck")
+ @Produces("text/html")
+ public Response globalHealthcheck (@DefaultValue("true") @QueryParam("enableBpmn") boolean enableBpmn) {
+ long startTime = System.currentTimeMillis ();
+ MsoLogger.setServiceName ("GlobalHealthcheck");
+ // Generate a Request Id
+ String requestId = UUIDChecker.generateUUID(msoLogger);
+ HealthCheckUtils healthCheck = new HealthCheckUtils ();
+ if (!healthCheck.siteStatusCheck (msoLogger, startTime)) {
+ return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
+ }
+
+ if (healthCheck.verifyGlobalHealthCheck(enableBpmn, requestId)) {
+ msoLogger.debug("globalHealthcheck - Successful");
+ return HealthCheckUtils.HEALTH_CHECK_RESPONSE;
+ } else {
+ msoLogger.debug("globalHealthcheck - At leaset one of the sub-modules is not available.");
+ return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
+ }
+ }
+
+ @HEAD
+ @GET
+ @Path("/nodehealthcheck")
+ @Produces("text/html")
+ public Response nodeHealthcheck () {
+ long startTime = System.currentTimeMillis ();
+ MsoLogger.setServiceName ("NodeHealthcheck");
+ // Generate a Request Id
+ String requestId = UUIDChecker.generateUUID(msoLogger);
+ HealthCheckUtils healthCheck = new HealthCheckUtils ();
+ if (!healthCheck.siteStatusCheck (msoLogger, startTime)) {
+ return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
+ }
+
+ if (healthCheck.verifyNodeHealthCheck(HealthCheckUtils.NodeType.RA, requestId)) {
+ msoLogger.debug("nodeHealthcheck - Successful");
+ return HealthCheckUtils.HEALTH_CHECK_RESPONSE;
+ } else {
+ msoLogger.debug("nodeHealthcheck - At leaset one of the sub-modules is not available.");
+ return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
+ }
+ }
+
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCResponse.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCResponse.java
new file mode 100644
index 0000000000..b6178596f6
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCResponse.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.impl;
+
+
+import java.io.Serializable;
+
+public class SDNCResponse implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private String reqId = null;
+ private int respCode = 0;
+ private String respMsg = null;
+ private String sdncRespXml = null;
+
+ public SDNCResponse(String reqId) {
+ this.reqId = reqId;
+ }
+ public SDNCResponse(String reqId, int respCode, String respMsg) {
+ this.reqId = reqId;
+ this.respCode = respCode;
+ this.respMsg = respMsg;
+ }
+
+ public String getReqId() {
+ return reqId;
+ }
+ public void setReqId(String reqId) {
+ this.reqId = reqId;
+ }
+ public int getRespCode() {
+ return respCode;
+ }
+ public void setRespCode(int respCode) {
+ this.respCode = respCode;
+ }
+ public String getRespMsg() {
+ return respMsg;
+ }
+ public void setRespMsg(String respMsg) {
+ this.respMsg = respMsg;
+ }
+ public String getSdncRespXml() {
+ return sdncRespXml;
+ }
+ public void setSdncRespXml(String sdncRespXml) {
+ this.sdncRespXml = sdncRespXml;
+ }
+
+ @Override
+ public String toString() {
+ return "SDNCResponse [reqId=" + reqId + ", respCode=" + respCode
+ + ", respMsg=" + respMsg + ", sdncRespXml=" + sdncRespXml + "]";
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCRestClient.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCRestClient.java
new file mode 100644
index 0000000000..00d7c5a144
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/SDNCRestClient.java
@@ -0,0 +1,345 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.impl;
+
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.EJB;
+import javax.xml.XMLConstants;
+import javax.xml.bind.DatatypeConverter;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.openecomp.mso.adapters.sdnc.SDNCAdapterRequest;
+import org.openecomp.mso.adapters.sdnc.client.CallbackHeader;
+import org.openecomp.mso.adapters.sdnc.client.SDNCAdapterCallbackRequest;
+import org.openecomp.mso.adapters.sdnc.client.SDNCCallbackAdapterPortType;
+import org.openecomp.mso.adapters.sdnc.client.SDNCCallbackAdapterService;
+import org.openecomp.mso.adapters.sdnc.util.SDNCRequestIdUtil;
+import org.openecomp.mso.logger.MsoAlarmLogger;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.properties.MsoJavaProperties;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+
+//SDNCAdapter to SDNC Rest Client
+public class SDNCRestClient implements Runnable {
+
+ private MsoPropertiesFactory msoPropertiesFactory;
+
+ private SDNCAdapterRequest bpelRequest;
+
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+ private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();
+ public static final String MSO_PROP_SDNC_ADAPTER="MSO_PROP_SDNC_ADAPTER";
+
+
+ public SDNCRestClient(SDNCAdapterRequest bpelRequest,MsoPropertiesFactory msoPropFactory) {
+ this.bpelRequest = bpelRequest;
+ msoPropertiesFactory = msoPropFactory;
+ }
+
+ @Override
+ public void run()
+ {
+
+ String action = bpelRequest.getRequestHeader().getSvcAction();
+ String operation = bpelRequest.getRequestHeader().getSvcOperation();
+ String bpelReqId = bpelRequest.getRequestHeader().getRequestId();
+ String callbackUrl = bpelRequest.getRequestHeader().getCallbackUrl();
+ MsoLogger.setLogContext(SDNCRequestIdUtil.getSDNCOriginalRequestId (bpelReqId), bpelRequest.getRequestHeader().getSvcInstanceId());
+ MsoLogger.setServiceName("SDNCRestClient");
+
+ String sdncReqBody = null;
+
+ msoLogger.debug("BPEL Request:" + bpelRequest.toString());
+
+ RequestTunables rt = new RequestTunables(bpelReqId,
+ bpelRequest.getRequestHeader().getMsoAction(),
+ bpelRequest.getRequestHeader().getSvcOperation(),
+ bpelRequest.getRequestHeader().getSvcAction(),msoPropertiesFactory);
+ rt.setTunables();
+ rt.setSdncaNotificationUrl(SDNCAdapterPortTypeImpl.getProperty(Constants.MY_URL_PROP, Constants.DEFAULT_MY_URL,msoPropertiesFactory));
+
+
+ if ("POST".equals(rt.getReqMethod()))
+ {
+ /* TODO Hibernate
+ try {
+ RequestsDatabase.updateBpelUrl(bpelReqId, callbackUrl);
+ }
+ catch (Exception e1)
+ {
+ logger.error("Failed to update DB ActiveRequests with SDNC_CALLBACK_BPEL_URL. Default CallbackUrl will be used for SDNC async notifications", e1);
+ }
+ */
+
+ Node node = (Node) bpelRequest.getRequestData();
+ Document reqDoc = node.getOwnerDocument();
+ sdncReqBody = Utils.genSdncReq(reqDoc, rt);
+
+ }
+ //should be more generic if we do RPC then we add the input tags etc, if it is pure REST this is not needed
+ else if("PUT".equals(rt.getReqMethod())){
+ Node node = (Node) bpelRequest.getRequestData();
+ Document reqDoc = node.getOwnerDocument();
+ sdncReqBody = Utils.genSdncPutReq(reqDoc, rt);
+ }
+ long sdncStartTime = System.currentTimeMillis();
+ SDNCResponse sdncResp = getSdncResp(sdncReqBody, rt, msoPropertiesFactory);
+ msoLogger.recordMetricEvent (sdncStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from SDNC", "SDNC", action + "." + operation, null);
+
+ msoLogger.debug ("Got the SDNC Response: " + sdncResp.getSdncRespXml());
+ msoLogger.debug("Sending reponse to bpel from SDNC rest client");
+ long bpelStartTime = System.currentTimeMillis();
+ sendRespToBpel(callbackUrl, sdncResp,msoPropertiesFactory);
+ msoLogger.recordMetricEvent (bpelStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully send reauest to BPEL", "BPMN", callbackUrl, null);
+ return;
+ }
+
+ public static SDNCResponse getSdncResp(String sdncReqBody, RequestTunables rt, MsoPropertiesFactory msoPropertiesFactoryp)
+ {
+
+ URL url;
+ HttpURLConnection con = null;
+ DataOutputStream out = null;
+ BufferedReader in = null;
+ SDNCResponse sdncResp = new SDNCResponse(rt.getReqId());
+ StringBuffer response = new StringBuffer();
+
+ msoLogger.info(MessageEnum.RA_SEND_REQUEST_SDNC, rt.toString(), "SDNC", "");
+ msoLogger.debug("SDNC Request Body:\n" + sdncReqBody);
+
+ try {
+
+ url = new URL(rt.getSdncUrl());
+
+ con = (HttpURLConnection) url.openConnection();
+ con.setConnectTimeout(Integer.parseInt(SDNCAdapterPortTypeImpl.getProperty(Constants.SDNC_CONNECTTIME_PROP, "2000",msoPropertiesFactoryp)));
+ con.setReadTimeout(Integer.parseInt(rt.getTimeout()));
+ con.setRequestProperty("Accept", "application/yang.data+xml"); //for response in xml
+ String userCredentials = msoPropertiesFactoryp.getMsoJavaProperties(MSO_PROP_SDNC_ADAPTER).getEncryptedProperty(Constants.SDNC_AUTH_PROP, Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY);
+
+ String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
+ con.setRequestProperty ("Authorization", basicAuth);
+ con.setRequestMethod(rt.getReqMethod());
+
+ // Add request headers
+ if ("POST".equals(rt.getReqMethod()) || "PUT".equals(rt.getReqMethod()))
+ {
+ con.setRequestProperty("Content-type", "application/xml");
+ con.setRequestProperty("Content-length",String.valueOf(sdncReqBody.length()));
+ con.setDoOutput(true);
+ out = new DataOutputStream(con.getOutputStream());
+ out.writeBytes(sdncReqBody);
+ out.flush();
+ out.close();
+ }
+
+ //Get response
+ sdncResp.setRespCode(con.getResponseCode());
+ sdncResp.setRespMsg(con.getResponseMessage());
+
+ in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+
+ String inputLine;
+ //Not parsing the response -it contains a responseHdr section and data section
+ while ((inputLine = in.readLine()) != null) {
+ response.append(inputLine);
+ }
+ in.close();
+
+ sdncResp.setSdncRespXml(response.toString());
+ msoLogger.info(MessageEnum.RA_RESPONSE_FROM_SDNC, sdncResp.toString(), "SDNC", "");
+ return(sdncResp);
+ }
+ catch (Exception e)
+ {
+ msoLogger.error(MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC, "SDNC", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception processing request to SDNC", e);
+ //default
+ sdncResp.setRespCode(HttpURLConnection.HTTP_INTERNAL_ERROR);
+ String respMsg = "Error processing request to SDNC. ";
+ String sdncErrMsg = null;
+
+ if (e instanceof java.net.SocketTimeoutException )
+ {
+ sdncResp.setRespCode(HttpURLConnection.HTTP_CLIENT_TIMEOUT);
+ respMsg = "Request to SDNC timed out. ";
+ }
+ if (con != null)
+ {
+ try { //e1
+ if (con.getResponseCode() != HttpURLConnection.HTTP_OK) //seen in SocketException connection reset
+ sdncResp.setRespCode(con.getResponseCode());
+ respMsg = respMsg + con.getResponseMessage() + ". ";
+ InputStream is = con.getErrorStream();
+ if (is != null)
+ {
+ XPathFactory xpathFactory = XPathFactory.newInstance();
+ XPath xpath = xpathFactory.newXPath();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setFeature (XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ DocumentBuilder db;
+ Document doc = null;
+ try { //e2
+ db = dbf.newDocumentBuilder();
+ doc = db.parse(is);
+ NodeList errors = (NodeList)xpath.evaluate("errors/error", doc, XPathConstants.NODESET);
+ for (int i = 0; i < errors.getLength(); i++)
+ {
+ Element error = (Element) errors.item(i);
+ String eType = null;
+ try {
+ eType = xpath.evaluate("error-type", error);
+ sdncErrMsg = ". SDNC Returned-[error-type:" + eType;
+ } catch (Exception e3) {
+ msoLogger.error (MessageEnum.RA_EVALUATE_XPATH_ERROR, "error-type", error.toString(), "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception while evaluate xpath", e3);
+ }
+
+ String eTag = null;
+ try {
+ eTag = xpath.evaluate( "error-tag", error);
+ sdncErrMsg = sdncErrMsg + ", error-tag:" + eTag;
+ } catch (Exception e3) {
+ msoLogger.error (MessageEnum.RA_EVALUATE_XPATH_ERROR, "error-tag", error.toString(), "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception while evaluate xpath", e3);
+ }
+
+ String eMsg = null;
+ try {
+ eMsg = xpath.evaluate("error-message", error);
+ sdncErrMsg = sdncErrMsg + ", error-message:" + eMsg + "]";
+ } catch (Exception e3) {
+ msoLogger.error (MessageEnum.RA_EVALUATE_XPATH_ERROR, "error-message", error.toString(), "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception while evaluate xpath", e3);
+ }
+ }
+ } catch (Exception e2) {
+ msoLogger.error (MessageEnum.RA_ANALYZE_ERROR_EXC, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception while analyse error", e2);
+ }
+ } //is != null
+ } catch (Exception e1) {
+ msoLogger.error (MessageEnum.RA_ERROR_GET_RESPONSE_SDNC, "SDNC", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception while get SDNC response", e1);
+ }
+ } //con != null
+
+ if (e.getMessage() != null) {
+ respMsg = respMsg + e.getMessage();
+ }
+ if (sdncErrMsg != null) {
+ respMsg = respMsg + sdncErrMsg;
+ }
+
+ sdncResp.setRespMsg(respMsg);
+
+ msoLogger.error(MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC, "SDNC", "", MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with SDNC", e);
+ alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, respMsg);
+ return(sdncResp);
+ }
+ finally
+ {
+ if (con != null) {
+ con.disconnect();
+ }
+ }
+ }
+
+ public static void sendRespToBpel(String bpelUrl, SDNCResponse sdncResp,MsoPropertiesFactory msoPropertiesFactoryp)
+ {
+ String error;
+ try
+ {
+ SDNCAdapterCallbackRequest cbReq = new SDNCAdapterCallbackRequest();
+ cbReq.setCallbackHeader(new CallbackHeader(sdncResp.getReqId(), Integer.toString(sdncResp.getRespCode()), sdncResp.getRespMsg()));
+ if (sdncResp.getSdncRespXml() != null)
+ {
+ cbReq.setRequestData(sdncResp.getSdncRespXml());
+ }
+ msoLogger.info(MessageEnum.RA_CALLBACK_BPEL, cbReq.toString(), "Camunda", "");
+
+ URL wsdlUrl = null;
+ try {
+ wsdlUrl = new URL (bpelUrl);
+ } catch (MalformedURLException e1) {
+ error = "Caught exception initializing Callback wsdl " + e1.getMessage();
+ msoLogger.error(MessageEnum.RA_INIT_CALLBACK_WSDL_ERR, "Camunda", "", MsoLogger.ErrorCode.DataError, "Exception initializing Callback wsdl", e1);
+ alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, error);
+ }
+
+ SDNCCallbackAdapterService cbSvc = new SDNCCallbackAdapterService();
+
+ SDNCCallbackAdapterPortType cbPort = cbSvc.getSDNCCallbackAdapterSoapHttpPort();
+
+ BindingProvider bp = (BindingProvider)cbPort;
+
+ bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, wsdlUrl.toExternalForm());
+
+ //authentication
+ try
+ {
+ Map<String, Object> req_ctx = bp.getRequestContext();
+ Map<String, List<String>> headers = new HashMap<String, List<String>>();
+ String userCredentials = msoPropertiesFactoryp.getMsoJavaProperties(MSO_PROP_SDNC_ADAPTER).getEncryptedProperty(Constants.BPEL_AUTH_PROP, Constants.DEFAULT_BPEL_AUTH, Constants.ENCRYPTION_KEY);
+
+ String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
+ req_ctx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
+ headers.put ("Authorization", Collections.singletonList(basicAuth));
+ }
+ catch (Exception e2) {
+ error = "Unable to set authorization in callback request " + e2.getMessage();
+ msoLogger.error(MessageEnum.RA_SET_CALLBACK_AUTH_EXC, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Unable to set authorization in callback request", e2);
+ alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, error);
+ }
+
+ msoLogger.debug("Invoking Bpel Callback. BpelCallbackUrl:" + bpelUrl);
+ cbPort.sdncAdapterCallback(cbReq);
+
+ }
+ catch (Exception e)
+ {
+ error = "Error sending BpelCallback request" + e.getMessage();
+ msoLogger.error(MessageEnum.RA_CALLBACK_BPEL_EXC, "Camunda", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception sending BpelCallback request", e);
+ alarmLogger.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, error);
+ }
+ msoLogger.info(MessageEnum.RA_CALLBACK_BPEL_COMPLETE, "Camunda", "");
+ return;
+ }
+
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Utils.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Utils.java
new file mode 100644
index 0000000000..345d0a015c
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Utils.java
@@ -0,0 +1,195 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.impl;
+
+
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.logger.MessageEnum;
+public class Utils {
+
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+
+ public static String genSdncReq(Document reqDoc, RequestTunables rt) {
+ try {
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+
+ //NewDoc for output
+ //Root
+ Document newdoc = db.newDocument();
+ Element root = newdoc.createElementNS(rt.getNamespace(), "input");
+ newdoc.appendChild(root);
+
+ //Header
+ Element hdr = newdoc.createElement(rt.getHeaderName());
+ root.appendChild(hdr);
+
+ String elemData = rt.getReqId();
+ Element hdrChild;
+ if (elemData != null && elemData.length() > 0)
+ {
+ hdrChild = newdoc.createElement("svc-request-id");
+ hdrChild.appendChild(newdoc.createTextNode(elemData));
+ hdr.appendChild(hdrChild);
+ }
+
+ elemData = rt.getAction();
+ if (elemData != null && elemData.length() > 0)
+ {
+ hdrChild = newdoc.createElement("svc-action");
+ hdrChild.appendChild(newdoc.createTextNode(elemData));
+ hdr.appendChild(hdrChild);
+ }
+
+ elemData = rt.getSdncaNotificationUrl();
+ if (elemData != null && elemData.length() > 0)
+ {
+ hdrChild = newdoc.createElement("svc-notification-url");
+ hdrChild.appendChild(newdoc.createTextNode(elemData));
+ hdr.appendChild(hdrChild);
+ }
+
+ //RequestData
+ NodeList nodes = reqDoc.getDocumentElement().getChildNodes();
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Node n = nodes.item(i);
+ Node newNode = newdoc.importNode(n, true);
+ root.appendChild(newNode);
+ }
+
+ String s = domToStr(newdoc);
+ msoLogger.debug("Formatted SdncReq:\n" + s);
+ return (s);
+
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST, "SDNC", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in genSdncReq", e);
+ }
+ return(null);
+ }
+
+ public static String genSdncPutReq(Document reqDoc, RequestTunables rt) {
+ try {
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+
+ //NewDoc for output
+ //Root
+ Document newdoc = db.newDocument();
+
+ //RequestData
+ NodeList nodes = reqDoc.getDocumentElement().getChildNodes();
+
+
+ Element root = newdoc.createElement(nodes.item(0).getNodeName());
+ newdoc.appendChild(root);
+
+ NodeList childNodes = nodes.item(0).getChildNodes();
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ Node n = childNodes.item(i);
+ Node newNode = newdoc.importNode(n, true);
+ root.appendChild(newNode);
+ }
+
+ String s = domToStr(newdoc);
+ msoLogger.debug("Formatted SdncPutReq:\n" + s);
+ return (s);
+
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception in genSdncPutReq", e);
+ }
+ return(null);
+ }
+
+ public static String genMsoFailResp(SDNCResponse resp) {
+ try {
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+
+ //NewDoc for output
+ //Root
+ Document newdoc = db.newDocument();
+ Element root = newdoc.createElement("output");
+ newdoc.appendChild(root);
+
+ Element elem1 = newdoc.createElement("svc-request-id");
+ elem1.appendChild(newdoc.createTextNode(resp.getReqId()));
+ root.appendChild(elem1);
+
+ Element elem2 = newdoc.createElement("response-code");
+ elem2.appendChild(newdoc.createTextNode(String.valueOf(resp.getRespCode())));
+ root.appendChild(elem2);
+
+ Element elem3 = newdoc.createElement("response-message");
+ elem3.appendChild(newdoc.createTextNode(String.valueOf(resp.getRespMsg())));
+ root.appendChild(elem3);
+
+ String s = domToStr(newdoc);
+ msoLogger.debug("Formatted SdncReq:" + s);
+ return (s);
+
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.RA_ERROR_CREATE_SDNC_RESPONSE, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception in genMsoFailResp", e);
+ }
+ return(null);
+ }
+
+
+ public static String domToStr(Document doc)
+ {
+ if (doc != null)
+ {
+ try {
+ DOMSource ds = new DOMSource(doc);
+ StringWriter sw = new StringWriter();
+ StreamResult sr = new StreamResult(sw);
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Transformer t = tf.newTransformer();
+ //t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");//<?xml version="1.0" encoding="UTF-8"?>
+ t.transform(ds, sr);
+ String s = sw.toString();
+
+ // This is an awful fix for now but we don't want that xmlns="" to be generated
+ s = s.replaceAll("xmlns=\"\"", "");
+ return(s);
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.RA_ERROR_CONVERT_XML2STR, "", "", MsoLogger.ErrorCode.DataError, "Exception - domToStr", e);
+ }
+ }
+ return(null);
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResource.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResource.java
new file mode 100644
index 0000000000..68f31f103f
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResource.java
@@ -0,0 +1,200 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.notify;
+
+
+import java.io.StringReader;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+import javax.ejb.EJB;
+
+import org.openecomp.mso.utils.UUIDChecker;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import org.openecomp.mso.adapters.sdnc.impl.Constants;
+import org.openecomp.mso.adapters.sdnc.impl.SDNCAdapterPortTypeImpl;
+import org.openecomp.mso.adapters.sdnc.impl.SDNCResponse;
+import org.openecomp.mso.adapters.sdnc.impl.SDNCRestClient;
+import org.openecomp.mso.adapters.sdnc.util.SDNCRequestIdUtil;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+import org.openecomp.mso.logger.MessageEnum;
+
+//SDNC to SDNC Async Notifcations
+@Path("/")
+public class SDNCNotifyResource {
+
+ private MsoPropertiesFactory msoPropertiesFactory=new MsoPropertiesFactory();
+
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
+
+ @GET()
+ public Response printMessage () {
+ long startTime = System.currentTimeMillis ();
+ UUIDChecker.generateUUID (msoLogger);
+ String result = "SDNCAdapter Rest services";
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+ return Response.status (HttpServletResponse.SC_OK).entity (result).build ();
+
+ }
+
+ @GET()
+ @Path("/{param}")
+ public Response printMessageParam (@PathParam("param") String msg) {
+ long startTime = System.currentTimeMillis ();
+ UUIDChecker.generateUUID (msoLogger);
+ String result = "SDNCAdapter Rest services : " + msg;
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+ return Response.status (HttpServletResponse.SC_OK).entity (result).build ();
+
+ }
+
+ @POST
+ @Path("/SDNCNotify")
+ @Consumes("application/xml")
+ @Produces("application/xml")
+ public Response SDNCNotify (String reqXML, @Context HttpServletRequest request) {
+
+ XPathFactory xpathFactory = XPathFactory.newInstance ();
+ XPath xpath = xpathFactory.newXPath ();
+ long startTime = System.currentTimeMillis ();
+
+ msoLogger.info (MessageEnum.RA_RECEIVE_SDNC_NOTIF, reqXML, "SDNC", "SDNCNotify");
+
+ InputSource source = new InputSource (new StringReader (reqXML));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance ();
+
+ DocumentBuilder db;
+
+ try {
+ dbf.setFeature (XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ db = dbf.newDocumentBuilder ();
+ } catch (ParserConfigurationException e) {
+ msoLogger.error (MessageEnum.RA_PARSING_REQUEST_ERROR, "SDNC", "SDNCNotify", MsoLogger.ErrorCode.SchemaError, "Exception - Invalid XML request format", e);
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, "Invalid XML request format");
+ return Response.status (HttpServletResponse.SC_BAD_REQUEST).entity ("Invalid XML request format").build ();
+ }
+
+ Document doc = null;
+ try {
+ doc = db.parse (source);
+ } catch (Exception e) {
+ msoLogger.error (MessageEnum.RA_PARSING_REQUEST_ERROR, "SDNC", "SDNCNotify", MsoLogger.ErrorCode.SchemaError, "Exception - Invalid XML request format", e);
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, "Invalid XML request format");
+ return Response.status (HttpServletResponse.SC_BAD_REQUEST).entity ("Invalid XML request format").build ();
+ }
+
+ try {
+ NodeList nl = (NodeList) xpath.evaluate (Constants.SDNC_SVCCFGRESP_ROOT, doc, XPathConstants.NODESET);
+ if (nl.getLength () <= 0) {
+ msoLogger.error (MessageEnum.RA_MISSING_PARAM, Constants.SDNC_SVCCFGRESP_ROOT, "SDNC", "SDNCNotify", MsoLogger.ErrorCode.DataError, "Missing param");
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, "Missing" + Constants.SDNC_SVCCFGRESP_ROOT);
+ return Response.status (HttpServletResponse.SC_BAD_REQUEST)
+ .entity ("Missing " + Constants.SDNC_SVCCFGRESP_ROOT)
+ .build ();
+ }
+ } catch (Exception e) {
+ msoLogger.error (MessageEnum.RA_MISSING_PARAM, Constants.SDNC_SVCCFGRESP_ROOT, "SDNC", "SDNCNotify", MsoLogger.ErrorCode.DataError, "Exception - Missing param", e);
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, "Missing" + Constants.SDNC_SVCCFGRESP_ROOT);
+ return Response.status (HttpServletResponse.SC_BAD_REQUEST)
+ .entity ("Missing " + Constants.SDNC_SVCCFGRESP_ROOT)
+ .build ();
+ }
+
+ String reqId;
+ try {
+ reqId = xpath.evaluate (Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_REQ_ID, doc);
+ } catch (Exception e) {
+ msoLogger.error (MessageEnum.RA_MISSING_PARAM, Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_REQ_ID, "SDNC", "SDNCNotify", MsoLogger.ErrorCode.DataError, "Exception - Missing param", e);
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, "Missing" + Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_REQ_ID);
+ return Response.status (HttpServletResponse.SC_BAD_REQUEST)
+ .entity ("Missing " + Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_REQ_ID)
+ .build ();
+ }
+
+ MsoLogger.setLogContext (SDNCRequestIdUtil.getSDNCOriginalRequestId (reqId), "");
+
+ String respCode;
+ try {
+ respCode = xpath.evaluate (Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_RESP_CODE, doc);
+ } catch (Exception e) {
+ msoLogger.error (MessageEnum.RA_MISSING_PARAM,
+ Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_RESP_CODE, "SDNC", "SDNCNotify", MsoLogger.ErrorCode.DataError, "Exception - Missing param",
+ e);
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, "Missing" + Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_RESP_CODE);
+ return Response.status (HttpServletResponse.SC_BAD_REQUEST)
+ .entity ("Missing" + Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_RESP_CODE)
+ .build ();
+ }
+
+ String respMsg = "";
+ try {
+ respMsg = xpath.evaluate (Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_RESP_MSG, doc);
+ } catch (Exception e) {
+ msoLogger.error (MessageEnum.RA_MISSING_PARAM, Constants.SDNC_SVCCFGRESP_ROOT + Constants.SDNC_RESP_MSG, "SDNC", "SDNCNotify", MsoLogger.ErrorCode.DataError, "Exception - Missing param", e);
+ }
+
+ String bpelUrl = null;
+ /*
+ * TODO Hibernate
+ * try {
+ * bpelUrl = RequestsDatabase.getBpelUrl(reqId);
+ * }
+ * catch (Exception e)
+ * {
+ * logger.error("Unable to get SDNC_CALLBACK_URL from ActiveRequests, using default for reqid:" + reqId, e);
+ * }
+ */
+ if (bpelUrl == null) {
+ bpelUrl = SDNCAdapterPortTypeImpl.getProperty (Constants.BPEL_URL_PROP, Constants.DEFAULT_BPEL_URL,msoPropertiesFactory);
+ }
+
+ SDNCResponse sdncResp = new SDNCResponse (reqId);
+ sdncResp.setRespCode (Integer.parseInt (respCode));
+ sdncResp.setRespMsg (respMsg);
+ sdncResp.setSdncRespXml (reqXML);
+ long subStartTime = System.currentTimeMillis ();
+ SDNCRestClient.sendRespToBpel (bpelUrl, sdncResp,msoPropertiesFactory);
+ msoLogger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully send request to BPMN", "BPMN", bpelUrl, null);
+
+ msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+ return Response.ok ().build ();
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/package-info.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/package-info.java
new file mode 100644
index 0000000000..58359c69b0
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/package-info.java
@@ -0,0 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://domain2.att.com/workflow/sdnc/adapter/schema/v1", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.openecomp.mso.adapters.sdnc;
+
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtil.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtil.java
new file mode 100644
index 0000000000..733cb69bd8
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtil.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.util;
+
+
+public class SDNCRequestIdUtil {
+ // Add private constructor to prevent instance creation.
+ private SDNCRequestIdUtil () {}
+
+ public static String getSDNCOriginalRequestId (String newRequestId) {
+
+ // Camunda scripts will add postfix, such as -1, -2, on the original requestID, to make sure requestID is unique while sending request to SDNC
+ // In order to use the unique requestID in logging, need to remove the postfix added by the Camunda scripts
+ // Verify whether the requestId is a valid UUID with postfix (-1, -2). If yes, it should contain 5 times char '-', since valid UUID contains 4 times '-'
+ // If the requestId is not a valid UUID with postfix, we do nothing
+ if (newRequestId.split("-").length == 6) {
+ return newRequestId.substring(0, newRequestId.lastIndexOf('-'));
+ }
+ return newRequestId;
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/SDNCAdapter.wsdl b/adapters/mso-sdnc-adapter/src/main/resources/SDNCAdapter.wsdl
new file mode 100644
index 0000000000..2f4c5ad5eb
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/resources/SDNCAdapter.wsdl
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:sdncadaptersc="http://domain2.att.com/workflow/sdnc/adapter/schema/v1"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://domain2.att.com/workflow/sdnc/adapter/wsdl/v1"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://domain2.att.com/workflow/sdnc/adapter/wsdl/v1">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://domain2.att.com/workflow/sdnc/adapter/wsdl/v1">
+ <import namespace="http://domain2.att.com/workflow/sdnc/adapter/schema/v1"
+ schemaLocation="SDNCAdapterSchema.xsd" />
+ </schema>
+ </types>
+
+ <message name="SDNCAdapterRequest">
+ <part element="sdncadaptersc:SDNCAdapterRequest" name="SDNCAdapterRequest">
+ </part>
+ </message>
+ <message name="SDNCAdapterResponse">
+ <part element="sdncadaptersc:SDNCAdapterResponse" name="SDNCAdapterResponse">
+ </part>
+ </message>
+
+ <portType name="SDNCAdapterPortType">
+ <operation name="SDNCAdapter">
+ <input message="tns:SDNCAdapterRequest" name="SDNCAdapterRequest">
+ </input>
+ <output message="tns:SDNCAdapterResponse" name="SDNCAdapterResponse">
+ </output>
+ </operation>
+ </portType>
+
+ <binding name="SDNCAdapterSoapHttpBinding" type="tns:SDNCAdapterPortType">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="SDNCAdapter">
+ <soap:operation soapAction="" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="SDNCAdapterService">
+ <port binding="tns:SDNCAdapterSoapHttpBinding" name="SDNCAdapterSoapHttpPort">
+ <soap:address location="SDNCAdapterService" />
+ </port>
+ </service>
+</definitions>
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/SDNCAdapterSchema.xsd b/adapters/mso-sdnc-adapter/src/main/resources/SDNCAdapterSchema.xsd
new file mode 100644
index 0000000000..f0e4435771
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/resources/SDNCAdapterSchema.xsd
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://domain2.att.com/workflow/sdnc/adapter/schema/v1"
+xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://domain2.att.com/workflow/sdnc/adapter/schema/v1"
+ xmlns:sdncadaptersc="http://domain2.att.com/workflow/sdnc/adapter/schema/v1"
+ elementFormDefault="qualified">
+
+
+ <!-- ========================= -->
+ <!-- Complex Types -->
+ <!-- ========================= -->
+
+
+ <!-- ========================= -->
+ <!-- Elements -->
+ <!-- ========================= -->
+
+ <element name="RequestHeader">
+ <complexType>
+ <sequence>
+ <element name="RequestId" type="string" minOccurs="1" maxOccurs="1"/>
+ <element name="SvcInstanceId" type="string" minOccurs="0" maxOccurs="1"/>
+ <element name="SvcAction" type="string" minOccurs="1" maxOccurs="1"/>
+ <element name="SvcOperation" type="string" minOccurs="1" maxOccurs="1"/>
+ <element name="CallbackUrl" type="string" minOccurs="1" maxOccurs="1"/>
+ <element name="MsoAction" type="string" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="CallbackHeader">
+ <complexType>
+ <sequence>
+ <element name="RequestId" type="string" minOccurs="1" maxOccurs="1"/>
+ <element name="ResponseCode" type="string" minOccurs="1" maxOccurs="1"/>
+ <element name="ResponseMessage" type="string" minOccurs="1" maxOccurs="1"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- ========================= -->
+ <!-- Requests/Responses -->
+ <!-- ========================= -->
+
+ <element name="SDNCAdapterRequest">
+ <complexType>
+ <sequence>
+ <element ref="tns:RequestHeader" minOccurs="1" maxOccurs="1" />
+ <element name="RequestData" type="anyType" minOccurs="1" maxOccurs="1" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Empty Ack -->
+ <element name="SDNCAdapterResponse">
+ <complexType>
+
+ </complexType>
+ </element>
+
+ <!--Used to post Async Status back to workflow, Status Message would be used for any fallouts from SDNC -->
+ <element name="SDNCAdapterCallbackRequest">
+ <complexType>
+ <sequence>
+ <element ref="tns:CallbackHeader" minOccurs="1" maxOccurs="1" />
+ <element name="RequestData" type="anyType" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </complexType>
+ </element>
+
+
+</schema>
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/SDNCCallbackAdapter.wsdl b/adapters/mso-sdnc-adapter/src/main/resources/SDNCCallbackAdapter.wsdl
new file mode 100644
index 0000000000..1429b5f1c7
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/main/resources/SDNCCallbackAdapter.wsdl
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:sdncadaptersc="http://domain2.att.com/workflow/sdnc/adapter/schema/v1"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://domain2.att.com/workflow/sdnc/adapter/callback/wsdl/v1"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://domain2.att.com/workflow/sdnc/adapter/callback/wsdl/v1">
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://domain2.att.com/workflow/sdnc/adapter/wsdl/v1">
+ <import namespace="http://domain2.att.com/workflow/sdnc/adapter/schema/v1"
+ schemaLocation="SDNCAdapterSchema.xsd" />
+ </schema>
+ </types>
+
+ <message name="SDNCAdapterCallbackRequest">
+ <part element="sdncadaptersc:SDNCAdapterCallbackRequest" name="SDNCAdapterCallbackRequest">
+ </part>
+ </message>
+
+ <message name="SDNCAdapterCallbackResponse">
+ <part element="sdncadaptersc:SDNCAdapterResponse" name="SDNCAdapterCallbackResponse">
+ </part>
+ </message>
+
+ <portType name="SDNCCallbackAdapterPortType">
+ <operation name="SDNCAdapterCallback">
+ <input message="tns:SDNCAdapterCallbackRequest" name="SDNCAdapterCallbackRequest">
+ </input>
+ <output message="tns:SDNCAdapterCallbackResponse" name="SDNCAdapterCallbackResponse">
+ </output>
+ </operation>
+ </portType>
+
+ <binding name="SDNCCallbackAdapterSoapHttpBinding" type="tns:SDNCCallbackAdapterPortType">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="SDNCAdapterCallback">
+ <soap:operation soapAction="" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="SDNCCallbackAdapterService">
+ <port binding="tns:SDNCCallbackAdapterSoapHttpBinding" name="SDNCCallbackAdapterSoapHttpPort">
+ <soap:address location="SDNCCallbackAdapterService" />
+ </port>
+ </service>
+</definitions>
diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/ObjectFactoryTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/ObjectFactoryTest.java
new file mode 100644
index 0000000000..ed3c780522
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/ObjectFactoryTest.java
@@ -0,0 +1,100 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc;
+
+import static org.junit.Assert.fail;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.nio.charset.Charset;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.junit.Test;
+
+public class ObjectFactoryTest {
+
+ private Marshaller jaxbMarshaller;
+ private Unmarshaller jaxbUnmarshaller;
+
+ /**
+ * Test method for {@link org.openecomp.mso.adapters.sdnc.ObjectFactory#createRequestHeader()}.
+ */
+ @Test
+ public final void testCreateRequestHeader () {
+ ObjectFactory of = new ObjectFactory ();
+ RequestHeader rh = of.createRequestHeader ();
+ rh.setCallbackUrl ("callback");
+ rh.setMsoAction ("action");
+ rh.setRequestId ("reqid");
+ rh.setSvcAction ("svcAction");
+ rh.setSvcInstanceId ("svcId");
+ rh.setSvcOperation ("op");
+
+ try {
+ JAXBContext jaxbContext = JAXBContext.newInstance(RequestHeader.class);
+ jaxbMarshaller = jaxbContext.createMarshaller();
+
+ JAXBContext jaxbContext2 = JAXBContext.newInstance(RequestHeader.class);
+ jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
+ }
+ catch (JAXBException e) {
+ e.printStackTrace ();
+ fail();
+ return;
+ }
+
+ StringWriter writer = new StringWriter();
+ try {
+ jaxbMarshaller.marshal (rh, writer);
+ } catch (JAXBException e) {
+ e.printStackTrace();
+ fail ();
+ }
+ String marshalled = writer.toString ();
+ assert(marshalled.contains ("<RequestId>reqid</RequestId>"));
+
+ InputStream inputStream = new ByteArrayInputStream(marshalled.getBytes(Charset.forName("UTF-8")));
+ try {
+ RequestHeader res2 = (RequestHeader) jaxbUnmarshaller.unmarshal (inputStream);
+ assert(res2.getCallbackUrl ().equals ("callback"));
+ assert(res2.getMsoAction ().equals ("action"));
+ assert(res2.getSvcOperation ().equals ("op"));
+ } catch (JAXBException e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ /**
+ * Test method for {@link org.openecomp.mso.adapters.sdnc.ObjectFactory#createSDNCAdapterResponse()}.
+ */
+ @Test
+ public final void testCreateSDNCAdapterResponse () {
+ ObjectFactory of = new ObjectFactory ();
+ SDNCAdapterResponse ar = of.createSDNCAdapterResponse ();
+ assert (ar != null);
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunablesTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunablesTest.java
new file mode 100644
index 0000000000..59e561a0a8
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunablesTest.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.impl;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.openecomp.mso.properties.MsoJavaProperties;
+import org.openecomp.mso.properties.MsoPropertiesException;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+
+public class RequestTunablesTest {
+
+ public static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
+
+ /**
+ * This method is called before any test occurs.
+ * It creates a fake tree from scratch
+ * @throws MsoPropertiesException
+ */
+ @BeforeClass
+ public static final void prepare () throws MsoPropertiesException {
+ ClassLoader classLoader = RequestTunablesTest.class.getClassLoader ();
+ String path = classLoader.getResource ("mso.properties").toString ().substring (5);
+
+ msoPropertiesFactory.initializeMsoProperties(RequestTunables.MSO_PROP_SDNC_ADAPTER, path);
+
+ }
+
+ /**
+ * Test method for
+ * {@link org.openecomp.mso.adapters.sdnc.impl.RequestTunables#RequestTunables(java.lang.String, java.lang.String, java.lang.String, java.lang.String)}
+ * .
+ */
+ @Test
+ public final void testRequestTunables () {
+ RequestTunables rt = new RequestTunables (null, null, "op", null,msoPropertiesFactory);
+ assert(rt.getReqId ().length ()==0);
+ rt = new RequestTunables ("reqId", "msoAction", null, "query",msoPropertiesFactory);
+ rt.setTunables ();
+ System.out.println(rt.toString ());
+ // assert (rt.getReqMethod ().equals ("toto"));
+ assert (rt.getTimeout () != null);
+ assert (rt.getAction ().equals ("query"));
+ assert (rt.getMsoAction ().equals ("msoAction"));
+ assert (rt.getHeaderName ().equals ("sdnc-request-header"));
+ assert (rt.getOperation ().length () == 0);
+ assert (rt.getAsyncInd ().equals ("N"));
+ assert (rt.getReqId ().equals ("reqId"));
+ }
+
+}
diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtilTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtilTest.java
new file mode 100644
index 0000000000..d296d8d347
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtilTest.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.sdnc.util;
+
+import java.util.UUID;
+import org.junit.Test;
+
+
+public class SDNCRequestIdUtilTest {
+
+ /**
+ * Test method for {@link org.openecomp.mso.adapters.sdnc.SDNCRequestIdUtil#getSDNCOriginalRequestId()}.
+ */
+ @Test
+ public final void testGetSDNCOriginalRequestId () {
+ String originalRequestId = UUID.randomUUID().toString();
+ String postfixedRequestId = originalRequestId + "-1466203712068";
+ String postfixedRequestId2 = originalRequestId + "-1466203712068-2";
+
+ assert(SDNCRequestIdUtil.getSDNCOriginalRequestId(postfixedRequestId).equals(originalRequestId));
+ assert(SDNCRequestIdUtil.getSDNCOriginalRequestId(postfixedRequestId2).equals(postfixedRequestId2));
+
+ }
+
+}
diff --git a/adapters/mso-sdnc-adapter/src/test/resources/logback-test.xml b/adapters/mso-sdnc-adapter/src/test/resources/logback-test.xml
new file mode 100644
index 0000000000..a66a1e8cd3
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/resources/logback-test.xml
@@ -0,0 +1,47 @@
+<!--
+ ============LICENSE_START=======================================================
+ ECOMP MSO
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ 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.
+ ============LICENSE_END=========================================================
+ -->
+
+<configuration >
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}||%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}||%X{Timer}|%msg%n</pattern>
+ </encoder>
+ </appender>
+
+
+ <logger name="com.att.eelf.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="trace" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
+
+ <root level="info">
+ <appender-ref ref="STDOUT" />
+ </root>
+
+
+</configuration>
diff --git a/adapters/mso-sdnc-adapter/src/test/resources/mso.properties b/adapters/mso-sdnc-adapter/src/test/resources/mso.properties
new file mode 100644
index 0000000000..5384285306
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/resources/mso.properties
@@ -0,0 +1,52 @@
+###
+# ============LICENSE_START=======================================================
+# ECOMP MSO
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+# ============LICENSE_END=========================================================
+###
+
+### SDNCURL
+###
+#EE#
+org.openecomp.mso.adapters.sdnc.sdncgeturl=https://localhost:8443/restconf/config/L3SDN-API:
+org.openecomp.mso.adapters.sdnc.sdncposturl=https://localhost:8443/restconf/operations/L3SDN-API:
+#ST#org.openecomp.mso.adapters.sdnc.sdncgeturl=https://sdncodl.mtsnjdcp1.aic.cip.att.com:8443/restconf/config/L3SDN-API:
+#ST#org.openecomp.mso.adapters.sdnc.sdncposturl=https://sdncodl.mtsnjdcp1.aic.cip.att.com:8443/restconf/operations/L3SDN-API:
+#IT#org.openecomp.mso.adapters.sdnc.sdncgeturl=https://odl.node01.it.app.sdn.labs.att.com:8443/restconf/config/L3SDN-API:
+#IT#org.openecomp.mso.adapters.sdnc.sdncposturl=https://odl.node01.it.app.sdn.labs.att.com:8443/restconf/operations/L3SDN-API:
+###
+### BPEL ASYNC CALLLBACK/NOTIFICATION URL
+###
+#EE#
+org.openecomp.mso.adapters.sdnc.bpelurl=http://localhost:8080/active-bpel/services/SDNCAdapterCallbackV1
+#ST#org.openecomp.mso.adapters.sdnc.bpelurl=http://mtsnjv9mobp01.aic.cip.att.com:8080/active-bpel/services/SDNCAdapterCallbackV1
+#IT#org.openecomp.mso.adapters.sdnc.bpelurl=http://mtanjv9mobp01.aic.cip.att.com:8080/active-bpel/services/SDNCAdapterCallbackV1
+#DV#org.openecomp.mso.adapters.sdnc.bpelurl=http://NJCDTL21RA1926.ITServices.sbc.com:8088/mockSDNCCallbackAdapterSoapHttpBinding?wsdl
+###
+### SDNC ASYNC NOTIFICATION/RESPONSE URL
+###
+#EE#
+org.openecomp.mso.adapters.sdnc.myurl=https://localhost:8443/adapters/rest/SDNCNotify
+#ST#org.openecomp.mso.adapters.sdnc.myurl=https://msojra.mtsnjdcp1.aic.cip.att.com:8443/adapters/rest/SDNCNotify
+#IT#org.openecomp.mso.adapters.sdnc.myurl=http://mtanjv9moja01.aic.cip.att.com:8080/adapters/rest/SDNCNotify
+#DV#org.openecomp.mso.adapters.sdnc.myurl=http://NJCDTL21RA1926.ITServices.sbc.com:8080/adapters/rest/SDNCNotify
+###
+org.openecomp.mso.adapters.sdnc.sdncauth=admin:admin
+org.openecomp.mso.adapters.sdnc.bpelauth=avosAdmin:jboss123
+org.openecomp.mso.adapters.sdnc.sdncconnecttime=2000
+org.openecomp.mso.adapters.sdnc.sdncreadtime=5000
+
+org.openecomp.mso.adapters.sdnc...query=toto