Package org.dcache.xrootd.tpc
Class AbstractClientSourceHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.dcache.xrootd.tpc.AbstractClientRequestHandler
-
- org.dcache.xrootd.tpc.AbstractClientSourceHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
TpcSourceReadHandler
public abstract class AbstractClientSourceHandler extends AbstractClientRequestHandler
Xrootd Third Party copy requires the destination server to be active, and request a read of the source file from the source server. This handler implements open and close. Concrete implementations must handle the actual read and checksum requests and responses. If the close response is OK, it hands it off to the next handler in the chain.
-
-
Field Summary
-
Fields inherited from class org.dcache.xrootd.tpc.AbstractClientRequestHandler
client, LOGGER
-
-
Constructor Summary
Constructors Constructor Description AbstractClientSourceHandler()
-
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 voiddoOnAuthenticationResponse(io.netty.channel.ChannelHandlerContext ctx, InboundAuthenticationResponse response)If this method is called on this handler with status OK, this means that step has succeeded.protected abstract voiddoOnChecksumResponse(io.netty.channel.ChannelHandlerContext ctx, InboundChecksumResponse response)Should check the checksum and fail or succeed accordingly.protected voiddoOnCloseResponse(io.netty.channel.ChannelHandlerContext ctx, InboundCloseResponse response)protected voiddoOnLoginResponse(io.netty.channel.ChannelHandlerContext ctx, InboundLoginResponse response)If the response contains a security context, then it was not handled by an authentication plugin, and the transfer should fail.protected voiddoOnOpenResponse(io.netty.channel.ChannelHandlerContext ctx, InboundOpenReadOnlyResponse response)protected abstract 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 voidsendChecksumRequest(io.netty.channel.ChannelHandlerContext ctx)If checksum option is expressed.protected voidsendOpenRequest(io.netty.channel.ChannelHandlerContext ctx)protected abstract voidsendReadRequest(io.netty.channel.ChannelHandlerContext ctx)Should take care of any special handling, such as vectorization.-
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
-
doOnLoginResponse
protected void doOnLoginResponse(io.netty.channel.ChannelHandlerContext ctx, InboundLoginResponse response) throws XrootdExceptionIf the response contains a security context, then it was not handled by an authentication plugin, and the transfer should fail.- Overrides:
doOnLoginResponsein classAbstractClientRequestHandler- Throws:
XrootdException
-
doOnAsynResponse
protected void doOnAsynResponse(io.netty.channel.ChannelHandlerContext ctx, InboundAttnResponse response) throws XrootdException- Overrides:
doOnAsynResponsein classAbstractClientRequestHandler- Throws:
XrootdException
-
doOnAuthenticationResponse
protected void doOnAuthenticationResponse(io.netty.channel.ChannelHandlerContext ctx, InboundAuthenticationResponse response) throws XrootdExceptionIf this method is called on this handler with status OK, this means that step has succeeded.- Overrides:
doOnAuthenticationResponsein classAbstractClientRequestHandler- Throws:
XrootdException
-
doOnCloseResponse
protected void doOnCloseResponse(io.netty.channel.ChannelHandlerContext ctx, InboundCloseResponse response) throws XrootdException- Overrides:
doOnCloseResponsein classAbstractClientRequestHandler- Throws:
XrootdException
-
doOnOpenResponse
protected void doOnOpenResponse(io.netty.channel.ChannelHandlerContext ctx, InboundOpenReadOnlyResponse response) throws XrootdException- Overrides:
doOnOpenResponsein classAbstractClientRequestHandler- Throws:
XrootdException
-
sendOpenRequest
protected void sendOpenRequest(io.netty.channel.ChannelHandlerContext ctx)
- Overrides:
sendOpenRequestin classAbstractClientRequestHandler
-
doOnWaitResponse
protected void doOnWaitResponse(io.netty.channel.ChannelHandlerContext ctx, AbstractXrootdInboundResponse response) throws XrootdException- Overrides:
doOnWaitResponsein classAbstractClientRequestHandler- Throws:
XrootdException
-
doOnChecksumResponse
protected abstract void doOnChecksumResponse(io.netty.channel.ChannelHandlerContext ctx, InboundChecksumResponse response) throws XrootdExceptionShould check the checksum and fail or succeed accordingly.- Overrides:
doOnChecksumResponsein classAbstractClientRequestHandler- Throws:
XrootdException
-
doOnReadResponse
protected abstract void doOnReadResponse(io.netty.channel.ChannelHandlerContext ctx, InboundReadResponse response) throws XrootdExceptionShould implement the proper read logic. If vector reads are supported, should direct to special method.- Overrides:
doOnReadResponsein classAbstractClientRequestHandler- Throws:
XrootdException
-
sendChecksumRequest
protected abstract void sendChecksumRequest(io.netty.channel.ChannelHandlerContext ctx) throws XrootdExceptionIf checksum option is expressed.- Overrides:
sendChecksumRequestin classAbstractClientRequestHandler- Throws:
XrootdException
-
sendReadRequest
protected abstract void sendReadRequest(io.netty.channel.ChannelHandlerContext ctx) throws XrootdExceptionShould take care of any special handling, such as vectorization.- Overrides:
sendReadRequestin classAbstractClientRequestHandler- Throws:
XrootdException
-
-