summaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorByung-Woo Jun <byung-woo.jun@ericsson.com>2018-09-11 17:33:14 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-11 17:33:14 +0000
commit7c3eb6dc9fa4c421823162cc63fa33288594e1dc (patch)
treedb46f5bd48d8408693f808cba609fe48cced512e /adapters
parentbb16c74215871ea2000ce4d9a0732abc871d3b31 (diff)
parent268b3658a817eab751cce31d753c10ca68f2eea1 (diff)
Merge "fixed sonar issue in VolumeAdapterRestV2.java"
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java27
1 files changed, 16 insertions, 11 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java
index 3f3a312e12..a1ff139707 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. 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
@@ -83,6 +85,9 @@ import io.swagger.annotations.ApiResponses;
public class VolumeAdapterRestV2 {
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, VolumeAdapterRestV2.class);
private static final String TESTING_KEYWORD = "___TESTING___";
+ private static final String RESP=", resp=";
+ private static final String EXCEPTION="Exception :";
+ private static final String VOLUME_GROUPID_MISSING="VolumeGroupId in URL does not match content";
@Autowired
private VnfAdapterRestUtils vnfAdapterRestUtils;
@@ -219,7 +224,7 @@ public class VolumeAdapterRestV2 {
rb,
req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ LOGGER.debug(EXCEPTION,e);
eresp = new VolumeGroupExceptionResponse(
e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
@@ -228,7 +233,7 @@ public class VolumeAdapterRestV2 {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("CreateVFModule VolumesTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+ LOGGER.debug ("CreateVFModule VolumesTask exit: code=" + getStatusCode() + RESP+ getResponse());
}
}
@@ -257,7 +262,7 @@ public class VolumeAdapterRestV2 {
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
- .entity("VolumeGroupId in URL does not match content")
+ .entity(VOLUME_GROUPID_MISSING)
.build();
}
DeleteVNFVolumesTask task = new DeleteVNFVolumesTask(req, mode);
@@ -323,7 +328,7 @@ public class VolumeAdapterRestV2 {
}
response = new DeleteVolumeGroupResponse(true, req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ LOGGER.debug(EXCEPTION,e);
eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
if (!req.isSynchronous()) {
@@ -331,7 +336,7 @@ public class VolumeAdapterRestV2 {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug("DeleteVNFVolumesTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+ LOGGER.debug("DeleteVNFVolumesTask exit: code=" + getStatusCode() + RESP+ getResponse());
}
}
@@ -358,7 +363,7 @@ public class VolumeAdapterRestV2 {
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
- .entity("VolumeGroupId in URL does not match content")
+ .entity(VOLUME_GROUPID_MISSING)
.build();
}
RollbackVNFVolumesTask task = new RollbackVNFVolumesTask(req);
@@ -424,7 +429,7 @@ public class VolumeAdapterRestV2 {
vnfAdapter.rollbackVnf(vrb);
response = new RollbackVolumeGroupResponse(true, req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ LOGGER.debug(EXCEPTION,e);
eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
if (!req.isSynchronous()) {
@@ -432,7 +437,7 @@ public class VolumeAdapterRestV2 {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug("RollbackVNFVolumesTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+ LOGGER.debug("RollbackVNFVolumesTask exit: code=" + getStatusCode() + RESP+ getResponse());
}
}
@@ -462,7 +467,7 @@ public class VolumeAdapterRestV2 {
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
- .entity("VolumeGroupId in URL does not match content")
+ .entity(VOLUME_GROUPID_MISSING)
.build();
}
UpdateVNFVolumesTask task = new UpdateVNFVolumesTask(req, mode);
@@ -550,7 +555,7 @@ public class VolumeAdapterRestV2 {
req.getVolumeGroupId(), req.getVolumeGroupStackId(),
outputs.value, req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ LOGGER.debug(EXCEPTION,e);
eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
if (!req.isSynchronous()) {
@@ -558,7 +563,7 @@ public class VolumeAdapterRestV2 {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug("UpdateVNFVolumesTask exit: code=" + getStatusCode() + ", resp="+ getResponse());
+ LOGGER.debug("UpdateVNFVolumesTask exit: code=" + getStatusCode() + RESP+ getResponse());
}
}