Class TraceID

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

public class TraceID extends Object
  • 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

      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(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 String toString()
      Overrides:
      toString in class Object
    • getNumber

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

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

      @Deprecated public void setNumber(@Nullable 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 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 Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object