summaryrefslogtreecommitdiffstats
path: root/a1-adapter
diff options
context:
space:
mode:
Diffstat (limited to 'a1-adapter')
-rw-r--r--a1-adapter/a1-adapter-api/feature/pom.xml3
-rw-r--r--a1-adapter/a1-adapter-api/installer/pom.xml4
-rw-r--r--a1-adapter/a1-adapter-api/model/pom.xml116
-rw-r--r--a1-adapter/a1-adapter-api/pom.xml68
-rw-r--r--a1-adapter/a1-adapter-api/provider/pom.xml25
-rw-r--r--a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterClient.java94
-rw-r--r--a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java168
-rw-r--r--a1-adapter/features/a1-adapter-northbound/pom.xml19
-rw-r--r--a1-adapter/features/installer/pom.xml59
-rw-r--r--a1-adapter/features/pom.xml27
-rw-r--r--a1-adapter/pom.xml16
11 files changed, 280 insertions, 319 deletions
diff --git a/a1-adapter/a1-adapter-api/feature/pom.xml b/a1-adapter/a1-adapter-api/feature/pom.xml
index cc4c681e..9c7c4a63 100644
--- a/a1-adapter/a1-adapter-api/feature/pom.xml
+++ b/a1-adapter/a1-adapter-api/feature/pom.xml
@@ -19,6 +19,7 @@
~ ============LICENSE_END=======================================================
~
-->
+
<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>
@@ -37,12 +38,10 @@
<name>ccsdk-oran :: ${project.artifactId}</name>
<dependencies>
-
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a1-adapter-provider</artifactId>
<version>${project.version}</version>
</dependency>
-
</dependencies>
</project> \ No newline at end of file
diff --git a/a1-adapter/a1-adapter-api/installer/pom.xml b/a1-adapter/a1-adapter-api/installer/pom.xml
index 2e55f7d1..d7d944bf 100644
--- a/a1-adapter/a1-adapter-api/installer/pom.xml
+++ b/a1-adapter/a1-adapter-api/installer/pom.xml
@@ -19,6 +19,7 @@
~ ============LICENSE_END=======================================================
~
-->
+
<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>
@@ -42,7 +43,6 @@
</properties>
<dependencies>
-
<dependency>
<groupId>org.onap.ccsdk.oran</groupId>
<artifactId>${application.name}-feature</artifactId>
@@ -56,13 +56,11 @@
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a1-adapter-provider</artifactId>
<version>${project.version}</version>
</dependency>
-
</dependencies>
<build>
diff --git a/a1-adapter/a1-adapter-api/model/pom.xml b/a1-adapter/a1-adapter-api/model/pom.xml
index 7aa386e5..34ad93d8 100644
--- a/a1-adapter/a1-adapter-api/model/pom.xml
+++ b/a1-adapter/a1-adapter-api/model/pom.xml
@@ -19,60 +19,66 @@
~ ============LICENSE_END=======================================================
~
-->
+
<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.onap.ccsdk.parent</groupId>
- <artifactId>binding-parent</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- <relativePath />
- </parent>
- <groupId>org.onap.ccsdk.oran</groupId>
- <artifactId>a1-adapter-model</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
- <name>ccsdk-oran :: ${project.artifactId}</name>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
- <artifactId>rfc6991</artifactId>
- </dependency>
- </dependencies>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>properties-maven-plugin</artifactId>
- <versionRange>[1.0.0,)</versionRange>
- <goals>
- <goal>set-system-properties</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <execute />
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <source>8</source>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.oran</groupId>
+ <artifactId>a1-adapter-model</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <name>ccsdk-oran :: ${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>properties-maven-plugin</artifactId>
+ <versionRange>[1.0.0,)</versionRange>
+ <goals>
+ <goal>set-system-properties</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <execute/>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <source>8</source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
</project> \ No newline at end of file
diff --git a/a1-adapter/a1-adapter-api/pom.xml b/a1-adapter/a1-adapter-api/pom.xml
index c1176eb2..3ec20c35 100644
--- a/a1-adapter/a1-adapter-api/pom.xml
+++ b/a1-adapter/a1-adapter-api/pom.xml
@@ -19,36 +19,42 @@
~ ============LICENSE_END=======================================================
~
-->
+
<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.onap.ccsdk.parent</groupId>
- <artifactId>odlparent-lite</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- <relativePath />
- </parent>
- <groupId>org.onap.ccsdk.oran</groupId>
- <artifactId>a1-adapter-api</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>ccsdk-oran :: ${project.artifactId}</name>
- <properties>
- <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
- </properties>
- <modules>
- <module>model</module>
- <module>provider</module>
- <module>feature</module>
- <module>installer</module>
- </modules>
- <build>
- <plugins>
- <!-- support sonar in multi-module project -->
- <plugin>
- <groupId>org.sonarsource.scanner.maven</groupId>
- <artifactId>sonar-maven-plugin</artifactId>
- <version>${sonar-maven-plugin.version}</version>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.oran</groupId>
+ <artifactId>a1-adapter-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>ccsdk-oran :: ${project.artifactId}</name>
+
+ <properties>
+ <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
+ </properties>
+
+ <modules>
+ <module>model</module>
+ <module>provider</module>
+ <module>feature</module>
+ <module>installer</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <!-- support sonar in multi-module project -->
+ <plugin>
+ <groupId>org.sonarsource.scanner.maven</groupId>
+ <artifactId>sonar-maven-plugin</artifactId>
+ <version>${sonar-maven-plugin.version}</version>
+ </plugin>
+ </plugins>
+ </build>
</project> \ No newline at end of file
diff --git a/a1-adapter/a1-adapter-api/provider/pom.xml b/a1-adapter/a1-adapter-api/provider/pom.xml
index 15af2820..f1cb7401 100644
--- a/a1-adapter/a1-adapter-api/provider/pom.xml
+++ b/a1-adapter/a1-adapter-api/provider/pom.xml
@@ -36,14 +36,9 @@
<packaging>bundle</packaging>
<name>ccsdk-oran :: ${project.artifactId}</name>
+
<properties>
- <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
- <!-- Override the snapshot version from parent pom -->
- <ccsdk.features.version>1.0.0</ccsdk.features.version>
- <ccsdk.sli.core.version>1.0.0</ccsdk.sli.core.version>
- <ccsdk.sli.adaptors.version>1.0.0</ccsdk.sli.adaptors.version>
- <ccsdk.sli.northbound.version>1.0.0</ccsdk.sli.northbound.version>
- <ccsdk.sli.plugins.version>1.0.0</ccsdk.sli.plugins.version>
+ <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
</properties>
<dependencyManagement>
@@ -55,7 +50,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
-
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-core-artifacts</artifactId>
@@ -63,9 +57,9 @@
<type>pom</type>
<scope>import</scope>
</dependency>
-
</dependencies>
</dependencyManagement>
+
<dependencies>
<dependency>
<groupId>org.onap.ccsdk.oran</groupId>
@@ -113,7 +107,6 @@
<artifactId>utils-provider</artifactId>
<!-- <version>${sdnctl.sli.version}</version> -->
</dependency>
-
</dependencies>
<build>
@@ -144,12 +137,12 @@
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <source>8</source>
- </configuration>
- </plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <source>8</source>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
</build>
diff --git a/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterClient.java b/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterClient.java
index f1b2eaee..2cf63b3c 100644
--- a/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterClient.java
+++ b/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterClient.java
@@ -34,6 +34,9 @@ import org.slf4j.LoggerFactory;
public class A1AdapterClient {
+ private static final String PARAMETERS_PASSED_TO_SLI = "Parameters passed to SLI";
+ private static final String PARAMETERS_RETURNED_BY_SLI = "Parameters returned by SLI";
+
private static final Logger LOG = LoggerFactory.getLogger(A1AdapterClient.class);
private SvcLogicService svcLogicService = null;
@@ -51,23 +54,11 @@ public class A1AdapterClient {
Properties localProp;
localProp = MdsalHelper.toProperties(parms, serviceData);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters passed to SLI");
-
- for (Object key : localProp.keySet()) {
- String parmName = (String) key;
- String parmValue = localProp.getProperty(parmName);
-
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_PASSED_TO_SLI, localProp);
}
Properties respProps = svcLogicService.execute(module, rpc, version, mode, localProp);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters returned by SLI");
- for (Object key : respProps.keySet()) {
- String parmName = (String) key;
- String parmValue = respProps.getProperty(parmName);
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_RETURNED_BY_SLI, localProp);
}
if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) {
return respProps;
@@ -81,23 +72,11 @@ public class A1AdapterClient {
Properties localProp;
localProp = MdsalHelper.toProperties(parms, serviceData);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters passed to SLI");
-
- for (Object key : localProp.keySet()) {
- String parmName = (String) key;
- String parmValue = localProp.getProperty(parmName);
-
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_PASSED_TO_SLI, localProp);
}
Properties respProps = svcLogicService.execute(module, rpc, version, mode, localProp);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters returned by SLI");
- for (Object key : respProps.keySet()) {
- String parmName = (String) key;
- String parmValue = respProps.getProperty(parmName);
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_RETURNED_BY_SLI, localProp);
}
if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) {
return respProps;
@@ -111,23 +90,11 @@ public class A1AdapterClient {
Properties localProp;
localProp = MdsalHelper.toProperties(parms, serviceData);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters passed to SLI");
-
- for (Object key : localProp.keySet()) {
- String parmName = (String) key;
- String parmValue = localProp.getProperty(parmName);
-
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_PASSED_TO_SLI, localProp);
}
Properties respProps = svcLogicService.execute(module, rpc, version, mode, localProp);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters returned by SLI");
- for (Object key : respProps.keySet()) {
- String parmName = (String) key;
- String parmValue = respProps.getProperty(parmName);
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_RETURNED_BY_SLI, localProp);
}
if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) {
return respProps;
@@ -141,23 +108,11 @@ public class A1AdapterClient {
Properties localProp;
localProp = MdsalHelper.toProperties(parms, serviceData);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters passed to SLI");
-
- for (Object key : localProp.keySet()) {
- String parmName = (String) key;
- String parmValue = localProp.getProperty(parmName);
-
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_PASSED_TO_SLI, localProp);
}
Properties respProps = svcLogicService.execute(module, rpc, version, mode, localProp);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters returned by SLI");
- for (Object key : respProps.keySet()) {
- String parmName = (String) key;
- String parmValue = respProps.getProperty(parmName);
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_RETURNED_BY_SLI, localProp);
}
if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) {
return respProps;
@@ -171,23 +126,11 @@ public class A1AdapterClient {
Properties localProp;
localProp = MdsalHelper.toProperties(parms, serviceData);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters passed to SLI");
-
- for (Object key : localProp.keySet()) {
- String parmName = (String) key;
- String parmValue = localProp.getProperty(parmName);
-
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_PASSED_TO_SLI, localProp);
}
Properties respProps = svcLogicService.execute(module, rpc, version, mode, localProp);
if (LOG.isDebugEnabled()) {
- LOG.debug("Parameters returned by SLI");
- for (Object key : respProps.keySet()) {
- String parmName = (String) key;
- String parmValue = respProps.getProperty(parmName);
- LOG.debug(parmName + " = " + parmValue);
- }
+ logParameters(PARAMETERS_RETURNED_BY_SLI, localProp);
}
if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) {
return respProps;
@@ -195,4 +138,15 @@ public class A1AdapterClient {
MdsalHelper.toBuilder(respProps, serviceData);
return respProps;
}
+
+ private void logParameters(String message, Properties localProp) {
+ LOG.debug(message);
+
+ for (Object key : localProp.keySet()) {
+ String parmName = (String) key;
+ String parmValue = localProp.getProperty(parmName);
+
+ LOG.debug("{}={}", parmName, parmValue);
+ }
+ }
}
diff --git a/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java b/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java
index 369f583b..e1c151a3 100644
--- a/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java
+++ b/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java
@@ -65,6 +65,17 @@ import org.slf4j.LoggerFactory;
@SuppressWarnings("squid:S1874") // "@Deprecated" code should not be used
public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
+ private static final String A1_ADAPTER_API = "A1-ADAPTER-API";
+ private static final String RESPONSE_BODY = "responseBody";
+ private static final String RESPONSE_CODE = "response-code";
+ private static final String SYNC = "sync";
+
+ private static final String ADDING_INPUT_DATA_MESSAGE = "Adding INPUT data for {} input: {}";
+ private static final String A1_ADAPTER_CLIENT_GRAPH_MESSAGE = "A1AdapterClient has a Directed Graph for '{}'";
+ private static final String SERVICE_EXCEPTION_MESSAGE = "Caught exception executing service logic for {}, {}";
+ private static final String NO_SERVICE_LOGIC_ACTIVE_MESSAGE = "No service logic active for A1Adapter: '{}'";
+ private static final String LOOKUP_SERVICE_LOGIC_EXCEPTION_MESSAGE = "Caught exception looking for service logic, {}";
+
private static final Logger log = LoggerFactory.getLogger(A1AdapterProvider.class);
private static final String APPLICATION_NAME = "a1Adapter-api";
@@ -113,35 +124,28 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
Properties parms = new Properties();
DeleteA1PolicyOutputBuilder deleteResponse = new DeleteA1PolicyOutputBuilder();
// add input to parms
- log.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ log.info(ADDING_INPUT_DATA_MESSAGE, svcOperation, input);
DeleteA1PolicyInputBuilder inputBuilder = new DeleteA1PolicyInputBuilder(input);
MdsalHelper.toProperties(parms, inputBuilder.build());
- log.info("Printing SLI parameters to be passed");
- // iterate properties file to get key-value pairs
- for (String key : parms.stringPropertyNames()) {
- String value = parms.getProperty(key);
- log.info("The SLI parameter in " + key + " is: " + value);
- }
+ logSliParameters(parms);
// Call SLI sync method
try {
- if (a1AdapterClient.hasGraph("A1-ADAPTER-API", svcOperation, null, "sync")) {
- log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
+ if (a1AdapterClient.hasGraph(A1_ADAPTER_API, svcOperation, null, SYNC)) {
+ log.info(A1_ADAPTER_CLIENT_GRAPH_MESSAGE, svcOperation);
try {
- Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", deleteResponse, parms);
- log.info("responseBody::"+responseParms.getProperty("responseBody"));
- log.info("responseCode::"+responseParms.getProperty("response-code"));
- log.info("responseMessage::"+responseParms.getProperty("response-message"));
- deleteResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty("response-code")));
+ Properties responseParms = a1AdapterClient.execute(A1_ADAPTER_API, svcOperation, null, SYNC, deleteResponse, parms);
+ logResponse(responseParms);
+ deleteResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty(RESPONSE_CODE)));
} catch (Exception e) {
- log.error("Caught exception executing service logic for " + svcOperation, e);
+ log.error(SERVICE_EXCEPTION_MESSAGE, svcOperation, e.getMessage());
deleteResponse.setHttpStatus(500);
}
} else {
- log.error("No service logic active for A1Adapter: '" + svcOperation + "'");
+ log.error(NO_SERVICE_LOGIC_ACTIVE_MESSAGE, svcOperation);
deleteResponse.setHttpStatus(503);
}
} catch (Exception e) {
- log.error("Caught exception looking for service logic", e);
+ log.error(LOOKUP_SERVICE_LOGIC_EXCEPTION_MESSAGE, e.getMessage());
deleteResponse.setHttpStatus(500);
}
RpcResult<DeleteA1PolicyOutput> rpcResult =
@@ -157,36 +161,29 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
Properties parms = new Properties();
GetA1PolicyOutputBuilder policyResponse = new GetA1PolicyOutputBuilder();
// add input to parms
- log.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ log.info(ADDING_INPUT_DATA_MESSAGE, svcOperation, input);
GetA1PolicyInputBuilder inputBuilder = new GetA1PolicyInputBuilder(input);
MdsalHelper.toProperties(parms, inputBuilder.build());
- log.info("Printing SLI parameters to be passed");
- // iterate properties file to get key-value pairs
- for (String key : parms.stringPropertyNames()) {
- String value = parms.getProperty(key);
- log.info("The SLI parameter in " + key + " is: " + value);
- }
+ logSliParameters(parms);
// Call SLI sync method
try {
- if (a1AdapterClient.hasGraph("A1-ADAPTER-API", svcOperation, null, "sync")) {
- log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
+ if (a1AdapterClient.hasGraph(A1_ADAPTER_API, svcOperation, null, SYNC)) {
+ log.info(A1_ADAPTER_CLIENT_GRAPH_MESSAGE, svcOperation);
try {
- Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", policyResponse, parms);
- log.info("responseBody::"+responseParms.getProperty("responseBody"));
- policyResponse.setBody(responseParms.getProperty("responseBody"));
- log.info("responseCode::"+responseParms.getProperty("response-code"));
- log.info("responseMessage::"+responseParms.getProperty("response-message"));
- policyResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty("response-code")));
+ Properties responseParms = a1AdapterClient.execute(A1_ADAPTER_API, svcOperation, null, SYNC, policyResponse, parms);
+ logResponse(responseParms);
+ policyResponse.setBody(responseParms.getProperty(RESPONSE_BODY));
+ policyResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty(RESPONSE_CODE)));
} catch (Exception e) {
- log.error("Caught exception executing service logic for " + svcOperation, e);
+ log.error(SERVICE_EXCEPTION_MESSAGE, svcOperation, e.getMessage());
policyResponse.setHttpStatus(500);
}
} else {
- log.error("No service logic active for A1Adapter: '" + svcOperation + "'");
+ log.error(NO_SERVICE_LOGIC_ACTIVE_MESSAGE, svcOperation);
policyResponse.setHttpStatus(503);
}
} catch (Exception e) {
- log.error("Caught exception looking for service logic", e);
+ log.error(LOOKUP_SERVICE_LOGIC_EXCEPTION_MESSAGE, e.getMessage());
policyResponse.setHttpStatus(500);
}
RpcResult<GetA1PolicyOutput> rpcResult =
@@ -202,36 +199,29 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
Properties parms = new Properties();
GetA1PolicyStatusOutputBuilder policyStatusResponse = new GetA1PolicyStatusOutputBuilder();
// add input to parms
- log.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ log.info(ADDING_INPUT_DATA_MESSAGE, svcOperation, input);
GetA1PolicyStatusInputBuilder inputBuilder = new GetA1PolicyStatusInputBuilder(input);
MdsalHelper.toProperties(parms, inputBuilder.build());
- log.info("Printing SLI parameters to be passed");
- // iterate properties file to get key-value pairs
- for (String key : parms.stringPropertyNames()) {
- String value = parms.getProperty(key);
- log.info("The SLI parameter in " + key + " is: " + value);
- }
+ logSliParameters(parms);
// Call SLI sync method
try {
- if (a1AdapterClient.hasGraph("A1-ADAPTER-API", svcOperation, null, "sync")) {
- log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
+ if (a1AdapterClient.hasGraph(A1_ADAPTER_API, svcOperation, null, SYNC)) {
+ log.info(A1_ADAPTER_CLIENT_GRAPH_MESSAGE, svcOperation);
try {
- Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", policyStatusResponse, parms);
- log.info("responseBody::"+responseParms.getProperty("responseBody"));
- policyStatusResponse.setBody(responseParms.getProperty("responseBody"));
- log.info("responseCode::"+responseParms.getProperty("response-code"));
- log.info("responseMessage::"+responseParms.getProperty("response-message"));
- policyStatusResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty("response-code")));
+ Properties responseParms = a1AdapterClient.execute(A1_ADAPTER_API, svcOperation, null, SYNC, policyStatusResponse, parms);
+ logResponse(responseParms);
+ policyStatusResponse.setBody(responseParms.getProperty(RESPONSE_BODY));
+ policyStatusResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty(RESPONSE_CODE)));
} catch (Exception e) {
- log.error("Caught exception executing service logic for " + svcOperation, e);
+ log.error(SERVICE_EXCEPTION_MESSAGE, svcOperation, e.getMessage());
policyStatusResponse.setHttpStatus(500);
}
} else {
- log.error("No service logic active for A1Adapter: '" + svcOperation + "'");
+ log.error(NO_SERVICE_LOGIC_ACTIVE_MESSAGE, svcOperation);
policyStatusResponse.setHttpStatus(503);
}
} catch (Exception e) {
- log.error("Caught exception looking for service logic", e);
+ log.error(LOOKUP_SERVICE_LOGIC_EXCEPTION_MESSAGE, e.getMessage());
policyStatusResponse.setHttpStatus(500);
}
RpcResult<GetA1PolicyStatusOutput> rpcResult =
@@ -247,36 +237,29 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
Properties parms = new Properties();
GetA1PolicyTypeOutputBuilder policyTypeResponse = new GetA1PolicyTypeOutputBuilder();
// add input to parms
- log.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ log.info(ADDING_INPUT_DATA_MESSAGE, svcOperation, input);
GetA1PolicyTypeInputBuilder inputBuilder = new GetA1PolicyTypeInputBuilder(input);
MdsalHelper.toProperties(parms, inputBuilder.build());
- log.info("Printing SLI parameters to be passed");
- // iterate properties file to get key-value pairs
- for (String key : parms.stringPropertyNames()) {
- String value = parms.getProperty(key);
- log.info("The SLI parameter in " + key + " is: " + value);
- }
+ logSliParameters(parms);
// Call SLI sync method
try {
- if (a1AdapterClient.hasGraph("A1-ADAPTER-API", svcOperation, null, "sync")) {
- log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
+ if (a1AdapterClient.hasGraph(A1_ADAPTER_API, svcOperation, null, SYNC)) {
+ log.info(A1_ADAPTER_CLIENT_GRAPH_MESSAGE, svcOperation);
try {
- Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", policyTypeResponse, parms);
- log.info("responseBody::"+responseParms.getProperty("responseBody"));
- policyTypeResponse.setBody(responseParms.getProperty("responseBody"));
- log.info("responseCode::"+responseParms.getProperty("response-code"));
- log.info("responseMessage::"+responseParms.getProperty("response-message"));
- policyTypeResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty("response-code")));
+ Properties responseParms = a1AdapterClient.execute(A1_ADAPTER_API, svcOperation, null, SYNC, policyTypeResponse, parms);
+ logResponse(responseParms);
+ policyTypeResponse.setBody(responseParms.getProperty(RESPONSE_BODY));
+ policyTypeResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty(RESPONSE_CODE)));
} catch (Exception e) {
- log.error("Caught exception executing service logic for " + svcOperation, e);
+ log.error(SERVICE_EXCEPTION_MESSAGE, svcOperation, e.getMessage());
policyTypeResponse.setHttpStatus(500);
}
} else {
- log.error("No service logic active for A1Adapter: '" + svcOperation + "'");
+ log.error(NO_SERVICE_LOGIC_ACTIVE_MESSAGE, svcOperation);
policyTypeResponse.setHttpStatus(503);
}
} catch (Exception e) {
- log.error("Caught exception looking for service logic", e);
+ log.error(LOOKUP_SERVICE_LOGIC_EXCEPTION_MESSAGE, e.getMessage());
policyTypeResponse.setHttpStatus(500);
}
RpcResult<GetA1PolicyTypeOutput> rpcResult =
@@ -292,36 +275,29 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
Properties parms = new Properties();
PutA1PolicyOutputBuilder policyResponse = new PutA1PolicyOutputBuilder();
// add input to parms
- log.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ log.info(ADDING_INPUT_DATA_MESSAGE, svcOperation, input);
PutA1PolicyInputBuilder inputBuilder = new PutA1PolicyInputBuilder(input);
MdsalHelper.toProperties(parms, inputBuilder.build());
- log.info("Printing SLI parameters to be passed");
- // iterate properties file to get key-value pairs
- for (String key : parms.stringPropertyNames()) {
- String value = parms.getProperty(key);
- log.info("The SLI parameter in " + key + " is: " + value);
- }
+ logSliParameters(parms);
// Call SLI sync method
try {
- if (a1AdapterClient.hasGraph("A1-ADAPTER-API", svcOperation, null, "sync")) {
- log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
+ if (a1AdapterClient.hasGraph(A1_ADAPTER_API, svcOperation, null, SYNC)) {
+ log.info(A1_ADAPTER_CLIENT_GRAPH_MESSAGE, svcOperation);
try {
- Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", policyResponse, parms);
- log.info("responseBody::"+responseParms.getProperty("responseBody"));
- policyResponse.setBody(responseParms.getProperty("responseBody"));
- log.info("responseCode::"+responseParms.getProperty("response-code"));
- log.info("responseMessage::"+responseParms.getProperty("response-message"));
- policyResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty("response-code")));
+ Properties responseParms = a1AdapterClient.execute(A1_ADAPTER_API, svcOperation, null, SYNC, policyResponse, parms);
+ logResponse(responseParms);
+ policyResponse.setBody(responseParms.getProperty(RESPONSE_BODY));
+ policyResponse.setHttpStatus(Integer.valueOf(responseParms.getProperty(RESPONSE_CODE)));
} catch (Exception e) {
- log.error("Caught exception executing service logic for " + svcOperation, e);
+ log.error(SERVICE_EXCEPTION_MESSAGE, svcOperation, e.getMessage());
policyResponse.setHttpStatus(500);
}
} else {
- log.error("No service logic active for A1Adapter: '" + svcOperation + "'");
+ log.error(NO_SERVICE_LOGIC_ACTIVE_MESSAGE, svcOperation);
policyResponse.setHttpStatus(503);
}
} catch (Exception e) {
- log.error("Caught exception looking for service logic", e);
+ log.error(LOOKUP_SERVICE_LOGIC_EXCEPTION_MESSAGE, e.getMessage());
policyResponse.setHttpStatus(500);
}
RpcResult<PutA1PolicyOutput> rpcResult =
@@ -330,4 +306,18 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
return Futures.immediateFuture(rpcResult);
}
+ private void logSliParameters(Properties parms) {
+ log.info("Printing SLI parameters to be passed");
+ // iterate properties file to get key-value pairs
+ for (String key : parms.stringPropertyNames()) {
+ String value = parms.getProperty(key);
+ log.info("The SLI parameter in {} is: {}", key, value);
+ }
+ }
+
+ private void logResponse(Properties responseParms) {
+ log.info("responseBody::{}", responseParms.getProperty(RESPONSE_BODY));
+ log.info("responseCode::{}", responseParms.getProperty(RESPONSE_CODE));
+ log.info("responseMessage::{}", responseParms.getProperty("response-message"));
+ }
}
diff --git a/a1-adapter/features/a1-adapter-northbound/pom.xml b/a1-adapter/features/a1-adapter-northbound/pom.xml
index 57d82cc2..a0ee8260 100644
--- a/a1-adapter/features/a1-adapter-northbound/pom.xml
+++ b/a1-adapter/features/a1-adapter-northbound/pom.xml
@@ -19,27 +19,30 @@
~ ============LICENSE_END=======================================================
~
-->
+
<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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>single-feature-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
<relativePath/>
- </parent>
+ </parent>
<groupId>org.onap.ccsdk.oran</groupId>
<artifactId>a1-adapter-northbound</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>feature</packaging>
+
<name>ccsdk-oran :: ${project.artifactId}</name>
+
<dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.oran</groupId>
- <artifactId>a1-adapter-feature</artifactId>
+ <dependency>
+ <groupId>org.onap.ccsdk.oran</groupId>
+ <artifactId>a1-adapter-feature</artifactId>
<version>${project.version}</version>
<type>xml</type>
<classifier>features</classifier>
- </dependency>
- </dependencies>
+ </dependency>
+ </dependencies>
</project> \ No newline at end of file
diff --git a/a1-adapter/features/installer/pom.xml b/a1-adapter/features/installer/pom.xml
index f83849ee..230a5f91 100644
--- a/a1-adapter/features/installer/pom.xml
+++ b/a1-adapter/features/installer/pom.xml
@@ -19,47 +19,48 @@
~ ============LICENSE_END=======================================================
~
-->
+
<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>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
+ <parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
<version>2.0.1-SNAPSHOT</version>
<relativePath/>
</parent>
- <groupId>org.onap.ccsdk.oran</groupId>
- <artifactId>a1-adapter-northbound-installer</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ <groupId>org.onap.ccsdk.oran</groupId>
+ <artifactId>a1-adapter-northbound-installer</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <name>ccsdk-oran :: ${project.artifactId}</name>
+ <name>ccsdk-oran :: ${project.artifactId}</name>
- <properties>
- <application.name>a1-adapter-northbound</application.name>
- <features.boot>${application.name}</features.boot>
- <features.repositories>mvn:org.onap.ccsdk.oran/${features.boot}/${project.version}/xml/features</features.repositories>
- <include.transitive.dependencies>false</include.transitive.dependencies>
- </properties>
+ <properties>
+ <application.name>a1-adapter-northbound</application.name>
+ <features.boot>${application.name}</features.boot>
+ <features.repositories>mvn:org.onap.ccsdk.oran/${features.boot}/${project.version}/xml/features</features.repositories>
+ <include.transitive.dependencies>false</include.transitive.dependencies>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.oran</groupId>
- <artifactId>${application.name}</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>features</classifier>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.ccsdk.oran</groupId>
+ <artifactId>${application.name}</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
- <build>
+ <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/a1-adapter/features/pom.xml b/a1-adapter/features/pom.xml
index 5efa09c7..18efc2b9 100644
--- a/a1-adapter/features/pom.xml
+++ b/a1-adapter/features/pom.xml
@@ -19,24 +19,25 @@
~ ============LICENSE_END=======================================================
~
-->
+
<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>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.ccsdk.parent</groupId>
- <artifactId>odlparent-lite</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- <relativePath/>
- </parent>
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
- <groupId>org.onap.ccsdk.oran</groupId>
- <artifactId>ccsdk-a1-adapter-feature-aggregator</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ <groupId>org.onap.ccsdk.oran</groupId>
+ <artifactId>ccsdk-a1-adapter-feature-aggregator</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <name>ccsdk-oran :: ${project.artifactId}</name>
+ <name>ccsdk-oran :: ${project.artifactId}</name>
- <modules>
+ <modules>
<module>a1-adapter-northbound</module>
<module>installer</module>
</modules>
diff --git a/a1-adapter/pom.xml b/a1-adapter/pom.xml
index c3ecfe9d..83532721 100644
--- a/a1-adapter/pom.xml
+++ b/a1-adapter/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ ============LICENSE_START=======================================================
~ ONAP : ccsdk oran
@@ -18,17 +19,26 @@
~ ============LICENSE_END=======================================================
~
-->
+
<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.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
<groupId>org.onap.ccsdk.oran</groupId>
<artifactId>ccsdk-a1-adapter</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>ccsdk-oran :: ${project.artifactId}</name>
+
<modules>
- <module>a1-adapter-api</module>
- <module>features</module>
- </modules>
+ <module>a1-adapter-api</module>
+ <module>features</module>
+ </modules>
</project> \ No newline at end of file