2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
22 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 package org.onap.crud.dao.champ;
26 import net.dongliu.gson.GsonJava8TypeAdapterFactory;
28 import com.google.gson.Gson;
29 import com.google.gson.GsonBuilder;
30 import com.google.gson.reflect.TypeToken;
32 import org.apache.http.NameValuePair;
33 import org.apache.http.client.utils.URLEncodedUtils;
34 import org.apache.http.message.BasicNameValuePair;
35 import org.eclipse.jetty.util.security.Password;
36 import org.onap.aai.logging.LoggingContext;
37 import org.onap.aai.cl.api.Logger;
38 import org.onap.aai.cl.eelf.LoggerFactory;
39 import org.onap.crud.dao.GraphDao;
40 import org.onap.crud.entity.Edge;
41 import org.onap.crud.entity.Vertex;
42 import org.onap.crud.exception.CrudException;
43 import org.onap.crud.util.CrudServiceConstants;
44 import org.onap.aai.restclient.client.OperationResult;
45 import org.onap.aai.restclient.client.RestClient;
46 import org.onap.aai.restclient.enums.RestAuthenticationMode;
49 import java.nio.charset.Charset;
50 import java.util.ArrayList;
51 import java.util.Arrays;
52 import java.util.HashMap;
53 import java.util.HashSet;
54 import java.util.List;
56 import javax.ws.rs.core.MediaType;
57 import javax.ws.rs.core.Response;
59 public class ChampDao implements GraphDao {
60 protected RestClient client;
61 protected String baseObjectUrl;
62 protected String baseRelationshipUrl;
63 protected String baseTransactionUrl;
65 protected static final String HEADER_FROM_APP = "X-FromAppId";
66 protected static final String HEADER_TRANS_ID = "X-TransactionId";
67 protected static final String FROM_APP_NAME = "Gizmo";
68 protected static final String OBJECT_SUB_URL = "objects";
69 protected static final String RELATIONSHIP_SUB_URL = "relationships";
70 protected static final String TRANSACTION_SUB_URL = "transaction";
72 private Logger logger = LoggerFactory.getInstance().getLogger(ChampDao.class.getName());
74 // We use a custom vertex serializer for champ because it expects "key"
76 protected static final Gson champGson = new GsonBuilder()
77 .registerTypeAdapterFactory(new GsonJava8TypeAdapterFactory())
78 .registerTypeAdapter(Vertex.class, new ChampVertexSerializer())
79 .registerTypeAdapter(Edge.class, new ChampEdgeSerializer()).create();
84 public ChampDao(String champUrl, String certPassword) {
86 client = new RestClient().authenticationMode(RestAuthenticationMode.SSL_CERT).validateServerHostname(false)
87 .validateServerCertChain(false).clientCertFile(CrudServiceConstants.CRD_CHAMP_AUTH_FILE)
88 .clientCertPassword(Password.deobfuscate(certPassword));
90 baseObjectUrl = champUrl + OBJECT_SUB_URL;
91 baseRelationshipUrl = champUrl + RELATIONSHIP_SUB_URL;
92 baseTransactionUrl = champUrl + TRANSACTION_SUB_URL;
93 } catch (Exception e) {
94 System.out.println("Error setting up Champ configuration");
100 public ChampDao(RestClient client, String baseObjectUrl, String baseRelationshipUrl, String baseTransactionUrl) {
101 this.client = client;
102 this.baseObjectUrl = baseObjectUrl;
103 this.baseRelationshipUrl = baseRelationshipUrl;
104 this.baseTransactionUrl = baseTransactionUrl;
108 public Vertex getVertex(String id, String version) throws CrudException {
109 String url = baseObjectUrl + "/" + id;
110 OperationResult getResult = client.get(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
112 if (getResult.getResultCode() == 200) {
113 return Vertex.fromJson(getResult.getResult(), version);
115 // We didn't find a vertex with the supplied id, so just throw an
117 throw new CrudException("No vertex with id " + id + " found in graph",
118 javax.ws.rs.core.Response.Status.NOT_FOUND);
123 public Vertex getVertex(String id, String type, String version, Map<String, String> queryParams) throws CrudException {
124 StringBuilder strBuild = new StringBuilder(baseObjectUrl);
125 strBuild.append("/");
127 if(queryParams != null && !queryParams.isEmpty())
129 strBuild.append("?");
130 strBuild.append(URLEncodedUtils.format(convertToNameValuePair(queryParams), Charset.defaultCharset()));
133 OperationResult getResult = client.get(strBuild.toString(), createHeader(), MediaType.APPLICATION_JSON_TYPE);
135 if (getResult.getResultCode() == 200) {
136 Vertex vert = Vertex.fromJson(getResult.getResult(), version);
138 if (!vert.getType().equalsIgnoreCase(type)) {
139 // We didn't find a vertex with the supplied type, so just throw an
141 throw new CrudException("No vertex with id " + id + "and type " + type + " found in graph",
142 javax.ws.rs.core.Response.Status.NOT_FOUND);
146 // We didn't find a vertex with the supplied id, so just throw an
148 throw new CrudException("No vertex with id " + id + " found in graph",
149 javax.ws.rs.core.Response.Status.NOT_FOUND);
154 public List<Edge> getVertexEdges(String id, Map<String, String> queryParams) throws CrudException {
155 StringBuilder strBuild = new StringBuilder(baseObjectUrl);
156 strBuild.append("/relationships/");
158 if(queryParams != null && !queryParams.isEmpty())
160 strBuild.append("?");
161 strBuild.append(URLEncodedUtils.format(convertToNameValuePair(queryParams), Charset.defaultCharset()));
164 OperationResult getResult = client.get(strBuild.toString(), createHeader(), MediaType.APPLICATION_JSON_TYPE);
166 if (getResult.getResultCode() == 200) {
167 return champGson.fromJson(getResult.getResult(), new TypeToken<List<Edge>>() {
170 // We didn't find a vertex with the supplied id, so just throw an
172 throw new CrudException("No vertex with id " + id + " found in graph",
173 javax.ws.rs.core.Response.Status.NOT_FOUND);
178 public List<Vertex> getVertices(String type, Map<String, Object> filter, String version) throws CrudException {
179 return getVertices(type, filter, new HashSet<String>(), version);
183 public List<Vertex> getVertices(String type, Map<String, Object> filter, HashSet<String> properties, String version) throws CrudException {
184 filter.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
186 List<NameValuePair> queryParams = convertToNameValuePair(filter);
187 queryParams.addAll(convertToNameValuePair("properties", properties));
188 String url = baseObjectUrl + "/filter" + "?"
189 + URLEncodedUtils.format(queryParams, Charset.defaultCharset());
191 OperationResult getResult = client.get(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
193 if (getResult.getResultCode() == 200) {
194 return Vertex.collectionFromJson(getResult.getResult(), version);
196 // We didn't find a vertex with the supplied id, so just throw an
198 throw new CrudException("No vertices found in graph for given filters",
199 javax.ws.rs.core.Response.Status.NOT_FOUND);
204 public Edge getEdge(String id, String type, Map<String, String> queryParams) throws CrudException {
205 StringBuilder strBuild = new StringBuilder(baseRelationshipUrl);
206 strBuild.append("/");
208 if(queryParams != null && !queryParams.isEmpty())
210 strBuild.append("?");
211 strBuild.append(URLEncodedUtils.format(convertToNameValuePair(queryParams), Charset.defaultCharset()));
213 OperationResult getResult = client.get(strBuild.toString(), createHeader(), MediaType.APPLICATION_JSON_TYPE);
215 if (getResult.getResultCode() == 200) {
216 Edge edge = Edge.fromJson(getResult.getResult());
218 if (!edge.getType().equalsIgnoreCase(type)) {
219 // We didn't find an edge with the supplied type, so just throw an
221 throw new CrudException("No edge with id " + id + "and type " + type + " found in graph",
222 javax.ws.rs.core.Response.Status.NOT_FOUND);
226 // We didn't find a edge with the supplied type, so just throw an
228 throw new CrudException("No edge with id " + id + " found in graph", javax.ws.rs.core.Response.Status.NOT_FOUND);
233 public List<Edge> getEdges(String type, Map<String, Object> filter) throws CrudException {
234 String url = baseRelationshipUrl + "/filter" + "?"
235 + URLEncodedUtils.format(convertToNameValuePair(filter), Charset.defaultCharset());
237 OperationResult getResult = client.get(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
239 if (getResult.getResultCode() == 200) {
240 return champGson.fromJson(getResult.getResult(), new TypeToken<List<Edge>>() {
243 // We didn't find a vertex with the supplied id, so just throw an
245 throw new CrudException("No edges found in graph for given filters", javax.ws.rs.core.Response.Status.NOT_FOUND);
250 public Vertex addVertex(String type, Map<String, Object> properties, String version) throws CrudException {
251 String url = baseObjectUrl;
253 // Add the aai_node_type so that AAI can read the data created by gizmo
254 // TODO: This probably shouldn't be here
255 properties.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
257 Vertex.Builder insertVertexBuilder = new Vertex.Builder(type);
258 properties.forEach(insertVertexBuilder::property);
259 Vertex insertVertex = insertVertexBuilder.build();
261 OperationResult getResult = client.post(url, insertVertex.toJson(), createHeader(), MediaType.APPLICATION_JSON_TYPE,
262 MediaType.APPLICATION_JSON_TYPE);
264 if (getResult.getResultCode() == Response.Status.CREATED.getStatusCode()) {
265 return Vertex.fromJson(getResult.getResult(), version);
267 // We didn't create a vertex with the supplied type, so just throw an
269 throw new CrudException("Failed to create vertex", Response.Status.fromStatusCode(getResult.getResultCode()));
274 public Vertex updateVertex(String id, String type, Map<String, Object> properties, String version) throws CrudException {
275 String url = baseObjectUrl + "/" + id;
277 // Add the aai_node_type so that AAI can read the data created by gizmo
278 // TODO: This probably shouldn't be here
279 properties.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
281 Vertex.Builder insertVertexBuilder = new Vertex.Builder(type);
282 insertVertexBuilder.id(id);
283 properties.forEach(insertVertexBuilder::property);
284 Vertex insertVertex = insertVertexBuilder.build();
286 String payload = insertVertex.toJson(champGson);
287 OperationResult getResult = client.put(url, payload, createHeader(), MediaType.APPLICATION_JSON_TYPE,
288 MediaType.APPLICATION_JSON_TYPE);
290 if (getResult.getResultCode() == Response.Status.OK.getStatusCode()) {
291 return Vertex.fromJson(getResult.getResult(), version);
293 // We didn't create a vertex with the supplied type, so just throw an
295 throw new CrudException("Failed to update vertex: " + getResult.getFailureCause(), Response.Status.fromStatusCode(getResult.getResultCode()));
300 public void deleteVertex(String id, String type) throws CrudException {
301 String url = baseObjectUrl + "/" + id;
302 OperationResult getResult = client.delete(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
304 if (getResult.getResultCode() != Response.Status.OK.getStatusCode()) {
305 // We didn't delete a vertex with the supplied id, so just throw an
307 throw new CrudException("Failed to delete vertex: " + getResult.getFailureCause(), Response.Status.fromStatusCode(getResult.getResultCode()));
312 public Edge addEdge(String type, Vertex source, Vertex target, Map<String, Object> properties, String version) throws CrudException {
313 String url = baseRelationshipUrl;
315 // Try requests to ensure source and target exist in Champ
316 Vertex dbSource = getVertex(source.getId().get(), source.getType(), version, new HashMap<String, String>());
317 Vertex dbTarget = getVertex(target.getId().get(), target.getType(), version, new HashMap<String, String>());
319 Edge.Builder insertEdgeBuilder = new Edge.Builder(type).source(dbSource).target(dbTarget);
320 properties.forEach(insertEdgeBuilder::property);
321 Edge insertEdge = insertEdgeBuilder.build();
323 String edgeJson = insertEdge.toJson(champGson);
324 OperationResult getResult = client.post(url, edgeJson, createHeader(), MediaType.APPLICATION_JSON_TYPE,
325 MediaType.APPLICATION_JSON_TYPE);
327 if (getResult.getResultCode() == Response.Status.CREATED.getStatusCode()) {
328 return Edge.fromJson(getResult.getResult());
330 // We didn't create an edge with the supplied type, so just throw an
332 throw new CrudException("Failed to create edge: " + getResult.getFailureCause(), Response.Status.fromStatusCode(getResult.getResultCode()));
337 public Edge updateEdge(Edge edge) throws CrudException {
338 if (!edge.getId().isPresent()) {
339 throw new CrudException("Unable to identify edge: " + edge.toString(), Response.Status.BAD_REQUEST);
341 String url = baseRelationshipUrl + "/" + edge.getId().get();
343 String edgeJson = edge.toJson(champGson);
344 OperationResult getResult = client.put(url, edgeJson, createHeader(), MediaType.APPLICATION_JSON_TYPE,
345 MediaType.APPLICATION_JSON_TYPE);
347 if (getResult.getResultCode() == Response.Status.OK.getStatusCode()) {
348 return Edge.fromJson(getResult.getResult());
350 // We didn't create an edge with the supplied type, so just throw an
352 throw new CrudException("Failed to update edge: " + getResult.getFailureCause(), Response.Status.fromStatusCode(getResult.getResultCode()));
357 public void deleteEdge(String id, String type) throws CrudException {
358 String url = baseRelationshipUrl + "/" + id;
359 OperationResult getResult = client.delete(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
361 if (getResult.getResultCode() != 200) {
362 // We didn't find an edge with the supplied type, so just throw an
364 throw new CrudException("No edge with id " + id + " found in graph", javax.ws.rs.core.Response.Status.NOT_FOUND);
369 public String openTransaction() {
370 String url = baseTransactionUrl;
372 OperationResult getResult = client.post(url, "", createHeader(), MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_PLAIN_TYPE);
374 if (getResult.getResultCode() == 200) {
375 return getResult.getResult();
382 public void commitTransaction(String id) throws CrudException {
383 String url = baseTransactionUrl + "/" + id;
385 OperationResult getResult = client.put(url, "{\"method\": \"commit\"}", createHeader(), MediaType.APPLICATION_JSON_TYPE,
386 MediaType.TEXT_PLAIN_TYPE);
388 if (getResult.getResultCode() != 200) {
389 throw new CrudException("Unable to commit transaction",
390 Response.Status.fromStatusCode(getResult.getResultCode()));
395 public void rollbackTransaction(String id) throws CrudException {
396 String url = baseTransactionUrl + "/" + id;
398 OperationResult getResult = client.put(url, "{\"method\": \"rollback\"}", createHeader(), MediaType.APPLICATION_JSON_TYPE,
399 MediaType.TEXT_PLAIN_TYPE);
401 if (getResult.getResultCode() != 200) {
402 throw new CrudException("Unable to rollback transaction",
403 Response.Status.fromStatusCode(getResult.getResultCode()));
408 public boolean transactionExists(String id) throws CrudException {
409 String url = baseTransactionUrl + "/" + id;
410 Map<String, List<String>> headers = new HashMap<>();
411 headers.put(HEADER_FROM_APP, Arrays.asList("Gizmo"));
412 headers.put(HEADER_TRANS_ID, Arrays.asList(MDC.get(LoggingContext.LoggingField.REQUEST_ID.toString())));
414 OperationResult getResult = client.get(url, headers, MediaType.APPLICATION_JSON_TYPE);
416 return getResult.getResultCode() == 200;
420 public Vertex addVertex(String type, Map<String, Object> properties, String version, String txId) throws CrudException {
421 String url = baseObjectUrl + "?transactionId=" + txId;
423 // Add the aai_node_type so that AAI can read the data created by gizmo
424 // TODO: This probably shouldn't be here
425 properties.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
427 Vertex.Builder insertVertexBuilder = new Vertex.Builder(type);
428 properties.forEach(insertVertexBuilder::property);
429 Vertex insertVertex = insertVertexBuilder.build();
431 OperationResult getResult = client.post(url, insertVertex.toJson(), createHeader(), MediaType.APPLICATION_JSON_TYPE,
432 MediaType.APPLICATION_JSON_TYPE);
434 if (getResult.getResultCode() == Response.Status.CREATED.getStatusCode()) {
435 return Vertex.fromJson(getResult.getResult(), version);
437 // We didn't create a vertex with the supplied type, so just throw an
439 throw new CrudException("Failed to create vertex: " + getResult.getFailureCause(), Response.Status.fromStatusCode(getResult.getResultCode()));
444 public Edge addEdge(String type, Vertex source, Vertex target, Map<String, Object> properties, String version, String txId)
445 throws CrudException {
446 String url = baseRelationshipUrl + "?transactionId=" + txId;
448 // Try requests to ensure source and target exist in Champ
449 Vertex dbSource = getVertex(source.getId().get(), source.getType(), version, txId);
450 Vertex dbTarget = getVertex(target.getId().get(), target.getType(), version, txId);
452 Edge.Builder insertEdgeBuilder = new Edge.Builder(type).source(dbSource).target(dbTarget);
453 properties.forEach(insertEdgeBuilder::property);
454 Edge insertEdge = insertEdgeBuilder.build();
456 OperationResult getResult = client.post(url, insertEdge.toJson(champGson), createHeader(),
457 MediaType.APPLICATION_JSON_TYPE, MediaType.APPLICATION_JSON_TYPE);
459 if (getResult.getResultCode() == Response.Status.CREATED.getStatusCode()) {
460 return Edge.fromJson(getResult.getResult());
462 // We didn't create an edge with the supplied type, so just throw an
464 throw new CrudException("Failed to create edge: " + getResult.getFailureCause(), Response.Status.fromStatusCode(getResult.getResultCode()));
469 public Vertex updateVertex(String id, String type, Map<String, Object> properties, String version, String txId) throws CrudException {
470 String url = baseObjectUrl + "/" + id + "?transactionId=" + txId;
472 // Add the aai_node_type so that AAI can read the data created by gizmo
473 // TODO: This probably shouldn't be here
474 properties.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
476 Vertex.Builder insertVertexBuilder = new Vertex.Builder(type);
477 insertVertexBuilder.id(id);
478 properties.forEach(insertVertexBuilder::property);
479 Vertex insertVertex = insertVertexBuilder.build();
481 String payload = insertVertex.toJson(champGson);
482 OperationResult getResult = client.put(url, payload, createHeader(), MediaType.APPLICATION_JSON_TYPE,
483 MediaType.APPLICATION_JSON_TYPE);
485 if (getResult.getResultCode() == Response.Status.OK.getStatusCode()) {
486 return Vertex.fromJson(getResult.getResult(), version);
488 // We didn't create a vertex with the supplied type, so just throw an
490 throw new CrudException("Failed to update vertex: " + getResult.getFailureCause(), Response.Status.fromStatusCode(getResult.getResultCode()));
495 public void deleteVertex(String id, String type, String txId) throws CrudException {
496 String url = baseObjectUrl + "/" + id + "?transactionId=" + txId;
497 OperationResult getResult = client.delete(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
499 if (getResult.getResultCode() != Response.Status.OK.getStatusCode()) {
500 // We didn't delete a vertex with the supplied id, so just throw an
502 throw new CrudException("Failed to delete vertex: " + getResult.getFailureCause(), Response.Status.fromStatusCode(getResult.getResultCode()));
507 public Edge updateEdge(Edge edge, String txId) throws CrudException {
508 if (!edge.getId().isPresent()) {
509 throw new CrudException("Unable to identify edge: " + edge.toString(), Response.Status.BAD_REQUEST);
511 String url = baseRelationshipUrl + "/" + edge.getId().get() + "?transactionId=" + txId;
512 OperationResult getResult = client.put(url, edge.toJson(champGson), createHeader(), MediaType.APPLICATION_JSON_TYPE,
513 MediaType.APPLICATION_JSON_TYPE);
515 if (getResult.getResultCode() == Response.Status.OK.getStatusCode()) {
516 return Edge.fromJson(getResult.getResult());
518 // We didn't create an edge with the supplied type, so just throw an
520 throw new CrudException("Failed to update edge: " + getResult.getFailureCause(),
521 Response.Status.fromStatusCode(getResult.getResultCode()));
526 public void deleteEdge(String id, String type, String txId) throws CrudException {
527 String url = baseRelationshipUrl + "/" + id + "?transactionId=" + txId;
528 OperationResult getResult = client.delete(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
530 if (getResult.getResultCode() != 200) {
531 // We didn't find an edge with the supplied type, so just throw an
533 throw new CrudException("No edge with id " + id + " found in graph", javax.ws.rs.core.Response.Status.NOT_FOUND);
538 public Edge getEdge(String id, String type, String txId) throws CrudException {
539 String url = baseRelationshipUrl + "/" + id + "?transactionId=" + txId;
540 OperationResult getResult = client.get(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
542 if (getResult.getResultCode() == 200) {
543 Edge edge = Edge.fromJson(getResult.getResult());
545 if (!edge.getType().equalsIgnoreCase(type)) {
546 // We didn't find an edge with the supplied type, so just throw an
548 throw new CrudException("No edge with id " + id + "and type " + type + " found in graph",
549 javax.ws.rs.core.Response.Status.NOT_FOUND);
553 // We didn't find an edge with the supplied id, so just throw an
555 throw new CrudException("No edge with id " + id + " found in graph", javax.ws.rs.core.Response.Status.NOT_FOUND);
559 public Vertex getVertex(String id, String type, String version, String txId) throws CrudException {
560 String url = baseObjectUrl + "/" + id + "?transactionId=" + txId;
561 OperationResult getResult = client.get(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
563 if (getResult.getResultCode() == 200) {
564 Vertex vert = Vertex.fromJson(getResult.getResult(), version);
566 if (!vert.getType().equalsIgnoreCase(type)) {
567 // We didn't find a vertex with the supplied type, so just throw an
569 throw new CrudException("No vertex with id " + id + "and type " + type + " found in graph",
570 javax.ws.rs.core.Response.Status.NOT_FOUND);
574 // We didn't find a vertex with the supplied id, so just throw an
576 throw new CrudException("No vertex with id " + id + " found in graph",
577 javax.ws.rs.core.Response.Status.NOT_FOUND);
581 // https://stackoverflow.com/questions/26942330/convert-mapstring-string-to-listnamevaluepair-is-this-the-most-efficient
582 private List<NameValuePair> convertToNameValuePair(Map<String, ? super String> pairs) {
583 List<NameValuePair> nvpList = new ArrayList<>(pairs.size());
585 pairs.forEach((key, value) -> nvpList.add(new BasicNameValuePair(key, value.toString())));
590 // https://stackoverflow.com/questions/26942330/convert-mapstring-string-to-listnamevaluepair-is-this-the-most-efficient
591 private List<NameValuePair> convertToNameValuePair(String key, HashSet<String> values) {
592 List<NameValuePair> nvpList = new ArrayList<>(values.size());
594 values.forEach((value) -> nvpList.add(new BasicNameValuePair(key, value)));
599 private Map<String, List<String>> createHeader() {
600 Map<String, List<String>> headers = new HashMap<>();
601 headers.put(HEADER_FROM_APP, Arrays.asList(FROM_APP_NAME));
602 headers.put(HEADER_TRANS_ID, Arrays.asList(MDC.get(LoggingContext.LoggingField.REQUEST_ID.toString())));