Interface IpFilterListener


  • public interface IpFilterListener
    The listener interface for receiving ipFilter events.
    See Also:
    IpFilteringHandler
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ChannelFuture allowed​(ChannelHandlerContext ctx, ChannelEvent e, java.net.InetSocketAddress inetSocketAddress)
      Called when the channel has the CONNECTED status and the channel was allowed by a previous call to accept().
      boolean continues​(ChannelHandlerContext ctx, ChannelEvent e)
      Called in handleUpstream, if this channel was previously blocked, to check if whatever the event, it should be passed to the next entry in the pipeline.
      If one wants to not block events, just overridden this method by returning always true.

      Note that OPENED and BOUND events are still passed to the next entry in the pipeline since those events come out before the CONNECTED event and so the possibility to filter the connection.
      ChannelFuture refused​(ChannelHandlerContext ctx, ChannelEvent e, java.net.InetSocketAddress inetSocketAddress)
      Called when the channel has the CONNECTED status and the channel was refused by a previous call to accept().
    • Method Detail

      • allowed

        ChannelFuture allowed​(ChannelHandlerContext ctx,
                              ChannelEvent e,
                              java.net.InetSocketAddress inetSocketAddress)
        Called when the channel has the CONNECTED status and the channel was allowed by a previous call to accept(). This method enables your implementation to send a message back to the client before closing or whatever you need. This method returns a ChannelFuture on which the implementation can wait uninterruptibly before continuing.
        For instance, If a message is sent back, the corresponding ChannelFuture has to be returned.
        Parameters:
        inetSocketAddress - the remote InetSocketAddress from client
        Returns:
        the associated ChannelFuture to be waited for before closing the channel. Null is allowed.
      • refused

        ChannelFuture refused​(ChannelHandlerContext ctx,
                              ChannelEvent e,
                              java.net.InetSocketAddress inetSocketAddress)
        Called when the channel has the CONNECTED status and the channel was refused by a previous call to accept(). This method enables your implementation to send a message back to the client before closing or whatever you need. This method returns a ChannelFuture on which the implementation will wait uninterruptibly before closing the channel.
        For instance, If a message is sent back, the corresponding ChannelFuture has to be returned.
        Parameters:
        inetSocketAddress - the remote InetSocketAddress from client
        Returns:
        the associated ChannelFuture to be waited for before closing the channel. Null is allowed.
      • continues

        boolean continues​(ChannelHandlerContext ctx,
                          ChannelEvent e)
        Called in handleUpstream, if this channel was previously blocked, to check if whatever the event, it should be passed to the next entry in the pipeline.
        If one wants to not block events, just overridden this method by returning always true.

        Note that OPENED and BOUND events are still passed to the next entry in the pipeline since those events come out before the CONNECTED event and so the possibility to filter the connection.
        Returns:
        True if the event should continue, False if the event should not continue since this channel was blocked by this filter