Class CyclonShufflingClientHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<CyclonShuffleResponse,SocketAddress>>
org.drasyl.handler.membership.cyclon.CyclonShufflingClientHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

public class CyclonShufflingClientHandler extends io.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<CyclonShuffleResponse,SocketAddress>>
Initiates the "Enhanced Shuffling" algorithm of CYCLON.

This handler should be used together with CyclonShufflingServerHandler and CyclonCodec.

  ChannelPipeline p = ...;
  CyclonView view = CyclonView.ofKeys(8, Set.of(pubKeyA, pubKeyB, ...));
  ...
  p.addLast("cyclon_codec", new CyclonCodec());
  p.addLast("cyclon_client", new CyclonShufflingClientHandler(4, 10_000, view));
  p.addLast("cyclon_server", new CyclonShufflingServerHandler(4, view));
  ...
  
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Constructor Summary

    Constructors
    Constructor
    Description
    CyclonShufflingClientHandler(int shuffleSize, int shuffleInterval, CyclonView view)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
    channelActive(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    channelInactive(io.netty.channel.ChannelHandlerContext ctx)
     
    protected void
    channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.AddressedEnvelope<CyclonShuffleResponse,SocketAddress> msg)
     
    void
    handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
     

    Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

    channelRead

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CyclonShufflingClientHandler

      public CyclonShufflingClientHandler(int shuffleSize, int shuffleInterval, CyclonView view)
  • Method Details

    • handlerAdded

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

      public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      handlerRemoved in interface io.netty.channel.ChannelHandler
      Overrides:
      handlerRemoved in class io.netty.channel.ChannelHandlerAdapter
    • channelActive

      public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      channelActive in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelActive in class io.netty.channel.ChannelInboundHandlerAdapter
    • channelInactive

      public void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      channelInactive in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelInactive in class io.netty.channel.ChannelInboundHandlerAdapter
    • acceptInboundMessage

      public boolean acceptInboundMessage(Object msg)
      Overrides:
      acceptInboundMessage in class io.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<CyclonShuffleResponse,SocketAddress>>
    • channelRead0

      protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.AddressedEnvelope<CyclonShuffleResponse,SocketAddress> msg)
      Specified by:
      channelRead0 in class io.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<CyclonShuffleResponse,SocketAddress>>