Class OpaApiClient

    • Field Detail

      • SERVERS

        public static final java.lang.String[] SERVERS
        SERVERS contains the list of server urls available to the SDK.
    • Method Detail

      • builder

        public static OpaApiClient.Builder builder()
        Get a new instance of the SDK builder to configure a new instance of the SDK.
        Returns:
        The SDK builder instance.
      • executeDefaultPolicyWithInput

        public ExecuteDefaultPolicyWithInputResponse executeDefaultPolicyWithInput​(Input input)
                                                                            throws java.lang.Exception
        Execute the default decision given an input
        Parameters:
        input - Arbitrary JSON used within your policies by accessing `input`
        Returns:
        The response from the API call
        Throws:
        java.lang.Exception - if the API call fails
      • health

        public HealthRequestBuilder health()
        Verify the server is operational The health API endpoint executes a simple built-in policy query to verify that the server is operational. Optionally it can account for bundle activation as well (useful for “ready” checks at startup).
        Returns:
        The call builder
      • healthDirect

        public HealthResponse healthDirect()
                                    throws java.lang.Exception
        Verify the server is operational The health API endpoint executes a simple built-in policy query to verify that the server is operational. Optionally it can account for bundle activation as well (useful for “ready” checks at startup).
        Returns:
        The response from the API call
        Throws:
        java.lang.Exception - if the API call fails
      • health

        public HealthResponse health​(java.util.Optional<java.lang.Boolean> bundles,
                                     java.util.Optional<java.lang.Boolean> plugins,
                                     java.util.Optional<? extends java.util.List<java.lang.String>> excludePlugin)
                              throws java.lang.Exception
        Verify the server is operational The health API endpoint executes a simple built-in policy query to verify that the server is operational. Optionally it can account for bundle activation as well (useful for “ready” checks at startup).
        Specified by:
        health in interface SDKMethodInterfaces.MethodCallHealth
        Parameters:
        bundles - Boolean parameter to account for bundle activation status in response. This includes any discovery bundles or bundles defined in the loaded discovery configuration.
        plugins - Boolean parameter to account for plugin status in response.
        excludePlugin - String parameter to exclude a plugin from status checks. Can be added multiple times. Does nothing if plugins is not true. This parameter is useful for special use cases where a plugin depends on the server being fully initialized before it can fully initialize itself.
        Returns:
        The response from the API call
        Throws:
        java.lang.Exception - if the API call fails