Class RntbdResponse
- java.lang.Object
-
- com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdResponse
-
- All Implemented Interfaces:
io.netty.util.ReferenceCounted
public final class RntbdResponse extends Object implements io.netty.util.ReferenceCounted
-
-
Constructor Summary
Constructors Constructor Description RntbdResponse(UUID activityId, int statusCode, Map<String,String> map, io.netty.buffer.ByteBuf content)Initializes a newRntbdResponseinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidencode(io.netty.buffer.ByteBuf out)Serializes the currentresponseto the givenbyte buffer.UUIDgetActivityId()io.netty.buffer.ByteBufgetContent()<T> TgetHeader(com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdConstants.RntbdResponseHeader header)Returns the value of the givenresponseheader.com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdResponseHeadersgetHeaders()intgetMessageLength()io.netty.handler.codec.http.HttpResponseStatusgetStatus()LonggetTransportRequestId()booleanhasPayload()Returnstrueif thisresponsehas a payload.intrefCnt()Returns the reference count of this object.booleanrelease()Decreases the reference count by1.booleanrelease(int decrement)Decreases the reference count bydecrementand deallocates this response if the count reaches0.RntbdResponseretain()Increases the reference count by1.RntbdResponseretain(int increment)Increases the reference count by the specifiedincrement.StringtoString()RntbdResponsetouch()Records the current access location of this object for debugging purposesRntbdResponsetouch(Object hint)Records the current access location of this object with additional arbitrary information for debugging purposes
-
-
-
Constructor Detail
-
RntbdResponse
public RntbdResponse(UUID activityId, int statusCode, Map<String,String> map, io.netty.buffer.ByteBuf content)
Initializes a newRntbdResponseinstance.This method is provided for testing purposes only. It should not be used in product code.
- Parameters:
activityId- an activity IDstatusCode- a response status code.map- a collection of response headers.content- a body to be copied to the response.
-
-
Method Detail
-
getActivityId
public UUID getActivityId()
-
getContent
public io.netty.buffer.ByteBuf getContent()
-
getHeaders
public com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdResponseHeaders getHeaders()
-
getMessageLength
public int getMessageLength()
-
getStatus
public io.netty.handler.codec.http.HttpResponseStatus getStatus()
-
getTransportRequestId
public Long getTransportRequestId()
-
encode
public void encode(io.netty.buffer.ByteBuf out)
Serializes the currentresponseto the givenbyte buffer.- Parameters:
out- the outputbyte buffer.
-
getHeader
public <T> T getHeader(com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdConstants.RntbdResponseHeader header)
Returns the value of the givenresponseheader.
-
hasPayload
public boolean hasPayload()
Returnstrueif thisresponsehas a payload.- Returns:
trueif thisresponsehas a payload;falseotherwise.
-
refCnt
public int refCnt()
Returns the reference count of this object. If0, it means this object has been deallocated.- Specified by:
refCntin interfaceio.netty.util.ReferenceCounted
-
release
public boolean release()
Decreases the reference count by1.The current
responseis deallocated if the count reaches0.- Specified by:
releasein interfaceio.netty.util.ReferenceCounted- Returns:
trueif and only if the reference count became0and this response is deallocated.
-
release
public boolean release(int decrement)
Decreases the reference count bydecrementand deallocates this response if the count reaches0.- Specified by:
releasein interfaceio.netty.util.ReferenceCounted- Parameters:
decrement- amount of the decrease.- Returns:
trueif and only if the reference count became0and this response has been deallocated.
-
retain
public RntbdResponse retain()
Increases the reference count by1.- Specified by:
retainin interfaceio.netty.util.ReferenceCounted
-
retain
public RntbdResponse retain(int increment)
Increases the reference count by the specifiedincrement.- Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Parameters:
increment- amount of the increase
-
touch
public RntbdResponse touch()
Records the current access location of this object for debugging purposesIf this object is determined to be leaked, the information recorded by this operation will be provided to you via
ResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
touch
public RntbdResponse touch(Object hint)
Records the current access location of this object with additional arbitrary information for debugging purposesIf this object is determined to be leaked, the information recorded by this operation will be provided to you via
ResourceLeakDetector.- Specified by:
touchin interfaceio.netty.util.ReferenceCounted- Parameters:
hint- information useful for debugging (unused)
-
-