Class QuotaHandler

  • All Implemented Interfaces:,
    Direct Known Subclasses:
    QuotaHandler.EppQuotaHandler, QuotaHandler.WhoisQuotaHandler

    public abstract class QuotaHandler
    Handler that checks quota fulfillment and terminates connection if necessary.

    This handler attempts to acquire quota during the first channelRead(, java.lang.Object) operation, not when connection is established. The reason is that the userId used for acquiring quota is not always available when the connection is just open.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  QuotaHandler.EppQuotaHandler
      Quota Handler for EPP protocol.
      static class  QuotaHandler.WhoisQuotaHandler
      Quota Handler for WHOIS protocol.
      • Nested classes/interfaces inherited from interface
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void channelInactive​( ctx)
      Actions to take when the connection terminates.
      void channelRead​( ctx, java.lang.Object msg)  
      • Methods inherited from class

        channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
      • Methods inherited from class

        ensureNotSharable, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface

        handlerAdded, handlerRemoved
    • Method Detail

      • channelRead

        public void channelRead​( ctx,
                                java.lang.Object msg)
                         throws java.lang.Exception
        Specified by:
        channelRead in interface
        channelRead in class
      • channelInactive

        public abstract void channelInactive​( ctx)
        Actions to take when the connection terminates.

        Depending on the quota type, the handler either returns the tokens, or does nothing.

        Specified by:
        channelInactive in interface
        channelInactive in class