java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpResponse>
org.yamcs.client.base.BulkRestDataSender
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class BulkRestDataSender
extends io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpResponse>
Used to post large quantities of data to yamcs. The data is sent using HTTP chuncked encoding
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpResponse msg) CompletableFuture<byte[]>Complete the request by a final empty chunck and return the response from the server.voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) voidsendData(byte[] data) send the next chunk of data.voidsendData(io.netty.buffer.ByteBuf buf) Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerRemoved
-
Constructor Details
-
BulkRestDataSender
public BulkRestDataSender()
-
-
Method Details
-
handlerAdded
- Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter- Throws:
Exception
-
sendData
send the next chunk of data. The caller is blocked if it sends data faster that can be transfered to the server.- Parameters:
data-- Throws:
ClientException- when there is an exception sending the data. The exception is also thrown if no data can be sent for 10 seconds
-
sendData
- Throws:
ClientException
-
completeRequest
Complete the request by a final empty chunck and return the response from the server.- Returns:
- a CompletableFuture that completes once the response from the server has been received.
-
channelRead0
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpResponse msg) throws Exception - Specified by:
channelRead0in classio.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpResponse>- Throws:
Exception
-