aboutsummaryrefslogtreecommitdiffstats
path: root/a1-adapter/a1-adapter-api
diff options
context:
space:
mode:
Diffstat (limited to 'a1-adapter/a1-adapter-api')
-rw-r--r--a1-adapter/a1-adapter-api/pom.xml6
-rw-r--r--a1-adapter/a1-adapter-api/provider/pom.xml10
-rw-r--r--a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java42
-rw-r--r--a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java5
4 files changed, 39 insertions, 24 deletions
diff --git a/a1-adapter/a1-adapter-api/pom.xml b/a1-adapter/a1-adapter-api/pom.xml
index 2ee6b43f..c1176eb2 100644
--- a/a1-adapter/a1-adapter-api/pom.xml
+++ b/a1-adapter/a1-adapter-api/pom.xml
@@ -34,12 +34,6 @@
<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>
</properties>
<modules>
<module>model</module>
diff --git a/a1-adapter/a1-adapter-api/provider/pom.xml b/a1-adapter/a1-adapter-api/provider/pom.xml
index 8f1d94e8..15af2820 100644
--- a/a1-adapter/a1-adapter-api/provider/pom.xml
+++ b/a1-adapter/a1-adapter-api/provider/pom.xml
@@ -36,7 +36,15 @@
<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>
+ </properties>
<dependencyManagement>
<dependencies>
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 42cd5000..369f583b 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
@@ -61,8 +61,6 @@ import org.slf4j.LoggerFactory;
* implements the request model for the A1 interface. This class identifies the Near-RT RIC throught the IP passed over
* the payload and calls the corresponding Near-RT RIC over Rest API
*
- * <pre>
- *
*/
@SuppressWarnings("squid:S1874") // "@Deprecated" code should not be used
public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
@@ -130,8 +128,10 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
try {
Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", deleteResponse, parms);
- log.info("responseParms::"+responseParms.getProperty("body"));
- deleteResponse.setHttpStatus(200);
+ 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")));
} catch (Exception e) {
log.error("Caught exception executing service logic for " + svcOperation, e);
deleteResponse.setHttpStatus(500);
@@ -146,7 +146,7 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
}
RpcResult<DeleteA1PolicyOutput> rpcResult =
RpcResultBuilder.<DeleteA1PolicyOutput>status(true).withResult(deleteResponse.build()).build();
- log.info("End of getA1Policy");
+ log.info("End of deleteA1Policy");
return Futures.immediateFuture(rpcResult);
}
@@ -172,9 +172,11 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
try {
Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", policyResponse, parms);
- log.info("responseParms::"+responseParms.getProperty("body"));
- policyResponse.setBody(responseParms.getProperty("body"));
- policyResponse.setHttpStatus(200);
+ 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")));
} catch (Exception e) {
log.error("Caught exception executing service logic for " + svcOperation, e);
policyResponse.setHttpStatus(500);
@@ -215,9 +217,11 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
try {
Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", policyStatusResponse, parms);
- log.info("responseParms::"+responseParms.getProperty("body"));
- policyStatusResponse.setBody(responseParms.getProperty("body"));
- policyStatusResponse.setHttpStatus(200);
+ 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")));
} catch (Exception e) {
log.error("Caught exception executing service logic for " + svcOperation, e);
policyStatusResponse.setHttpStatus(500);
@@ -258,9 +262,11 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
try {
Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", policyTypeResponse, parms);
- log.info("responseParms::"+responseParms.getProperty("body"));
- policyTypeResponse.setBody(responseParms.getProperty("body"));
- policyTypeResponse.setHttpStatus(200);
+ 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")));
} catch (Exception e) {
log.error("Caught exception executing service logic for " + svcOperation, e);
policyTypeResponse.setHttpStatus(500);
@@ -301,9 +307,11 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
log.info("A1AdapterClient has a Directed Graph for '" + svcOperation + "'");
try {
Properties responseParms = a1AdapterClient.execute("A1-ADAPTER-API", svcOperation, null, "sync", policyResponse, parms);
- log.info("responseParms::"+responseParms.getProperty("body"));
- policyResponse.setBody(responseParms.getProperty("body"));
- policyResponse.setHttpStatus(200);
+ 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")));
} catch (Exception e) {
log.error("Caught exception executing service logic for " + svcOperation, e);
policyResponse.setHttpStatus(500);
diff --git a/a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java b/a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java
index 8901ab07..a6588ea8 100644
--- a/a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java
+++ b/a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java
@@ -100,6 +100,7 @@ public class A1AdapterProviderTest {
public void test_deleteA1PolicyType() throws SvcLogicException, InterruptedException, ExecutionException {
String rpc = "deleteA1Policy";
Properties respProps = new Properties();
+ respProps.setProperty("response-code", "200");
DeleteA1PolicyInputBuilder inputBuilder = new DeleteA1PolicyInputBuilder();
when(a1AdapterClient.hasGraph(module, rpc, null, mode)).thenReturn(true);
when(a1AdapterClient.execute(eq(module), eq(rpc), eq(null), eq(mode), any(DeleteA1PolicyOutputBuilder.class),
@@ -113,6 +114,7 @@ public class A1AdapterProviderTest {
public void test_getA1Policy() throws SvcLogicException, InterruptedException, ExecutionException {
String rpc = "getA1Policy";
Properties respProps = new Properties();
+ respProps.setProperty("response-code", "200");
GetA1PolicyInputBuilder inputBuilder = new GetA1PolicyInputBuilder();
when(a1AdapterClient.hasGraph(module, rpc, null, mode)).thenReturn(true);
when(a1AdapterClient.execute(eq(module), eq(rpc), eq(null), eq(mode), any(GetA1PolicyOutputBuilder.class),
@@ -125,6 +127,7 @@ public class A1AdapterProviderTest {
public void test_getA1PolicyType() throws SvcLogicException, InterruptedException, ExecutionException {
String rpc = "getA1PolicyType";
Properties respProps = new Properties();
+ respProps.setProperty("response-code", "200");
GetA1PolicyTypeInputBuilder inputBuilder = new GetA1PolicyTypeInputBuilder();
when(a1AdapterClient.hasGraph(module, rpc, null, mode)).thenReturn(true);
when(a1AdapterClient.execute(eq(module), eq(rpc), eq(null), eq(mode), any(GetA1PolicyTypeOutputBuilder.class),
@@ -138,6 +141,7 @@ public class A1AdapterProviderTest {
public void test_getA1PolicyStatus() throws SvcLogicException, InterruptedException, ExecutionException {
String rpc = "getA1PolicyStatus";
Properties respProps = new Properties();
+ respProps.setProperty("response-code", "200");
GetA1PolicyStatusInputBuilder inputBuilder = new GetA1PolicyStatusInputBuilder();
when(a1AdapterClient.hasGraph(module, rpc, null, mode)).thenReturn(true);
when(a1AdapterClient.execute(eq(module), eq(rpc), eq(null), eq(mode), any(GetA1PolicyStatusOutputBuilder.class),
@@ -151,6 +155,7 @@ public class A1AdapterProviderTest {
public void test_putA1Policy() throws SvcLogicException, InterruptedException, ExecutionException {
String rpc = "putA1Policy";
Properties respProps = new Properties();
+ respProps.setProperty("response-code", "200");
PutA1PolicyInputBuilder inputBuilder = new PutA1PolicyInputBuilder();
when(a1AdapterClient.hasGraph(module, rpc, null, mode)).thenReturn(true);
when(a1AdapterClient.execute(eq(module), eq(rpc), eq(null), eq(mode), any(PutA1PolicyOutputBuilder.class),