summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/main/java
diff options
context:
space:
mode:
authorByung-Woo Jun <byung-woo.jun@ericsson.com>2018-08-30 16:09:13 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-30 16:09:13 +0000
commit1ff9c3d426e0a67bef180a324d8e77962a7e72c1 (patch)
tree2708dd41d14df44326d939815b3dd6da99fdb6b2 /adapters/mso-openstack-adapters/src/main/java
parentaf51988204628b27a3bbac500a6f9ca857ee5d05 (diff)
parent0961fdc4be31e2ed6995f86cd0c5cdf6ef3a93ea (diff)
Merge "fixed sonar issues in ValetClient.java"
Diffstat (limited to 'adapters/mso-openstack-adapters/src/main/java')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
index f4bda4aaa0..3e3c6754dc 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/ValetClient.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* 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
@@ -69,7 +71,9 @@ public class ValetClient {
private static final String DEFAULT_BASE_URL = "http://localhost:8080/";
private static final String DEFAULT_BASE_PATH = "api/valet/placement/v1";
private static final String DEFAULT_AUTH_STRING = "";
-
+ private static final String REQUEST_ID="requestId";
+ private static final String HEADERS=", headers=";
+ private static final String BODY=", body=";
@Autowired
private ObjectMapper mapper;
@@ -100,7 +104,7 @@ public class ValetClient {
GenericValetResponse<ValetCreateResponse> gvr = null;
try {
- UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam("requestId", requestId);
+ UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam(REQUEST_ID, requestId);
URI uri = builder.build();
ValetCreateRequest vcr = this.createValetCreateRequest(regionId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
@@ -108,7 +112,7 @@ public class ValetClient {
String body = mapper.writeValueAsString(vcr);
HttpHeaders headers = generateHeaders(requestId);
HttpEntity<String> entity = new HttpEntity<>(body, headers);
- LOGGER.debug("valet create req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body.toString());
+ LOGGER.debug("valet create req: " + uri.toString() + HEADERS + headers.toString() + BODY + body.toString());
response = restTemplate.exchange(uri, HttpMethod.POST, entity, ValetCreateResponse.class);
gvr = this.getGVRFromResponse(response);
@@ -128,7 +132,7 @@ public class ValetClient {
GenericValetResponse<ValetUpdateResponse> gvr = null;
try {
- UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam("requestId", requestId);
+ UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam(REQUEST_ID, requestId);
URI uri = builder.build();
ValetUpdateRequest vur = this.createValetUpdateRequest(regionId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
@@ -136,7 +140,7 @@ public class ValetClient {
String body = mapper.writeValueAsString(vur);
HttpHeaders headers = generateHeaders(requestId);
HttpEntity<String> entity = new HttpEntity<>(body, headers);
- LOGGER.debug("valet update req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body.toString());
+ LOGGER.debug("valet update req: " + uri.toString() + HEADERS + headers.toString() + ", body=" + body.toString());
response = restTemplate.exchange(uri, HttpMethod.PUT, entity, ValetUpdateResponse.class);
gvr = this.getGVRFromResponse(response);
@@ -155,7 +159,7 @@ public class ValetClient {
GenericValetResponse<ValetDeleteResponse> gvr = null;
try {
- UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam("requestId", requestId);
+ UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam(REQUEST_ID, requestId);
URI uri = builder.build();
ValetDeleteRequest vdr = this.createValetDeleteRequest(regionId, tenantId, vfModuleId, vfModuleName);
@@ -163,7 +167,7 @@ public class ValetClient {
String body = mapper.writeValueAsString(vdr);
HttpHeaders headers = generateHeaders(requestId);
HttpEntity<String> entity = new HttpEntity<>(body, headers);
- LOGGER.debug("valet delete req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body.toString());
+ LOGGER.debug("valet delete req: " + uri.toString() + HEADERS + headers.toString() + ", body=" + body.toString());
response = restTemplate.exchange(uri, HttpMethod.DELETE, entity, ValetDeleteResponse.class);
gvr = this.getGVRFromResponse(response);
@@ -190,7 +194,7 @@ public class ValetClient {
String body = mapper.writeValueAsString(vcr);
HttpHeaders headers = generateHeaders(requestId);
HttpEntity<String> entity = new HttpEntity<>(body, headers);
- LOGGER.debug("valet confirm req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body);
+ LOGGER.debug("valet confirm req: " + uri.toString() + HEADERS + headers.toString() + BODY + body);
response = restTemplate.exchange(uri, HttpMethod.PUT, entity, ValetConfirmResponse.class);
gvr = this.getGVRFromResponse(response);
@@ -217,7 +221,7 @@ public class ValetClient {
String body = mapper.writeValueAsString(vrr);
HttpHeaders headers = generateHeaders(requestId);
HttpEntity<String> entity = new HttpEntity<>(body, headers);
- LOGGER.debug("valet rollback req: " + uri.toString() + ", headers=" + headers.toString() + ", body=" + body.toString());
+ LOGGER.debug("valet rollback req: " + uri.toString() + HEADERS + headers.toString() + BODY + body.toString());
response = restTemplate.exchange(uri, HttpMethod.PUT, entity, ValetRollbackResponse.class);
gvr = this.getGVRFromResponse(response);