Class ReadResponse
- java.lang.Object
-
- org.dcache.xrootd.protocol.messages.ReadResponse
-
- All Implemented Interfaces:
io.netty.util.ReferenceCounted,XrootdResponse<ReadRequest>
public class ReadResponse extends java.lang.Object implements XrootdResponse<ReadRequest>, io.netty.util.ReferenceCounted
-
-
Constructor Summary
Constructors Constructor Description ReadResponse(ReadRequest request, io.netty.buffer.ByteBuf data, boolean isIncomplete)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBufgetData()intgetDataLength()Returns the length of the response body.ReadRequestgetRequest()Returns the request this is a response to.intgetStatus()The xrootd response status code.intrefCnt()booleanrelease()booleanrelease(int decrement)ReadResponseretain()ReadResponseretain(int increment)java.lang.StringtoString()io.netty.util.ReferenceCountedtouch()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.
-
-
-
Constructor Detail
-
ReadResponse
public ReadResponse(ReadRequest request, io.netty.buffer.ByteBuf data, boolean isIncomplete)
-
-
Method Detail
-
getRequest
public ReadRequest getRequest()
Description copied from interface:XrootdResponseReturns the request this is a response to.- Specified by:
getRequestin interfaceXrootdResponse<ReadRequest>
-
getStatus
public int getStatus()
Description copied from interface:XrootdResponseThe xrootd response status code.- Specified by:
getStatusin interfaceXrootdResponse<ReadRequest>
-
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<ReadRequest>
-
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<ReadRequest>
-
getData
public io.netty.buffer.ByteBuf getData()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
refCnt
public int refCnt()
- Specified by:
refCntin interfaceio.netty.util.ReferenceCounted
-
retain
public ReadResponse retain()
- Specified by:
retainin interfaceio.netty.util.ReferenceCounted
-
retain
public ReadResponse retain(int increment)
- Specified by:
retainin interfaceio.netty.util.ReferenceCounted
-
release
public boolean release()
- Specified by:
releasein interfaceio.netty.util.ReferenceCounted
-
release
public boolean release(int decrement)
- Specified by:
releasein interfaceio.netty.util.ReferenceCounted
-
touch
public io.netty.util.ReferenceCounted touch()
- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
touch
public io.netty.util.ReferenceCounted touch(java.lang.Object hint)
- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
-