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.
public InvocationContext(@NotNull InvocationOrigin origin, @NotNull Trace trace, @Nullable Actor actor, @Nullable Trace externalTrace, @Nullable Actor impersonatedActor, @Nullable java.util.List<? extends java.lang.Object> arguments, @Nullable java.lang.String clientId)
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 InvocationContext(@NotNull InvocationOrigin origin, @NotNull Trace trace, @Nullable Actor actor, @Nullable Trace externalTrace, @Nullable Actor impersonatedActor)
@NotNull public java.security.Principal principal()
Associated security principal.
@NotNull public InvocationContext copy(@NotNull InvocationOrigin origin, @NotNull Trace trace, @Nullable Actor actor, @Nullable Trace externalTrace, @Nullable Actor impersonatedActor)
@NotNull public InvocationOrigin getOrigin()
Origin of the invocation.
@NotNull public Trace getTrace()
Corda invocation trace.
@Nullable public Actor getActor()
Acting agent of the invocation,
used to derive the security principal.
@Nullable public Trace getExternalTrace()
Optional external invocation trace for cross-system logs correlation.
@Nullable public Actor getImpersonatedActor()
Optional impersonated actor,
used for logging but not for authorisation.
@Nullable public java.util.List<java.lang.Object> getArguments()
@Nullable public java.lang.String getClientId()
@NotNull public InvocationOrigin component1()
Origin of the invocation.
@NotNull public Trace component2()
Corda invocation trace.
@Nullable public Actor component3()
Acting agent of the invocation,
used to derive the security principal.
@Nullable public Trace component4()
Optional external invocation trace for cross-system logs correlation.
@Nullable public Actor component5()
Optional impersonated actor,
used for logging but not for authorisation.
@Nullable public java.util.List<java.lang.Object> component6()
@Nullable public java.lang.String component7()
@NotNull public InvocationContext copy(@NotNull InvocationOrigin origin, @NotNull Trace trace, @Nullable Actor actor, @Nullable Trace externalTrace, @Nullable Actor impersonatedActor, @Nullable java.util.List<? extends java.lang.Object> arguments, @Nullable java.lang.String clientId)
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.
@NotNull public java.lang.String toString()
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 int hashCode()
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 boolean equals(@Nullable java.lang.Object p)
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.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext newInstance(@NotNull InvocationOrigin origin, @NotNull Trace trace, @Nullable Actor actor, @Nullable Trace externalTrace, @Nullable Actor impersonatedActor, @NotNull java.util.List<? extends java.lang.Object> arguments, @Nullable java.lang.String clientId)
Creates an class InvocationContext
with a class Trace
that defaults to a java.util.UUID as value and java.time.Instant.now timestamp.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext newInstance(@NotNull InvocationOrigin origin, @NotNull Trace trace, @Nullable Actor actor, @Nullable Trace externalTrace, @Nullable Actor impersonatedActor, @NotNull java.util.List<? extends java.lang.Object> arguments)
Creates an class InvocationContext
with a class Trace
that defaults to a java.util.UUID as value and java.time.Instant.now timestamp.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext newInstance(@NotNull InvocationOrigin origin, @NotNull Trace trace, @Nullable Actor actor, @Nullable Trace externalTrace, @Nullable 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.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext newInstance(@NotNull InvocationOrigin origin, @NotNull Trace trace, @Nullable Actor actor, @Nullable Trace externalTrace)
Creates an class InvocationContext
with a class Trace
that defaults to a java.util.UUID as value and java.time.Instant.now timestamp.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext newInstance(@NotNull InvocationOrigin origin, @NotNull Trace trace, @Nullable Actor actor)
Creates an class InvocationContext
with a class Trace
that defaults to a java.util.UUID as value and java.time.Instant.now timestamp.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext newInstance(@NotNull InvocationOrigin origin, @NotNull Trace trace)
Creates an class InvocationContext
with a class Trace
that defaults to a java.util.UUID as value and java.time.Instant.now timestamp.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext newInstance(@NotNull InvocationOrigin origin)
Creates an class InvocationContext
with a class Trace
that defaults to a java.util.UUID as value and java.time.Instant.now timestamp.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext rpc(@NotNull Actor actor, @NotNull Trace trace, @Nullable Trace externalTrace, @Nullable Actor impersonatedActor, @NotNull java.util.List<? extends java.lang.Object> arguments)
Creates an class InvocationContext
with class InvocationOrigin.RPC
origin.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext rpc(@NotNull Actor actor, @NotNull Trace trace, @Nullable Trace externalTrace, @Nullable Actor impersonatedActor)
Creates an class InvocationContext
with class InvocationOrigin.RPC
origin.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext rpc(@NotNull Actor actor, @NotNull Trace trace, @Nullable Trace externalTrace)
Creates an class InvocationContext
with class InvocationOrigin.RPC
origin.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext rpc(@NotNull Actor actor, @NotNull Trace trace)
Creates an class InvocationContext
with class InvocationOrigin.RPC
origin.
@JvmStatic @JvmOverloads @NotNull public static InvocationContext rpc(@NotNull Actor actor)
Creates an class InvocationContext
with class InvocationOrigin.RPC
origin.
@JvmStatic @NotNull public static InvocationContext peer(@NotNull CordaX500Name party, @NotNull Trace trace, @Nullable Trace externalTrace, @Nullable Actor impersonatedActor)
Creates an class InvocationContext
with class InvocationOrigin.Peer
origin.
@JvmStatic @NotNull public static InvocationContext service(@NotNull java.lang.String serviceClassName, @NotNull CordaX500Name owningLegalIdentity, @NotNull Trace trace, @Nullable Trace externalTrace)
Creates an class InvocationContext
with class InvocationOrigin.Service
origin.
@JvmStatic @NotNull public static InvocationContext scheduled(@NotNull ScheduledStateRef scheduledState, @NotNull Trace trace, @Nullable Trace externalTrace)
Creates an class InvocationContext
with class InvocationOrigin.Scheduled
origin.
@JvmStatic @NotNull public static InvocationContext shell(@NotNull Trace trace, @Nullable Trace externalTrace)
Creates an class InvocationContext
with class InvocationOrigin.Shell
origin.