org.apache.synapse.commons.throttle.module.utils

## Class Utils

- java.lang.Object
- - org.apache.synapse.commons.throttle.module.utils.Utils

-     public class Utils
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Utils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `extractCustomerKeyFromAuthHeader(java.lang.String authHeader)` Extract the customer key from the OAuth Authentication header
    `static boolean` | `isIpInRange(java.lang.String address, java.lang.String range)` Check whether a given Ip is in a given ip range
    `static void` | `main(java.lang.String[] args)`

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

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

- - ### Constructor Detail

    - #### Utils

          public Utils()

  - ### Method Detail

    - #### isIpInRange

          public static boolean isIpInRange(java.lang.String address,
                                            java.lang.String range)
                                     throws java.net.UnknownHostException

      Check whether a given Ip is in a given ip range
      Parameters:
        `address` - ip address to check
        `range` - range ex: 192.168.2.2-192.168.2.100
      Returns:
        true is in range , false if not
      Throws:
        `java.net.UnknownHostException` - If Host is not Valid or can't resolve it

    - #### extractCustomerKeyFromAuthHeader

          public static java.lang.String extractCustomerKeyFromAuthHeader(java.lang.String authHeader)

      Extract the customer key from the OAuth Authentication header
      Parameters:
        `authHeader` - Header string
      Returns:
        extracted customer key value

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.net.UnknownHostException

      Throws:
        `java.net.UnknownHostException`

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