Package org.apache.synapse.mediators.opa

## Class OPAUtils

- java.lang.Object
- - org.apache.synapse.mediators.opa.OPAUtils

-     public class OPAUtils
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OPAUtils()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static String` | `getRequestIp​(org.apache.axis2.context.MessageContext axis2MessageContext)` | Get the request originated IP from the message content
    `static void` | `handlePolicyFailure​(org.apache.synapse.MessageContext messageContext, OPASecurityException e, String faultHandler)` | Handle the policy failure.

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

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

- - ### Constructor Detail

    - #### OPAUtils

          public OPAUtils()

  - ### Method Detail

    - #### getRequestIp

          public static String getRequestIp​(org.apache.axis2.context.MessageContext axis2MessageContext)

      Get the request originated IP from the message content
      Parameters:
        `axis2MessageContext` - Axis2 message context
      Returns:
        IP address as a string

    - #### handlePolicyFailure

          public static void handlePolicyFailure​(org.apache.synapse.MessageContext messageContext,
                                                 OPASecurityException e,
                                                 String faultHandler)

      Handle the policy failure. This can be an internal error or access revoked by the policy
      Parameters:
        `messageContext` - Message context
        `e` - OPASecurityException