Class RntbdResponse

  • All Implemented Interfaces:
    io.netty.util.ReferenceCounted

    public final class RntbdResponse
    extends Object
    implements io.netty.util.ReferenceCounted
    • Constructor Detail

      • RntbdResponse

        public RntbdResponse​(UUID activityId,
                             int statusCode,
                             Map<String,​String> map,
                             io.netty.buffer.ByteBuf content)
        Initializes a new RntbdResponse instance.

        This method is provided for testing purposes only. It should not be used in product code.

        Parameters:
        activityId - an activity ID
        statusCode - 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 current response to the given byte buffer.
        Parameters:
        out - the output byte buffer.
      • getHeader

        public <T> T getHeader​(com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdConstants.RntbdResponseHeader header)
        Returns the value of the given response header.
        Type Parameters:
        T - the response header value type.
        Parameters:
        header - the response header.
        Returns:
        the value of the given header.
      • hasPayload

        public boolean hasPayload()
        Returns true if this response has a payload.
        Returns:
        true if this response has a payload; false otherwise.
      • refCnt

        public int refCnt()
        Returns the reference count of this object. If 0, it means this object has been deallocated.
        Specified by:
        refCnt in interface io.netty.util.ReferenceCounted
      • release

        public boolean release()
        Decreases the reference count by 1.

        The current response is deallocated if the count reaches 0.

        Specified by:
        release in interface io.netty.util.ReferenceCounted
        Returns:
        true if and only if the reference count became 0 and this response is deallocated.
      • release

        public boolean release​(int decrement)
        Decreases the reference count by decrement and deallocates this response if the count reaches 0.
        Specified by:
        release in interface io.netty.util.ReferenceCounted
        Parameters:
        decrement - amount of the decrease.
        Returns:
        true if and only if the reference count became 0 and this response has been deallocated.
      • retain

        public RntbdResponse retain()
        Increases the reference count by 1.
        Specified by:
        retain in interface io.netty.util.ReferenceCounted
      • retain

        public RntbdResponse retain​(int increment)
        Increases the reference count by the specified increment.
        Specified by:
        retain in interface io.netty.util.ReferenceCounted
        Parameters:
        increment - amount of the increase
      • touch

        public RntbdResponse touch()
        Records the current access location of this object for debugging purposes

        If 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 to touch(null).

        Specified by:
        touch in interface io.netty.util.ReferenceCounted
      • touch

        public RntbdResponse touch​(Object hint)
        Records the current access location of this object with additional arbitrary information for debugging purposes

        If this object is determined to be leaked, the information recorded by this operation will be provided to you via ResourceLeakDetector.

        Specified by:
        touch in interface io.netty.util.ReferenceCounted
        Parameters:
        hint - information useful for debugging (unused)