aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.sdnc/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-05-29 16:32:57 -0400
committerJim Hahn <jrh3@att.com>2020-05-29 16:51:29 -0400
commit45e3d3ae1cc5a4c29526da4f4cb6096e1b6d7d4f (patch)
tree02b5f1fa7f150ef86846d37143b008e292ce9eaa /models-interactions/model-actors/actor.sdnc/src/main
parent6d5459569af6a9c70abf5a8bbb54917decd37b38 (diff)
Use "coder" to serialize Actor requests
Modified the Actors to use the "coder" to serialize requests instead of defaulting to the HttpClient serialization provider. Decided to just pretty-print the requests since that can be used for both logging and transmission, which avoids serializing the request twice. Issue-ID: POLICY-2601 Change-Id: I190ed19dd852a1aa66156b358cbc97c3b121af1f Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.sdnc/src/main')
-rw-r--r--models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncOperation.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncOperation.java b/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncOperation.java
index ca6d07b16..9b6394315 100644
--- a/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncOperation.java
+++ b/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncOperation.java
@@ -61,7 +61,6 @@ public abstract class SdncOperation extends HttpOperation<SdncResponse> {
protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) {
SdncRequest request = makeRequest(attempt);
- Entity<SdncRequest> entity = Entity.entity(request, MediaType.APPLICATION_JSON);
Map<String, Object> headers = makeHeaders();
@@ -69,7 +68,10 @@ public abstract class SdncOperation extends HttpOperation<SdncResponse> {
String path = getPath();
String url = getClient().getBaseUrl() + path;
- logMessage(EventType.OUT, CommInfrastructure.REST, url, request);
+ String strRequest = prettyPrint(request);
+ logMessage(EventType.OUT, CommInfrastructure.REST, url, strRequest);
+
+ Entity<String> entity = Entity.entity(strRequest, MediaType.APPLICATION_JSON);
// @formatter:off
return handleResponse(outcome, url,