src/main/java/com/authlete/jaxrs/BaseAuthorizationDecisionEndpoint.java
public Response handle(
            AuthleteApi api, AuthorizationDecisionHandlerSpi spi,
            String ticket, String[] claimNames, String[] claimLocales)
    {
        try
        {
            // Create a handler.
            AuthorizationDecisionHandler handler = new AuthorizationDecisionHandler(api, spi);

            // Delegate the task to the handler.
            return handler.handle(ticket, claimNames, claimLocales);
        }
        catch (WebApplicationException e)
        {
            // An error occurred in the handler.
            onError(e);

            // Convert the error to a Response.
            return e.getResponse();
        }
    }
public Response handle(
            AuthleteApi api, AuthorizationDecisionHandlerSpi spi,
            String ticket, String[] claimNames, String[] claimLocales)
    {
        try
        {
            // Create a handler.
            AuthorizationDecisionHandler handler = new AuthorizationDecisionHandler(api, spi);

            // Delegate the task to the handler.
            return handler.handle(ticket, claimNames, claimLocales);
        }
        catch (WebApplicationException e)
        {
            // An error occurred in the handler.
            onError(e);

            // Convert the error to a Response.
            return e.getResponse();
        }
    }
Handle an authorization decision request.

<p>
This method internally creates a {@link AuthorizationDecisionHandler} instance and
calls its {@link AuthorizationDecisionHandler#handle(String, String[], String[])}
method. Then, this method uses the value returned from the {@code handle()} method
as a response from this method.
</p>

<p>
When {@code AuthorizationDecisionHandler.handle()} method raises a {@link
WebApplicationException}, this method calls {@link #onError(WebApplicationException)
onError()} method with the exception. The default implementation of {@code onError()}
calls {@code printStackTrace()} of the exception and does nothing else. You
can override the method as necessary. After calling {@code onError()} method,
this method calls {@code getResponse()} method of the exception and uses the
returned value as a response from this method.
</p>

@param api
An implementation of {@link AuthleteApi}.

@param spi
An implementation of {@link AuthorizationDecisionHandlerSpi}.

@param ticket
A ticket that was issued by Authlete's {@code /api/auth/authorization} API.

@param claimNames
Names of requested claims. Use the value of the {@code claims}
parameter in a response from Authlete's {@code /api/auth/authorization} API.

@param claimLocales
Requested claim locales. Use the value of the {@code claimsLocales}
parameter in a response from Authlete's {@code /api/auth/authorization} API.

@return
A response that should be returned to the client application.