Class AbstractXrootdResponse<T extends XrootdRequest>
- java.lang.Object
-
- org.dcache.xrootd.protocol.messages.AbstractXrootdResponse<T>
-
- All Implemented Interfaces:
XrootdResponse<T>
- Direct Known Subclasses:
AuthenticationResponse,AwaitAsyncResponse,DirListResponse,ErrorResponse,LocateResponse,LoginResponse,OkResponse,OpenResponse,ProtocolResponse,RedirectResponse,StatResponse,StatxResponse,StringResponse,WaitRetryResponse
public abstract class AbstractXrootdResponse<T extends XrootdRequest> extends java.lang.Object implements XrootdResponse<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractXrootdResponse(T request, int stat)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidgetBytes(io.netty.buffer.ByteBuf buffer)abstract intgetDataLength()Returns the length of the response body.TgetRequest()Returns the request this is a response to.intgetStatus()The xrootd response status code.voidwriteTo(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)Writes the encoded message to the given channel context.
-
-
-
Field Detail
-
request
protected final T extends XrootdRequest request
-
stat
protected final int stat
-
-
Constructor Detail
-
AbstractXrootdResponse
public AbstractXrootdResponse(T request, int stat)
-
-
Method Detail
-
getRequest
public T getRequest()
Description copied from interface:XrootdResponseReturns the request this is a response to.- Specified by:
getRequestin interfaceXrootdResponse<T extends XrootdRequest>
-
getStatus
public int getStatus()
Description copied from interface:XrootdResponseThe xrootd response status code.- Specified by:
getStatusin interfaceXrootdResponse<T extends XrootdRequest>
-
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<T extends XrootdRequest>
-
getDataLength
public abstract 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<T extends XrootdRequest>
-
getBytes
protected abstract void getBytes(io.netty.buffer.ByteBuf buffer)
-
-