Package org.dcache.xrootd.tpc
Class TpcSourceReadHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.dcache.xrootd.tpc.AbstractClientRequestHandler
-
- org.dcache.xrootd.tpc.AbstractClientSourceHandler
-
- org.dcache.xrootd.tpc.TpcSourceReadHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public abstract class TpcSourceReadHandler extends AbstractClientSourceHandler
This handler reads until the file is complete, terminating the session thereafter. When complete, it uses the write handler on its client to send a reply to the kXR_sync request received from the initiating client, and calls back to disconnect the third-party client. Optional checksum verification (done prior to the sync reply) is implemented by subclasses.
-
-
Field Summary
-
Fields inherited from class org.dcache.xrootd.tpc.AbstractClientRequestHandler
client, LOGGER
-
-
Constructor Summary
Constructors Constructor Description TpcSourceReadHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoOnAsynResponse(io.netty.channel.ChannelHandlerContext ctx, InboundAttnResponse response)protected voiddoOnChecksumResponse(io.netty.channel.ChannelHandlerContext ctx, InboundChecksumResponse response)Should check the checksum and fail or succeed accordingly.protected voiddoOnReadResponse(io.netty.channel.ChannelHandlerContext ctx, InboundReadResponse response)Should implement the proper read logic.protected voiddoOnWaitResponse(io.netty.channel.ChannelHandlerContext ctx, AbstractXrootdInboundResponse response)protected abstract intgetChunkSize()protected voidhandleTransferTerminated(int status, java.lang.String error, io.netty.channel.ChannelHandlerContext ctx)protected voidsendChecksumRequest(io.netty.channel.ChannelHandlerContext ctx)If checksum option is expressed.protected voidsendReadRequest(io.netty.channel.ChannelHandlerContext ctx)Should take care of any special handling, such as vectorization.protected abstract voidvalidateChecksum(InboundChecksumResponse response, io.netty.channel.ChannelHandlerContext ctx)-
Methods inherited from class org.dcache.xrootd.tpc.AbstractClientSourceHandler
doOnAuthenticationResponse, doOnCloseResponse, doOnLoginResponse, doOnOpenResponse, sendOpenRequest
-
Methods inherited from class org.dcache.xrootd.tpc.AbstractClientRequestHandler
asynWaitTimeout, channelRead, doOnAttnResponse, doOnErrorResponse, doOnHandshakeResponse, doOnProtocolResponse, doOnRedirectResponse, doOnWaitRespResponse, exceptionCaught, getWaitInSeconds, responseReceived, sendAuthenticationRequest, sendCloseRequest, sendLoginRequest, setClient, unsupported
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Method Detail
-
doOnAsynResponse
protected void doOnAsynResponse(io.netty.channel.ChannelHandlerContext ctx, InboundAttnResponse response) throws XrootdException- Overrides:
doOnAsynResponsein classAbstractClientSourceHandler- Throws:
XrootdException
-
doOnChecksumResponse
protected void doOnChecksumResponse(io.netty.channel.ChannelHandlerContext ctx, InboundChecksumResponse response) throws XrootdExceptionDescription copied from class:AbstractClientSourceHandlerShould check the checksum and fail or succeed accordingly.- Specified by:
doOnChecksumResponsein classAbstractClientSourceHandler- Throws:
XrootdException
-
doOnReadResponse
protected void doOnReadResponse(io.netty.channel.ChannelHandlerContext ctx, InboundReadResponse response)Description copied from class:AbstractClientSourceHandlerShould implement the proper read logic. If vector reads are supported, should direct to special method.- Specified by:
doOnReadResponsein classAbstractClientSourceHandler
-
doOnWaitResponse
protected void doOnWaitResponse(io.netty.channel.ChannelHandlerContext ctx, AbstractXrootdInboundResponse response) throws XrootdException- Overrides:
doOnWaitResponsein classAbstractClientSourceHandler- Throws:
XrootdException
-
handleTransferTerminated
protected void handleTransferTerminated(int status, java.lang.String error, io.netty.channel.ChannelHandlerContext ctx)
-
sendReadRequest
protected void sendReadRequest(io.netty.channel.ChannelHandlerContext ctx)
Description copied from class:AbstractClientSourceHandlerShould take care of any special handling, such as vectorization.- Specified by:
sendReadRequestin classAbstractClientSourceHandler
-
sendChecksumRequest
protected void sendChecksumRequest(io.netty.channel.ChannelHandlerContext ctx)
Description copied from class:AbstractClientSourceHandlerIf checksum option is expressed.- Specified by:
sendChecksumRequestin classAbstractClientSourceHandler
-
validateChecksum
protected abstract void validateChecksum(InboundChecksumResponse response, io.netty.channel.ChannelHandlerContext ctx) throws XrootdException
- Throws:
XrootdException
-
getChunkSize
protected abstract int getChunkSize()
-
-