Code Review
/
clamp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Update the policyName send to Policy
[clamp.git]
/
src
/
main
/
java
/
org
/
onap
/
clamp
/
clds
/
client
/
DcaeDispatcherServices.java
diff --git
a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
index
3d8d5d5
..
f285dc2
100644
(file)
--- a/
src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
+++ b/
src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
@@
-25,6
+25,7
@@
package org.onap.clamp.clds.client;
\r
import com.att.eelf.configuration.EELFLogger;
\r
import com.att.eelf.configuration.EELFManager;
\r
\r
import com.att.eelf.configuration.EELFLogger;
\r
import com.att.eelf.configuration.EELFManager;
\r
+import com.fasterxml.jackson.databind.node.ObjectNode;
\r
\r
import java.io.BufferedReader;
\r
import java.io.DataOutputStream;
\r
\r
import java.io.BufferedReader;
\r
import java.io.DataOutputStream;
\r
@@
-96,18
+97,16
@@
public class DcaeDispatcherServices {
if (inStream != null) {
\r
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inStream));
\r
String inputLine = null;
\r
if (inStream != null) {
\r
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inStream));
\r
String inputLine = null;
\r
- StringBu
ffer response = new StringBuff
er();
\r
+ StringBu
ilder response = new StringBuild
er();
\r
while ((inputLine = bufferedReader.readLine()) != null) {
\r
response.append(inputLine);
\r
}
\r
responseStr = response.toString();
\r
}
\r
\r
while ((inputLine = bufferedReader.readLine()) != null) {
\r
response.append(inputLine);
\r
}
\r
responseStr = response.toString();
\r
}
\r
\r
- if (responseStr != null) {
\r
- if (requestFailed) {
\r
- logger.error("requestFailed - responseStr=" + responseStr);
\r
- throw new BadRequestException(responseStr);
\r
- }
\r
+ if (responseStr != null && requestFailed) {
\r
+ logger.error("requestFailed - responseStr=" + responseStr);
\r
+ throw new BadRequestException(responseStr);
\r
}
\r
\r
logger.debug("response code " + responseCode);
\r
}
\r
\r
logger.debug("response code " + responseCode);
\r
@@
-237,7
+236,10
@@
public class DcaeDispatcherServices {
Date startTime = new Date();
\r
LoggingUtils.setTargetContext("DCAE", "createNewDeployment");
\r
try {
\r
Date startTime = new Date();
\r
LoggingUtils.setTargetContext("DCAE", "createNewDeployment");
\r
try {
\r
- String apiBodyString = "{\"serviceTypeId\": \"" + serviceTypeId + "\"}";
\r
+ ObjectNode rootNode = (ObjectNode) refProp.getJsonTemplate("dcae.deployment.template");
\r
+ ((ObjectNode) rootNode).put("serviceTypeId", serviceTypeId);
\r
+ String apiBodyString = rootNode.toString();
\r
+
\r
logger.info("Dcae api Body String - " + apiBodyString);
\r
String url = refProp.getStringValue("DCAE_DISPATCHER_URL") + "/dcae-deployments/" + deploymentId;
\r
logger.info("Dcae Dispatcher Service url - " + url);
\r
logger.info("Dcae api Body String - " + apiBodyString);
\r
String url = refProp.getStringValue("DCAE_DISPATCHER_URL") + "/dcae-deployments/" + deploymentId;
\r
logger.info("Dcae Dispatcher Service url - " + url);
\r
@@
-270,7
+272,7
@@
public class DcaeDispatcherServices {
\r
String inputLine = null;
\r
\r
\r
String inputLine = null;
\r
\r
- StringBu
ffer response = new StringBuff
er();
\r
+ StringBu
ilder response = new StringBuild
er();
\r
\r
while ((inputLine = in.readLine()) != null) {
\r
response.append(inputLine);
\r
\r
while ((inputLine = in.readLine()) != null) {
\r
response.append(inputLine);
\r
@@
-279,11
+281,9
@@
public class DcaeDispatcherServices {
responseStr = response.toString();
\r
}
\r
\r
responseStr = response.toString();
\r
}
\r
\r
- if (responseStr != null) {
\r
- if (requestFailed) {
\r
- logger.error("requestFailed - responseStr=" + responseStr);
\r
- throw new BadRequestException(responseStr);
\r
- }
\r
+ if (responseStr != null && requestFailed) {
\r
+ logger.error("requestFailed - responseStr=" + responseStr);
\r
+ throw new BadRequestException(responseStr);
\r
}
\r
\r
logger.debug("response code " + responseCode);
\r
}
\r
\r
logger.debug("response code " + responseCode);
\r