Class MasterAccessTokenValidator.ErrorResponse

    • Constructor Detail

      • ErrorResponse

        public ErrorResponse​(int statusCode,
                             String wwwAuthHeader,
                             String bodyErrorCode,
                             String bodyErrorDesc)
        Creates a new bearer token error response.
        Parameters:
        statusCode - The HTTP status code.
        wwwAuthHeader - The HTTP response WWW-Authenticate header, null if none.
        bodyErrorCode - The error code for the body JSON object.
        bodyErrorDesc - The error description for the body JSON object.
    • Method Detail

      • toWebAppException

        public javax.ws.rs.WebApplicationException toWebAppException()
        Returns a web application exception for this error response.
        Returns:
        The web application exception.
      • apply

        public void apply​(javax.servlet.http.HttpServletResponse servletResponse)
                   throws IOException
        Applies this error response to the specified HTTP servlet response.
        Parameters:
        servletResponse - The HTTP servlet response. Must not be null.
        Throws:
        IOException - If the error response couldn't be written.