Class ConnectionHandler<T>

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
pt.unl.fct.di.novasys.network.pipeline.ConnectionHandler<T>
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler, Connection<T>
Direct Known Subclasses:
InConnectionHandler, OutConnectionHandler

public abstract class ConnectionHandler<T> extends io.netty.channel.ChannelDuplexHandler implements Connection<T>
  • Constructor Details

    • ConnectionHandler

      public ConnectionHandler(MessageListener<T> consumer, io.netty.channel.EventLoop loop, boolean incoming, Attributes selfAttrs)
  • Method Details

    • channelRead

      public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
      Specified by:
      channelRead in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelRead in class io.netty.channel.ChannelInboundHandlerAdapter
    • write

      public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
      Specified by:
      write in interface io.netty.channel.ChannelOutboundHandler
      Overrides:
      write in class io.netty.channel.ChannelDuplexHandler
    • userEventTriggered

      public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)
      Specified by:
      userEventTriggered in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      userEventTriggered in class io.netty.channel.ChannelInboundHandlerAdapter
    • getPeer

      public final Host getPeer()
      Specified by:
      getPeer in interface Connection<T>
    • getPeerAttributes

      public final Attributes getPeerAttributes()
      Specified by:
      getPeerAttributes in interface Connection<T>
    • getSelfAttributes

      public final Attributes getSelfAttributes()
      Specified by:
      getSelfAttributes in interface Connection<T>
    • isInbound

      public boolean isInbound()
      Specified by:
      isInbound in interface Connection<T>
    • isOutbound

      public boolean isOutbound()
      Specified by:
      isOutbound in interface Connection<T>
    • getLoop

      public io.netty.channel.EventLoop getLoop()
      Specified by:
      getLoop in interface Connection<T>
    • getSentAppBytes

      public long getSentAppBytes()
      Specified by:
      getSentAppBytes in interface Connection<T>
    • getSentAppMessages

      public long getSentAppMessages()
      Specified by:
      getSentAppMessages in interface Connection<T>
    • getSentControlBytes

      public long getSentControlBytes()
      Specified by:
      getSentControlBytes in interface Connection<T>
    • getSentControlMessages

      public long getSentControlMessages()
      Specified by:
      getSentControlMessages in interface Connection<T>
    • getReceivedAppBytes

      public long getReceivedAppBytes()
      Specified by:
      getReceivedAppBytes in interface Connection<T>
    • getReceivedAppMessages

      public long getReceivedAppMessages()
      Specified by:
      getReceivedAppMessages in interface Connection<T>
    • getReceivedControlBytes

      public long getReceivedControlBytes()
      Specified by:
      getReceivedControlBytes in interface Connection<T>
    • getReceivedControlMessages

      public long getReceivedControlMessages()
      Specified by:
      getReceivedControlMessages in interface Connection<T>