Class TraceID

java.lang.Object
com.amazonaws.xray.entities.TraceID

public class TraceID
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    TraceID()
    Deprecated.
    TraceID​(long startTime)
    Deprecated.
  • Method Summary

    Modifier and Type Method Description
    static TraceID create()
    Returns a new TraceID which represents the start of a new trace.
    static TraceID create​(AWSXRayRecorder creator)
    Returns a new TraceID which represents the start of a new trace.
    boolean equals​(@Nullable java.lang.Object obj)  
    static TraceID fromString​(java.lang.String xrayTraceId)
    Returns the TraceID parsed out of the String.
    java.math.BigInteger getNumber()
    Deprecated.
    java.lang.String getNumberAsHex()
    Returns the number component of this TraceID as a hexadecimal string.
    long getStartTime()
    Deprecated.
    java.lang.String getStartTimeAsHex()
    Returns the start time of this TraceID as a hexadecimal string representing the number of seconds since the epoch.
    int hashCode()  
    static TraceID invalid()
    Returns an invalid TraceID which can be used when an ID is needed outside the context of a trace, for example for an unsampled segment.
    void setNumber​(@Nullable java.math.BigInteger number)
    Deprecated.
    TraceID is effectively immutable and this will be removed
    void setStartTime​(long startTime)
    Deprecated.
    TraceID is effectively immutable and this will be removed
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • create

      public static TraceID create()
      Returns a new TraceID which represents the start of a new trace. This new ID is generated according to the settings provided by the global AWSXRayRecorder instance returned by AWSXRay.getGlobalRecorder().
      See Also:
      create(AWSXRayRecorder)
    • create

      public static TraceID create​(AWSXRayRecorder creator)
      Returns a new TraceID which represents the start of a new trace. This new ID is generated according to the settings provided by the AWSXRayRecorder instance that created it.
    • fromString

      public static TraceID fromString​(java.lang.String xrayTraceId)
      Returns the TraceID parsed out of the String. If the parse fails, a new TraceID will be returned, effectively restarting the trace.
    • invalid

      public static TraceID invalid()
      Returns an invalid TraceID which can be used when an ID is needed outside the context of a trace, for example for an unsampled segment.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • getNumber

      @Deprecated public java.math.BigInteger getNumber()
      Deprecated.
      Returns:
      the number
    • getNumberAsHex

      public java.lang.String getNumberAsHex()
      Returns the number component of this TraceID as a hexadecimal string.
    • setNumber

      @Deprecated public void setNumber​(@Nullable java.math.BigInteger number)
      Deprecated.
      TraceID is effectively immutable and this will be removed
      Parameters:
      number - the number to set
    • getStartTime

      public long getStartTime()
      Deprecated.
      Returns:
      the startTime
    • getStartTimeAsHex

      public java.lang.String getStartTimeAsHex()
      Returns the start time of this TraceID as a hexadecimal string representing the number of seconds since the epoch.
    • setStartTime

      @Deprecated public void setStartTime​(long startTime)
      Deprecated.
      TraceID is effectively immutable and this will be removed
      Parameters:
      startTime - the startTime to set
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(@Nullable java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object