Package com.fayupable.logged.core.model
Record Class MethodInvocationEvent
java.lang.Object
java.lang.Record
com.fayupable.logged.core.model.MethodInvocationEvent
- Record Components:
className- the simple or fully qualified name of the class declaring the invoked methodmethodName- the name of the invoked methodtimestamp- the instant at which the invocation starteddurationNanos- the wall-clock duration of the invocation, in nanosecondssuccess-trueif the method returned normally,falseif it threw an exceptionexceptionType- the simple class name of the exception thrown by the method, ornullif the call succeeded; the exception message is never captured here, since it may contain sensitive datacallerIdentity- an opaque identifier describing who triggered the call (for example an authenticated user id or a client IP address), resolved by an adapter-specific implementationtraceId- theFlowContext.traceId()shared by every call in the same chain of nested@Loggedinvocations, allowing log output to be reconstructed as a single call chaindepth- theFlowContext.depth()of this invocation within its call chain, with 0 marking the root call
public record MethodInvocationEvent(String className, String methodName, Instant timestamp, long durationNanos, boolean success, String exceptionType, String callerIdentity, String traceId, int depth)
extends Record
Immutable record describing a single method invocation captured by a
Logged interceptor.
This event deliberately contains no method arguments and no return value. Only metadata about the call is recorded, so this event can be logged, exported as a metric, or sent to any sink without any risk of leaking sensitive data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecallerIdentityrecord component.Returns the value of theclassNamerecord component.intdepth()Returns the value of thedepthrecord component.longReturns the value of thedurationNanosrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexceptionTyperecord component.final inthashCode()Returns a hash code value for this object.Returns the value of themethodNamerecord component.booleansuccess()Returns the value of thesuccessrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.traceId()Returns the value of thetraceIdrecord component.
-
Constructor Details
-
MethodInvocationEvent
public MethodInvocationEvent(String className, String methodName, Instant timestamp, long durationNanos, boolean success, String exceptionType, String callerIdentity, String traceId, int depth) Creates an instance of aMethodInvocationEventrecord class.- Parameters:
className- the value for theclassNamerecord componentmethodName- the value for themethodNamerecord componenttimestamp- the value for thetimestamprecord componentdurationNanos- the value for thedurationNanosrecord componentsuccess- the value for thesuccessrecord componentexceptionType- the value for theexceptionTyperecord componentcallerIdentity- the value for thecallerIdentityrecord componenttraceId- the value for thetraceIdrecord componentdepth- the value for thedepthrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
className
Returns the value of theclassNamerecord component.- Returns:
- the value of the
classNamerecord component
-
methodName
Returns the value of themethodNamerecord component.- Returns:
- the value of the
methodNamerecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
durationNanos
public long durationNanos()Returns the value of thedurationNanosrecord component.- Returns:
- the value of the
durationNanosrecord component
-
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
exceptionType
Returns the value of theexceptionTyperecord component.- Returns:
- the value of the
exceptionTyperecord component
-
callerIdentity
Returns the value of thecallerIdentityrecord component.- Returns:
- the value of the
callerIdentityrecord component
-
traceId
Returns the value of thetraceIdrecord component.- Returns:
- the value of the
traceIdrecord component
-
depth
public int depth()Returns the value of thedepthrecord component.- Returns:
- the value of the
depthrecord component
-