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 void
close()
boolean
end()
Ends the segment.java.util.Map<java.lang.String,java.lang.Object>
getAnnotations()
java.lang.String
getOrigin()
Segment
getParentSegment()
java.lang.String
getResourceArn()
java.util.Map<java.lang.String,java.lang.Object>
getService()
java.lang.String
getUser()
boolean
isRecording()
Returns if thisSegment
is recording events and will be emitted.static Segment
noOp(TraceID traceId, AWSXRayRecorder recorder)
void
putAllService(java.util.Map<java.lang.String,java.lang.Object> all)
Puts information about this service.void
putService(java.lang.String key, java.lang.Object object)
Puts information about this service.void
setOrigin(java.lang.String origin)
void
setResourceArn(java.lang.String resourceArn)
void
setRuleName(java.lang.String name)
void
setSampled(boolean sampled)
void
setService(java.util.Map<java.lang.String,java.lang.Object> service)
void
setUser(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:
getAnnotations
in 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:
getParentSegment
in interfaceEntity
-
close
void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-