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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpResponse msg)
     
    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

      public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      Specified by:
      handlerAdded in interface io.netty.channel.ChannelHandler
      Overrides:
      handlerAdded in class io.netty.channel.ChannelHandlerAdapter
      Throws:
      Exception
    • sendData

      public void sendData(byte[] data) throws ClientException
      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

      public void sendData(io.netty.buffer.ByteBuf buf) throws ClientException
      Throws:
      ClientException
    • completeRequest

      public CompletableFuture<byte[]> 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 class io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpResponse>
      Throws:
      Exception