Interface Segment

All Superinterfaces:
AutoCloseable, Entity
All Known Implementing Classes:
DummySegment, FacadeSegment, NoOpSegment, SegmentImpl

public interface Segment extends Entity
  • Method Details

    • noOp

      static Segment noOp(TraceID traceId, AWSXRayRecorder recorder)
    • end

      boolean end()
      Ends the segment. Sets the end time to the current time. Sets inProgress to false.
      Returns:
      true if 1) the reference count is less than or equal to zero and 2) sampled is true
    • isRecording

      boolean isRecording()
      Returns if this Segment is recording events and will be emitted. Any operations on a Segment which is not recording are effectively no-op.
    • setSampled

      void setSampled(boolean sampled)
      Parameters:
      sampled - the sampled to set
      Throws:
      AlreadyEmittedException - if the entity has already been emitted to the X-Ray daemon and the ContextMissingStrategy of the AWSXRayRecorder used to create this entity is configured to throw exceptions
    • getResourceArn

      String getResourceArn()
      Returns:
      the resourceArn
    • setResourceArn

      void setResourceArn(String resourceArn)
      Parameters:
      resourceArn - the resourceArn to set
      Throws:
      AlreadyEmittedException - if the entity has already been emitted to the X-Ray daemon and the ContextMissingStrategy of the AWSXRayRecorder used to create this entity is configured to throw exceptions
    • getUser

      String getUser()
      Returns:
      the user
    • setUser

      void setUser(String user)
      Parameters:
      user - the user to set
      Throws:
      AlreadyEmittedException - if the entity has already been emitted to the X-Ray daemon and the ContextMissingStrategy of the AWSXRayRecorder used to create this entity is configured to throw exceptions
    • getOrigin

      String getOrigin()
      Returns:
      the origin
    • setOrigin

      void setOrigin(String origin)
      Parameters:
      origin - the origin to set
      Throws:
      AlreadyEmittedException - if the entity has already been emitted to the X-Ray daemon and the ContextMissingStrategy of the AWSXRayRecorder used to create this entity is configured to throw exceptions
    • getService

      Map<String,Object> getService()
      Returns:
      the service
    • setService

      void setService(Map<String,Object> service)
      Parameters:
      service - the service to set
      Throws:
      AlreadyEmittedException - if the entity has already been emitted to the X-Ray daemon and the ContextMissingStrategy of the AWSXRayRecorder used to create this entity is configured to throw exceptions
    • getAnnotations

      Map<String,Object> getAnnotations()
      Specified by:
      getAnnotations in interface Entity
      Returns:
      the annotations
    • putService

      void putService(String key, Object object)
      Puts information about this service.
      Parameters:
      key - the key under which the service information is stored
      object - the service information
      Throws:
      AlreadyEmittedException - if the entity has already been emitted to the X-Ray daemon and the ContextMissingStrategy of the AWSXRayRecorder used to create this entity is configured to throw exceptions
    • putAllService

      void putAllService(Map<String,Object> all)
      Puts information about this service.
      Parameters:
      all - the service information to set.
      Throws:
      AlreadyEmittedException - if the entity has already been emitted to the X-Ray daemon and the ContextMissingStrategy of the AWSXRayRecorder used to create this entity is configured to throw exceptions
    • setRuleName

      void setRuleName(String name)
    • getParentSegment

      Segment getParentSegment()
      Specified by:
      getParentSegment in interface Entity
    • close

      void close()
      Specified by:
      close in interface AutoCloseable