public final class CorrelationContext extends Object
Modifier and Type | Method and Description |
---|---|
void |
clearId()
Sets the Correlation ID to
null . |
static CorrelationContext |
create()
Creates a Correlation Context.
|
String |
getId()
Returns the current Correlation ID,
null if no Correlation ID is in context. |
void |
setId(String correlationId)
Sets the Correlation ID.
|
<V> V |
withId(String correlationId,
Callable<V> task)
Computes the result of the
task with the correlation context ID being set to correlationId . |
public static CorrelationContext create()
@Nullable public String getId()
null
if no Correlation ID is in context.public void setId(@Nullable String correlationId)
correlationId
is null
, a correlation id is
generated.public void clearId()
null
.public <V> V withId(@Nullable String correlationId, Callable<V> task) throws Exception
task
with the correlation context ID being set to correlationId
. The correlation id is cleared from the context after the completion of the
task. If correlationId
is null
, a correlation ID is generated.Exception
Copyright © 2020 Cerner Innovation, Inc.. All rights reserved.