Class ReadVResponse
- java.lang.Object
-
- io.netty.util.AbstractReferenceCounted
-
- org.dcache.xrootd.protocol.messages.ReadVResponse
-
- All Implemented Interfaces:
io.netty.util.ReferenceCounted,XrootdResponse<ReadVRequest>
public class ReadVResponse extends io.netty.util.AbstractReferenceCounted implements XrootdResponse<ReadVRequest>
-
-
Field Summary
Fields Modifier and Type Field Description static intREAD_LIST_HEADER_SIZE
-
Constructor Summary
Constructors Constructor Description ReadVResponse(ReadVRequest request, GenericReadRequestMessage.EmbeddedReadRequest[] requests, io.netty.buffer.ByteBuf[] data, int index, int length, boolean isIncomplete)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddeallocate()intgetDataLength()Returns the length of the response body.intgetIndex()Returns the starting index into the request read segments that this response addresses.intgetLength()Returns the number of segments contained in this response.ReadVRequestgetRequest()Returns the request this is a response to.java.util.List<java.lang.Integer>getSegmentLengths()java.util.List<io.netty.buffer.ByteBuf>getSegments()Returns the data segments of the response.intgetStatus()The xrootd response status code.java.lang.StringtoString()io.netty.util.ReferenceCountedtouch(java.lang.Object hint)voidwriteTo(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)Writes the encoded message to the given channel context.
-
-
-
Field Detail
-
READ_LIST_HEADER_SIZE
public static final int READ_LIST_HEADER_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReadVResponse
public ReadVResponse(ReadVRequest request, GenericReadRequestMessage.EmbeddedReadRequest[] requests, io.netty.buffer.ByteBuf[] data, int index, int length, boolean isIncomplete)
-
-
Method Detail
-
getRequest
public ReadVRequest getRequest()
Description copied from interface:XrootdResponseReturns the request this is a response to.- Specified by:
getRequestin interfaceXrootdResponse<ReadVRequest>
-
getStatus
public int getStatus()
Description copied from interface:XrootdResponseThe xrootd response status code.- Specified by:
getStatusin interfaceXrootdResponse<ReadVRequest>
-
getSegments
public java.util.List<io.netty.buffer.ByteBuf> getSegments()
Returns the data segments of the response. Only the segments contained in this response are returned. The buffers returned are unmodifiable views of the actual data segments. Reference counts are shared and the caller should not release any reference to the returned buffers.
-
getSegmentLengths
public java.util.List<java.lang.Integer> getSegmentLengths()
-
getIndex
public int getIndex()
Returns the starting index into the request read segments that this response addresses.
-
getLength
public int getLength()
Returns the number of segments contained in this response.
-
getDataLength
public int getDataLength()
Description copied from interface:XrootdResponseReturns the length of the response body. This is the value of the dlen field in the Xrootd Server Response Format. This does not include the length of the 8 byte header.- Specified by:
getDataLengthin interfaceXrootdResponse<ReadVRequest>
-
writeTo
public void writeTo(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)Description copied from interface:XrootdResponseWrites the encoded message to the given channel context. Does not flush the channel. This is a destructive call and must at most be called once. Decreases the reference count by1and deallocates this object if the reference count reaches0.- Specified by:
writeToin interfaceXrootdResponse<ReadVRequest>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
touch
public io.netty.util.ReferenceCounted touch(java.lang.Object hint)
- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
deallocate
protected void deallocate()
- Specified by:
deallocatein classio.netty.util.AbstractReferenceCounted
-
-