public class InvocationContext
Models the information needed to trace an invocation in Corda. Includes initiating actor, origin, trace information, and optional external trace information to correlate clients' IDs.
Modifier and Type | Class and Description |
---|---|
static class |
InvocationContext.Companion |
Modifier and Type | Field and Description |
---|---|
static InvocationContext.Companion |
Companion |
Constructor and Description |
---|
InvocationContext(InvocationOrigin origin,
Trace trace,
Actor actor,
Trace externalTrace,
Actor impersonatedActor)
Models the information needed to trace an invocation in Corda.
Includes initiating actor, origin, trace information, and optional external trace information to correlate clients' IDs.
|
Modifier and Type | Method and Description |
---|---|
InvocationOrigin |
component1()
Origin of the invocation.
|
Trace |
component2()
Corda invocation trace.
|
Actor |
component3()
Acting agent of the invocation,
|
Trace |
component4()
Optional external invocation trace for cross-system logs correlation.
|
Actor |
component5()
Optional impersonated actor,
|
InvocationContext |
copy(InvocationOrigin origin,
Trace trace,
Actor actor,
Trace externalTrace,
Actor impersonatedActor)
Models the information needed to trace an invocation in Corda.
Includes initiating actor, origin, trace information, and optional external trace information to correlate clients' IDs.
|
boolean |
equals(java.lang.Object p) |
Actor |
getActor()
Acting agent of the invocation,
|
Trace |
getExternalTrace()
Optional external invocation trace for cross-system logs correlation.
|
Actor |
getImpersonatedActor()
Optional impersonated actor,
|
InvocationOrigin |
getOrigin()
Origin of the invocation.
|
Trace |
getTrace()
Corda invocation trace.
|
int |
hashCode() |
static InvocationContext |
newInstance(InvocationOrigin origin,
Trace trace,
Actor actor,
Trace externalTrace,
Actor impersonatedActor)
Creates an
class InvocationContext with a class Trace that defaults to a java.util.UUID as value and java.time.Instant.now timestamp. |
static InvocationContext |
peer(CordaX500Name party,
Trace trace,
Trace externalTrace,
Actor impersonatedActor)
Creates an
class InvocationContext with class InvocationOrigin.Peer origin. |
java.security.Principal |
principal()
Associated security principal.
|
static InvocationContext |
rpc(Actor actor,
Trace trace,
Trace externalTrace,
Actor impersonatedActor)
Creates an
class InvocationContext with class InvocationOrigin.RPC origin. |
static InvocationContext |
scheduled(ScheduledStateRef scheduledState,
Trace trace,
Trace externalTrace)
Creates an
class InvocationContext with class InvocationOrigin.Scheduled origin. |
static InvocationContext |
service(java.lang.String serviceClassName,
CordaX500Name owningLegalIdentity,
Trace trace,
Trace externalTrace)
Creates an
class InvocationContext with class InvocationOrigin.Service origin. |
static InvocationContext |
shell(Trace trace,
Trace externalTrace)
Creates an
class InvocationContext with class InvocationOrigin.Shell origin. |
java.lang.String |
toString() |
public static InvocationContext.Companion Companion
public InvocationContext(InvocationOrigin origin, Trace trace, Actor actor, Trace externalTrace, Actor impersonatedActor)
Models the information needed to trace an invocation in Corda. Includes initiating actor, origin, trace information, and optional external trace information to correlate clients' IDs.
origin
- Origin of the invocation.trace
- Corda invocation trace.actor
- Acting agent of the invocation, used to derive the security principal.externalTrace
- Optional external invocation trace for cross-system logs correlation.impersonatedActor
- Optional impersonated actor, used for logging but not for authorisation.public java.security.Principal principal()
Associated security principal.
public InvocationOrigin getOrigin()
Origin of the invocation.
public Trace getTrace()
Corda invocation trace.
public Actor getActor()
Acting agent of the invocation,
used to derive the security principal.
public Trace getExternalTrace()
Optional external invocation trace for cross-system logs correlation.
public Actor getImpersonatedActor()
Optional impersonated actor,
used for logging but not for authorisation.
public InvocationOrigin component1()
Origin of the invocation.
public Trace component2()
Corda invocation trace.
public Actor component3()
Acting agent of the invocation,
used to derive the security principal.
public Trace component4()
Optional external invocation trace for cross-system logs correlation.
public Actor component5()
Optional impersonated actor,
used for logging but not for authorisation.
public InvocationContext copy(InvocationOrigin origin, Trace trace, Actor actor, Trace externalTrace, Actor impersonatedActor)
Models the information needed to trace an invocation in Corda. Includes initiating actor, origin, trace information, and optional external trace information to correlate clients' IDs.
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)
public static InvocationContext newInstance(InvocationOrigin origin, Trace trace, Actor actor, Trace externalTrace, Actor impersonatedActor)
Creates an class InvocationContext
with a class Trace
that defaults to a java.util.UUID as value and java.time.Instant.now timestamp.
public static InvocationContext rpc(Actor actor, Trace trace, Trace externalTrace, Actor impersonatedActor)
Creates an class InvocationContext
with class InvocationOrigin.RPC
origin.
public static InvocationContext peer(CordaX500Name party, Trace trace, Trace externalTrace, Actor impersonatedActor)
Creates an class InvocationContext
with class InvocationOrigin.Peer
origin.
public static InvocationContext service(java.lang.String serviceClassName, CordaX500Name owningLegalIdentity, Trace trace, Trace externalTrace)
Creates an class InvocationContext
with class InvocationOrigin.Service
origin.
public static InvocationContext scheduled(ScheduledStateRef scheduledState, Trace trace, Trace externalTrace)
Creates an class InvocationContext
with class InvocationOrigin.Scheduled
origin.
public static InvocationContext shell(Trace trace, Trace externalTrace)
Creates an class InvocationContext
with class InvocationOrigin.Shell
origin.