org.apache.synapse.commons.throttle.module.handler

## Class ThrottleHandler

- java.lang.Object
- - org.apache.axis2.handlers.AbstractHandler
  - - org.apache.synapse.commons.throttle.module.handler.ThrottleHandler

- All Implemented Interfaces:
    org.apache.axis2.engine.Handler
  Direct Known Subclasses:
    GlobalThrottleHandler, OperationLevelThrottleHandler, ServiceLevelThrottleHandler

      public abstract class ThrottleHandler
      extends org.apache.axis2.handlers.AbstractHandler

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.axis2.engine.Handler

      `org.apache.axis2.engine.Handler.InvocationResponse`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `THROTTLING_CACHE`
    `static java.lang.String` | `THROTTLING_CACHE_MANAGER`

    - ### Fields inherited from class org.apache.axis2.handlers.AbstractHandler

      `handlerDesc`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ThrottleHandler()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract int` | `getThrottleType()`
    `org.apache.axis2.engine.Handler.InvocationResponse` | `invoke(org.apache.axis2.context.MessageContext msgContext)`
    `Throttle` | `loadThrottle(org.apache.axis2.context.MessageContext messageContext, int throttleType)` Loads a throttle metadata for a particular throttle type
    `void` | `process(Throttle throttle, org.apache.axis2.context.MessageContext messageContext)` processing through the throttle 1) concurrent throttling 2) access rate based throttling - domain or ip

    - ### Methods inherited from class org.apache.axis2.handlers.AbstractHandler

      `cleanup, flowComplete, getHandlerDesc, getName, getParameter, init, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### THROTTLING_CACHE_MANAGER

          public static final java.lang.String THROTTLING_CACHE_MANAGER

      See Also:
        Constant Field Values

    - #### THROTTLING_CACHE

          public static final java.lang.String THROTTLING_CACHE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ThrottleHandler

          public ThrottleHandler()

  - ### Method Detail

    - #### getThrottleType

          protected abstract int getThrottleType()

      Returns:
        int - indicates the type of the throttle according to the scope

    - #### loadThrottle

          public Throttle loadThrottle(org.apache.axis2.context.MessageContext messageContext,
                                       int throttleType)
                                throws ThrottleException

      Loads a throttle metadata for a particular throttle type
      Parameters:
        `messageContext` - - The messageContext
        `throttleType` - - The type of throttle
      Returns:
        IPBaseThrottleConfiguration - The IPBaseThrottleConfiguration - load from AxisConfiguration
      Throws:
        `ThrottleException` - Throws if the throttle type is unsupported

    - #### process

          public void process(Throttle throttle,
                              org.apache.axis2.context.MessageContext messageContext)
                       throws ThrottleException,
                              org.apache.axis2.AxisFault

      processing through the throttle 1) concurrent throttling 2) access rate based throttling - domain or ip
      Parameters:
        `throttle` - The Throttle object - holds all configuration and state data of the throttle
        `messageContext` - The MessageContext , that holds all data per message basis
      Throws:
        `org.apache.axis2.AxisFault` - Throws when access must deny for caller
        `ThrottleException` - ThrottleException

    - #### invoke

          public org.apache.axis2.engine.Handler.InvocationResponse invoke(org.apache.axis2.context.MessageContext msgContext)
                                                                    throws org.apache.axis2.AxisFault

      Throws:
        `org.apache.axis2.AxisFault`

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.