Package com.amazonaws.xray.entities
Class SegmentImpl
- java.lang.Object
-
- com.amazonaws.xray.entities.EntityImpl
-
- com.amazonaws.xray.entities.SegmentImpl
-
public class SegmentImpl extends EntityImpl implements Segment
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
origin
protected java.lang.String
resourceArn
protected java.util.Map<java.lang.String,java.lang.Object>
service
protected java.lang.String
user
-
Fields inherited from class com.amazonaws.xray.entities.EntityImpl
ended, lock, mapper, referenceCount, totalSize
-
-
Constructor Summary
Constructors Constructor Description SegmentImpl(AWSXRayRecorder creator, java.lang.String name)
SegmentImpl(AWSXRayRecorder creator, java.lang.String name, TraceID traceId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
end()
Ends the segment.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.boolean
isSampled()
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 ruleName)
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 class com.amazonaws.xray.entities.EntityImpl
addException, addSubsegment, checkAlreadyEmitted, compareAndSetEmitted, decrementReferenceCount, getAnnotations, getAws, getCause, getCreator, getEndTime, getHttp, getId, getMetadata, getName, getNamespace, getParent, getParentId, getReferenceCount, getSql, getStartTime, getSubsegments, getSubsegmentsCopy, getSubsegmentsLock, getTotalSize, getTraceId, incrementReferenceCount, isEmitted, isError, isFault, isInProgress, isThrottle, prettySerialize, putAllAws, putAllHttp, putAllSql, putAnnotation, putAnnotation, putAnnotation, putAws, putHttp, putMetadata, putMetadata, putSql, removeSubsegment, serialize, setAnnotations, setAws, setCreator, setEmitted, setEndTime, setError, setFault, setHttp, setId, setInProgress, setMetadata, setNamespace, setParent, setParentId, setSql, setStartTime, setSubsegmentsLock, setThrottle, setTraceId, validateNotNull
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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, 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
-
Methods inherited from interface com.amazonaws.xray.entities.Segment
getAnnotations
-
-
-
-
Constructor Detail
-
SegmentImpl
public SegmentImpl(AWSXRayRecorder creator, java.lang.String name)
-
SegmentImpl
public SegmentImpl(AWSXRayRecorder creator, java.lang.String name, TraceID traceId)
-
-
Method Detail
-
end
public boolean end()
Description copied from interface:Segment
Ends the segment. Sets the end time to the current time. Sets inProgress to false.
-
isRecording
public boolean isRecording()
Description copied from interface:Segment
Returns if thisSegment
is recording events and will be emitted. Any operations on aSegment
which is not recording are effectively no-op.- Specified by:
isRecording
in interfaceSegment
-
isSampled
public boolean isSampled()
-
setSampled
public void setSampled(boolean sampled)
- Specified by:
setSampled
in interfaceSegment
- Parameters:
sampled
- the sampled to set
-
getResourceArn
public java.lang.String getResourceArn()
- Specified by:
getResourceArn
in interfaceSegment
- Returns:
- the resourceArn
-
setResourceArn
public void setResourceArn(java.lang.String resourceArn)
- Specified by:
setResourceArn
in interfaceSegment
- Parameters:
resourceArn
- the resourceArn to set
-
getUser
public java.lang.String getUser()
-
setUser
public void setUser(java.lang.String user)
-
getOrigin
public java.lang.String getOrigin()
-
setOrigin
public void setOrigin(java.lang.String origin)
-
getService
public java.util.Map<java.lang.String,java.lang.Object> getService()
- Specified by:
getService
in interfaceSegment
- Returns:
- the service
-
setService
public void setService(java.util.Map<java.lang.String,java.lang.Object> service)
- Specified by:
setService
in interfaceSegment
- Parameters:
service
- the service to set
-
putService
public void putService(java.lang.String key, java.lang.Object object)
Description copied from interface:Segment
Puts information about this service.- Specified by:
putService
in interfaceSegment
- Parameters:
key
- the key under which the service information is storedobject
- the service information
-
putAllService
public void putAllService(java.util.Map<java.lang.String,java.lang.Object> all)
Description copied from interface:Segment
Puts information about this service.- Specified by:
putAllService
in interfaceSegment
- Parameters:
all
- the service information to set.
-
setRuleName
public void setRuleName(java.lang.String ruleName)
- Specified by:
setRuleName
in interfaceSegment
-
getParentSegment
public Segment getParentSegment()
- Specified by:
getParentSegment
in interfaceEntity
- Specified by:
getParentSegment
in interfaceSegment
- Specified by:
getParentSegment
in classEntityImpl
-
-