- All Implemented Interfaces:
Serializable
,Comparable<Correlation>
,java.lang.constant.Constable
,org.refcodes.mixin.IdAccessor<String>
,org.refcodes.mixin.IdAccessor.IdMutator<String>
,org.refcodes.mixin.IdAccessor.IdProperty<String>
public enum Correlation extends Enum<Correlation> implements org.refcodes.mixin.IdAccessor.IdProperty<String>
The
Correlation
assigns an according (as of the enumeration)
Correlation-TID to the invoking process, this TID is used in log files and is
part of the process's request or response pay-load in order to track process
execution throughout a JVM.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface org.refcodes.mixin.IdAccessor
org.refcodes.mixin.IdAccessor.IdBuilder<T extends Object,B extends org.refcodes.mixin.IdAccessor.IdBuilder<T,B>>, org.refcodes.mixin.IdAccessor.IdMutator<T extends Object>, org.refcodes.mixin.IdAccessor.IdProperty<T extends Object>
-
Enum Constant Summary
-
Method Summary
Modifier and Type Method Description String
getId()
Retrieves the Correlation-TID assigned to the currentThread
.static boolean
hasAnyCorrelationId()
Evaluates whether any of the given Correlation-IDs is present (not null).String
nextId()
Creates a new Correlation-TID no matter whether there is a Correlation-TID already assigned to the current thread or not.String
pullId()
Returns a Correlation-TID in any case: Creates a new Correlation-TID in case there is none yet for the current thread.void
setId(String aCorrelationId)
Assigns the given Correlation-TID to the currentThread
.static String
toFullCorrelationId()
Returns aString
with all Correlation-IDs found separated by aDelimiter.CORRELATION_ID
character from each other.static Correlation
valueOf(String name)
Returns the enum constant of this type with the specified name.static Correlation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface org.refcodes.mixin.IdAccessor.IdProperty
letId
-
Enum Constant Details
-
REQUEST
A single request spanning over multiple systems. -
SESSION
Identifying a session for multiple requests spanning over multiple systems. traced.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
setId
Assigns the given Correlation-TID to the currentThread
. -
getId
-
pullId
Returns a Correlation-TID in any case: Creates a new Correlation-TID in case there is none yet for the current thread. Else the current Correlation-TID is returned.- Returns:
- The Correlation-TID as of now.
-
nextId
Creates a new Correlation-TID no matter whether there is a Correlation-TID already assigned to the current thread or not.- Returns:
- the string
-
toFullCorrelationId
Returns aString
with all Correlation-IDs found separated by aDelimiter.CORRELATION_ID
character from each other. Any portion of the full Correlation-TID not being set is represented by a "<?>" sequence defined byLiteral.UNKNOWN
.- Returns:
- The full Correlation-TID.
-
hasAnyCorrelationId
public static boolean hasAnyCorrelationId()Evaluates whether any of the given Correlation-IDs is present (not null).- Returns:
- True if at least one Correlation-TID is not null.
-