Package com.amazonaws.xray.entities
Interface Segment
- All Superinterfaces:
AutoCloseable
,Entity
- All Known Implementing Classes:
DummySegment
,FacadeSegment
,NoOpSegment
,SegmentImpl
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
end()
Ends the segment.getUser()
boolean
Returns if thisSegment
is recording events and will be emitted.static Segment
noOp
(TraceID traceId, AWSXRayRecorder recorder) void
putAllService
(Map<String, Object> all) Puts information about this service.void
putService
(String key, Object object) Puts information about this service.void
void
setResourceArn
(String resourceArn) void
setRuleName
(String name) void
setSampled
(boolean sampled) void
setService
(Map<String, Object> service) void
Methods inherited from interface com.amazonaws.xray.entities.Entity
addException, addSubsegment, compareAndSetEmitted, decrementReferenceCount, getAws, getCause, getCreator, getEndTime, getHttp, getId, getMetadata, getName, getNamespace, getParent, getParentId, getReferenceCount, getSql, getStartTime, getSubsegments, getSubsegmentsCopy, getSubsegmentsLock, getTotalSize, getTraceId, incrementReferenceCount, isEmitted, isError, isFault, isInProgress, isSampled, isThrottle, prettySerialize, putAllAws, putAllHttp, putAllSql, putAnnotation, putAnnotation, putAnnotation, putAws, putHttp, putMetadata, putMetadata, putSql, removeSubsegment, run, run, serialize, setAnnotations, setAws, setCreator, setEmitted, setEndTime, setError, setFault, setHttp, setId, setInProgress, setMetadata, setNamespace, setParent, setParentId, setSql, setStartTime, setSubsegmentsLock, setThrottle, setTraceId
-
Method Details
-
noOp
-
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() -
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
- 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
- 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
- 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
- Returns:
- the service
-
setService
- 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
- Specified by:
getAnnotations
in interfaceEntity
- Returns:
- the annotations
-
putService
Puts information about this service.- Parameters:
key
- the key under which the service information is storedobject
- 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
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
-
getParentSegment
Segment getParentSegment()- Specified by:
getParentSegment
in interfaceEntity
-
close
void close()- Specified by:
close
in interfaceAutoCloseable
-