Package org.yamcs.client.base
Class BulkRestDataSender
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
channelRead0
(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.void
handlerAdded
(io.netty.channel.ChannelHandlerContext ctx) void
sendData
(byte[] data) send the next chunk of data.void
sendData
(io.netty.buffer.ByteBuf buf) Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelRead
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
handlerRemoved
-
Constructor Details
-
BulkRestDataSender
public BulkRestDataSender()
-
-
Method Details
-
handlerAdded
- Specified by:
handlerAdded
in interfaceio.netty.channel.ChannelHandler
- Overrides:
handlerAdded
in 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:
channelRead0
in classio.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpResponse>
- Throws:
Exception
-