aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.env4
-rw-r--r--Dockerfile2
-rw-r--r--pom.xml28
-rw-r--r--src/main/java/org/onap/nbi/apis/hub/service/EventFactory.java3
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java26
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateE2EServiceInstanceResponse.java12
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java11
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/GetE2ERequestStatusResponse.java8
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/OperationStatus.java19
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceorder/utils/JsonEntityConverter.java3
-rw-r--r--src/main/java/org/onap/nbi/commons/JacksonFilter.java3
-rw-r--r--src/main/resources/application.properties4
-rw-r--r--src/test/resources/application.properties4
-rw-r--r--version.properties6
14 files changed, 100 insertions, 33 deletions
diff --git a/.env b/.env
index 38d05d7..71f7de7 100644
--- a/.env
+++ b/.env
@@ -15,7 +15,7 @@
#
# APPLICATION
-SERVER_CONTEXTPATH=/nbi/api/v1
+SERVER_CONTEXTPATH=/nbi/api/v3
SERVER_PORT=8080
# ONAP
@@ -25,7 +25,7 @@ ONAP_CLOUDOWNER=
NEXUS_DOCKER_REPO=nexus3.onap.org:10001
# NBI
-NBI_URL=http://localhost:8080/nbi/api/v1
+NBI_URL=http://localhost:8080/nbi/api/v3
NBI_CALLFORVNF=false
# SDC
diff --git a/Dockerfile b/Dockerfile
index 7eb5d81..ccf2531 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,7 +17,7 @@
FROM openjdk:8-jre-alpine
ARG SERVER_PORT
-ARG PKG_FILENAME=nbi-rest-services-1.0.0-SNAPSHOT.jar
+ARG PKG_FILENAME=nbi-rest-services-3.0.0-SNAPSHOT.jar
ADD target/$PKG_FILENAME app.jar
COPY src/main/resources/certificate /certs
diff --git a/pom.xml b/pom.xml
index ddd06a9..1a42cd8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
<groupId>org.onap.externalapi-nbi</groupId>
<artifactId>nbi-rest-services</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>externalapi-nbi</name>
@@ -121,6 +121,12 @@
</dependency>
<dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.8.11.2</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>8.5.32</version>
@@ -163,7 +169,7 @@
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
+ <version>1.9.3</version>
</dependency>
<dependency>
@@ -227,6 +233,12 @@
<groupId>com.bazaarvoice.jolt</groupId>
<artifactId>json-utils</artifactId>
<version>0.1.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!-- test -->
@@ -259,6 +271,12 @@
<artifactId>spring-cloud-contract-wiremock</artifactId>
<version>1.0.0.RELEASE</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -293,6 +311,12 @@
<groupId>org.onap.msb.java-sdk</groupId>
<artifactId>msb-java-sdk</artifactId>
<version>1.1.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
diff --git a/src/main/java/org/onap/nbi/apis/hub/service/EventFactory.java b/src/main/java/org/onap/nbi/apis/hub/service/EventFactory.java
index 8083fff..b2a017c 100644
--- a/src/main/java/org/onap/nbi/apis/hub/service/EventFactory.java
+++ b/src/main/java/org/onap/nbi/apis/hub/service/EventFactory.java
@@ -16,6 +16,7 @@
package org.onap.nbi.apis.hub.service;
import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.MappingJsonFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onap.nbi.apis.hub.model.Event;
@@ -30,7 +31,7 @@ import java.util.UUID;
public class EventFactory {
- private static final ObjectMapper mapper = new ObjectMapper();
+ private static final ObjectMapper mapper = new ObjectMapper(new MappingJsonFactory());
public static Event getEvent(EventType eventType, ServiceOrder serviceOrder, ServiceOrderItem serviceOrderItem) {
Event event = new Event();
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java b/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java
index 57cb6b5..67421ba 100644
--- a/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java
+++ b/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java
@@ -76,10 +76,10 @@ public class SoClient {
return response;
} catch (BackendFunctionalException e) {
- LOGGER.error("error on calling " + url + " ," + e);
+ LOGGER.error(ERROR_ON_CALLING + url + " ," + e);
return new ResponseEntity(e.getBodyResponse(),e.getHttpStatus());
} catch (ResourceAccessException e) {
- LOGGER.error("error on calling " + url + " ," + e);
+ LOGGER.error(ERROR_ON_CALLING + url + " ," + e);
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@@ -100,10 +100,10 @@ public class SoClient {
return response;
} catch (BackendFunctionalException e) {
- LOGGER.error("error on calling " + url + " ," + e);
+ LOGGER.error(ERROR_ON_CALLING + url + " ," + e);
return new ResponseEntity(e.getBodyResponse(),e.getHttpStatus());
} catch (ResourceAccessException e) {
- LOGGER.error("error on calling " + url + " ," + e);
+ LOGGER.error(ERROR_ON_CALLING + url + " ," + e);
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@@ -124,10 +124,10 @@ public class SoClient {
return response;
} catch (BackendFunctionalException e) {
- LOGGER.error("error on calling " + url + " ," + e);
+ LOGGER.error(ERROR_ON_CALLING + url + " ," + e);
return new ResponseEntity<>(e.getHttpStatus());
} catch (ResourceAccessException e) {
- LOGGER.error("error on calling " + url + " ," + e);
+ LOGGER.error(ERROR_ON_CALLING + url + " ," + e);
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
@@ -162,10 +162,10 @@ public class SoClient {
return response;
} catch (BackendFunctionalException e) {
- LOGGER.error("error on calling " + url + " ," + e);
+ LOGGER.error(ERROR_ON_CALLING + url + " ," + e);
return new ResponseEntity<>(e.getHttpStatus());
} catch (ResourceAccessException e) {
- LOGGER.error("error on calling " + url + " ," + e);
+ LOGGER.error(ERROR_ON_CALLING + url + " ," + e);
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@@ -202,7 +202,10 @@ public class SoClient {
ResponseEntity<GetRequestStatusResponse> response = restTemplate.exchange(url, HttpMethod.GET,
new HttpEntity<>(buildRequestHeader()), GetRequestStatusResponse.class);
logResponseGet(url, response);
- return response.getBody();
+ if (null == response)
+ return null;
+ else
+ return response.getBody();
} catch (BackendFunctionalException | ResourceAccessException e) {
LOGGER.error(ERROR_ON_CALLING + url + " ," + e);
@@ -226,7 +229,10 @@ public GetE2ERequestStatusResponse callE2EGetRequestStatus(String operationId, S
ResponseEntity<GetE2ERequestStatusResponse> response = restTemplate.exchange(callUrlFormated, HttpMethod.GET,
new HttpEntity<>(buildRequestHeader()), GetE2ERequestStatusResponse.class);
logE2EResponseGet(callUrlFormated, response);
- return response.getBody();
+ if (null == response)
+ return null;
+ else
+ return response.getBody();
} catch (BackendFunctionalException|ResourceAccessException e) {
LOGGER.error(ERROR_ON_CALLING + callUrlFormated + " ," + e);
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateE2EServiceInstanceResponse.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateE2EServiceInstanceResponse.java
index 5c41166..7c75eca 100644
--- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateE2EServiceInstanceResponse.java
+++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateE2EServiceInstanceResponse.java
@@ -17,6 +17,8 @@ package org.onap.nbi.apis.serviceorder.model.consumer;
public class CreateE2EServiceInstanceResponse {
+ private ServiceResponse service;
+
public ServiceResponse getService() {
return service;
}
@@ -25,6 +27,10 @@ public class CreateE2EServiceInstanceResponse {
this.service = service;
}
- private ServiceResponse service;
-
-}
+ @Override
+ public String toString() {
+ return "CreateE2EServiceInstanceResponse{" +
+ "service=" + service +
+ '}';
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java
index 590bace..3389e32 100644
--- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java
+++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java
@@ -17,6 +17,8 @@ package org.onap.nbi.apis.serviceorder.model.consumer;
public class CreateServiceInstanceResponse {
+ private RequestReferences requestReferences;
+
public RequestReferences getRequestReferences() {
return requestReferences;
}
@@ -25,5 +27,10 @@ public class CreateServiceInstanceResponse {
this.requestReferences = requestReferences;
}
- private RequestReferences requestReferences;
-}
+ @Override
+ public String toString() {
+ return "CreateServiceInstanceResponse{" +
+ "requestReferences=" + requestReferences +
+ '}';
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/GetE2ERequestStatusResponse.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/GetE2ERequestStatusResponse.java
index 42a6170..9e16181 100644
--- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/GetE2ERequestStatusResponse.java
+++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/GetE2ERequestStatusResponse.java
@@ -27,4 +27,10 @@ public class GetE2ERequestStatusResponse {
this.operation = operation;
}
-}
+ @Override
+ public String toString() {
+ return "GetE2ERequestStatusResponse{" +
+ "operation=" + operation +
+ '}';
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/OperationStatus.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/OperationStatus.java
index 2cd7393..4d00e41 100644
--- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/OperationStatus.java
+++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/OperationStatus.java
@@ -209,5 +209,20 @@ public class OperationStatus implements Serializable {
return true;
}
-
-}
+ @Override
+ public String toString() {
+ return "OperationStatus{" +
+ "serviceId='" + serviceId + '\'' +
+ ", operationId='" + operationId + '\'' +
+ ", serviceName='" + serviceName + '\'' +
+ ", operation='" + operation + '\'' +
+ ", userId='" + userId + '\'' +
+ ", result='" + result + '\'' +
+ ", operationContent='" + operationContent + '\'' +
+ ", progress='" + progress + '\'' +
+ ", reason='" + reason + '\'' +
+ ", operateAt=" + operateAt +
+ ", finishedAt=" + finishedAt +
+ '}';
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/utils/JsonEntityConverter.java b/src/main/java/org/onap/nbi/apis/serviceorder/utils/JsonEntityConverter.java
index 7be84c2..1821f0a 100644
--- a/src/main/java/org/onap/nbi/apis/serviceorder/utils/JsonEntityConverter.java
+++ b/src/main/java/org/onap/nbi/apis/serviceorder/utils/JsonEntityConverter.java
@@ -15,6 +15,7 @@
*/
package org.onap.nbi.apis.serviceorder.utils;
+import com.fasterxml.jackson.databind.MappingJsonFactory;
import java.io.IOException;
import org.onap.nbi.apis.serviceorder.model.orchestrator.ServiceOrderInfo;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -24,7 +25,7 @@ public final class JsonEntityConverter {
private JsonEntityConverter() {
}
- private static final ObjectMapper MAPPER = new ObjectMapper();
+ private static final ObjectMapper MAPPER = new ObjectMapper(new MappingJsonFactory());
public static String convertServiceOrderInfoToJson(ServiceOrderInfo serviceOrderInfo) {
return MAPPER.valueToTree(serviceOrderInfo).toString();
diff --git a/src/main/java/org/onap/nbi/commons/JacksonFilter.java b/src/main/java/org/onap/nbi/commons/JacksonFilter.java
index 07c113e..97f6cf2 100644
--- a/src/main/java/org/onap/nbi/commons/JacksonFilter.java
+++ b/src/main/java/org/onap/nbi/commons/JacksonFilter.java
@@ -15,6 +15,7 @@
*/
package org.onap.nbi.commons;
+import com.fasterxml.jackson.databind.MappingJsonFactory;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
@@ -59,7 +60,7 @@ public class JacksonFilter {
}
public static <R> ObjectNode createNode(R bean, JsonRepresentation jsonRepresentation) {
- ObjectMapper mapper = new ObjectMapper();
+ ObjectMapper mapper = new ObjectMapper(new MappingJsonFactory());
return JacksonFilter.createNode(mapper, bean, jsonRepresentation.getAttributes());
}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 8c07ce0..11638c1 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -15,7 +15,7 @@
#
# SERVER
-server.contextPath=/nbi/api/v1
+server.contextPath=/nbi/api/v3
server.port=8080
# LOGGING
@@ -27,7 +27,7 @@ onap.tenantId=6e97a2bd51d74f6db5671d8dc1517d82
onap.cloudOwner=CloudOwner
# NBI
-nbi.url=http://localhost:8080/nbi/api/v1
+nbi.url=http://localhost:8080/nbi/api/v3
nbi.callForVNF=false
# SDC
diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties
index 50e0527..c598a89 100644
--- a/src/test/resources/application.properties
+++ b/src/test/resources/application.properties
@@ -15,7 +15,7 @@
#
# SERVER
-server.contextPath=/nbi/api/v1
+server.contextPath=/nbi/api/v3
server.port = 8080
# LOGGING
@@ -27,7 +27,7 @@ onap.tenantId=31047205ce114b60833b23e400d6a535
onap.cloudOwner=CloudOwner
# NBI
-nbi.url=http://127.0.0.1:8080/nbi/api/v1
+nbi.url=http://127.0.0.1:8080/nbi/api/v3
nbi.callForVNF=false
# SDC
diff --git a/version.properties b/version.properties
index aeb4b21..8c41eda 100644
--- a/version.properties
+++ b/version.properties
@@ -18,9 +18,9 @@
# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... )
# because they are used in Jenkins, whose plug-in doesn't support...
-major=1
-minor=2
-patch=1
+major=3
+minor=0
+patch=0
base_version=${major}.${minor}.${patch}