#
# APPLICATION
-SERVER_CONTEXTPATH=/nbi/api/v1
+SERVER_CONTEXTPATH=/nbi/api/v3
SERVER_PORT=8080
# ONAP
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
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
<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>
</exclusions>
</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>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
+ <version>1.9.3</version>
</dependency>
<dependency>
<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 -->
<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>
<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>
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;
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();
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);
}
}
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);
}
}
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);
}
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);
}
}
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);
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);
public class CreateE2EServiceInstanceResponse {
+ private ServiceResponse service;
+
public ServiceResponse getService() {
return service;
}
this.service = service;
}
- private ServiceResponse service;
-
-}
+ @Override
+ public String toString() {
+ return "CreateE2EServiceInstanceResponse{" +
+ "service=" + service +
+ '}';
+ }
+}
\ No newline at end of file
public class CreateServiceInstanceResponse {
+ private RequestReferences requestReferences;
+
public RequestReferences getRequestReferences() {
return requestReferences;
}
this.requestReferences = requestReferences;
}
- private RequestReferences requestReferences;
-}
+ @Override
+ public String toString() {
+ return "CreateServiceInstanceResponse{" +
+ "requestReferences=" + requestReferences +
+ '}';
+ }
+}
\ No newline at end of file
this.operation = operation;
}
-}
+ @Override
+ public String toString() {
+ return "GetE2ERequestStatusResponse{" +
+ "operation=" + operation +
+ '}';
+ }
+}
\ No newline at end of file
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
*/
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;
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();
*/
package org.onap.nbi.commons;
+import com.fasterxml.jackson.databind.MappingJsonFactory;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
}
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());
}
#
# SERVER
-server.contextPath=/nbi/api/v1
+server.contextPath=/nbi/api/v3
server.port=8080
# LOGGING
onap.cloudOwner=CloudOwner
# NBI
-nbi.url=http://localhost:8080/nbi/api/v1
+nbi.url=http://localhost:8080/nbi/api/v3
nbi.callForVNF=false
# SDC
#
# SERVER
-server.contextPath=/nbi/api/v1
+server.contextPath=/nbi/api/v3
server.port = 8080
# LOGGING
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
# 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}