Skip to content

Commit

Permalink
New getGuid() API for NR Transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit-ap committed Sep 26, 2022
1 parent a7d56cb commit 4e24ce7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ public void insertDistributedTraceHeaders(Headers headers) {
public void acceptDistributedTraceHeaders(TransportType transportType, Headers headers) {
}

@Override
public String getGuid() {
return null;
}

@Override
public void setTransportType(TransportType transportType) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,12 @@ public void acceptDistributedTraceHeaders(TransportType transportType, Headers h
HeadersUtil.parseAndAcceptDistributedTraceHeaders(tx, headers);
}

@Override
public String getGuid() {
Transaction tx = getTransactionIfExists();
return (tx == null) ? null : tx.getGuid();
}

@Override
public void setTransportType(TransportType transportType) {
Transaction tx = getTransactionIfExists();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ public void insertDistributedTraceHeaders(Headers headers) {
@Override
public void acceptDistributedTraceHeaders(TransportType transportType, Headers headers) {
}

@Override
public String getGuid() {
return null;
}
};

private static final Token TOKEN = new Token() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,11 @@ public interface Transaction {
*/
void acceptDistributedTraceHeaders(TransportType transportType, Headers headers);


/**
* Return the GUID for this transaction.
*
* @return the GUID for this transaction.
*/
String getGuid();
}

0 comments on commit 4e24ce7

Please sign in to comment.