Package com.amazonaws.xray.entities
Interface Segment
-
- All Superinterfaces:
java.lang.AutoCloseable,Entity
- All Known Implementing Classes:
DummySegment,FacadeSegment,NoOpSegment,SegmentImpl
public interface Segment extends Entity
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()booleanend()Ends the segment.java.util.Map<java.lang.String,java.lang.Object>getAnnotations()java.lang.StringgetOrigin()SegmentgetParentSegment()java.lang.StringgetResourceArn()java.util.Map<java.lang.String,java.lang.Object>getService()java.lang.StringgetUser()booleanisRecording()Returns if thisSegmentis recording events and will be emitted.static SegmentnoOp(TraceID traceId, AWSXRayRecorder recorder)voidputAllService(java.util.Map<java.lang.String,java.lang.Object> all)Puts information about this service.voidputService(java.lang.String key, java.lang.Object object)Puts information about this service.voidsetOrigin(java.lang.String origin)voidsetResourceArn(java.lang.String resourceArn)voidsetRuleName(java.lang.String name)voidsetSampled(boolean sampled)voidsetService(java.util.Map<java.lang.String,java.lang.Object> service)voidsetUser(java.lang.String user)-
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 Detail
-
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()
-
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
java.lang.String getResourceArn()
- Returns:
- the resourceArn
-
setResourceArn
void setResourceArn(java.lang.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
java.lang.String getUser()
- Returns:
- the user
-
setUser
void setUser(java.lang.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
java.lang.String getOrigin()
- Returns:
- the origin
-
setOrigin
void setOrigin(java.lang.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
java.util.Map<java.lang.String,java.lang.Object> getService()
- Returns:
- the service
-
setService
void setService(java.util.Map<java.lang.String,java.lang.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
java.util.Map<java.lang.String,java.lang.Object> getAnnotations()
- Specified by:
getAnnotationsin interfaceEntity- Returns:
- the annotations
-
putService
void putService(java.lang.String key, java.lang.Object object)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
void putAllService(java.util.Map<java.lang.String,java.lang.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(java.lang.String name)
-
getParentSegment
Segment getParentSegment()
- Specified by:
getParentSegmentin interfaceEntity
-
close
void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-