Class AuthenticatedAPIHandler

    • Field Detail

      • apiName

        protected final java.lang.String apiName
      • apiPath

        protected final java.lang.String apiPath
      • apiURI

        protected java.net.URI apiURI
    • Constructor Detail

      • AuthenticatedAPIHandler

        protected AuthenticatedAPIHandler​(AuthenticatedAPIHandler.Conf<?> builder)
        Create this APIHandler by using its Builder. The API configuration will be copied over from the builder.tokenAPIHandler.
        Parameters:
        builder - The builder to use.
    • Method Detail

      • getEndpointURI

        public java.net.URI getEndpointURI​(URIPath path,
                                           URIEncodedData query,
                                           java.lang.String fragment)
                                    throws java.io.IOException,
                                           java.lang.InterruptedException,
                                           HiroException
        Construct my URI with query parameters and fragment. This method will query /api/version once to construct the URI unless apiPath is set.
        Parameters:
        path - The path to append to the API path.
        query - Query parameters for this URI. Can be null for no query parameters.
        fragment - The fragment to add to the URI.
        Returns:
        The URI with query parameters and fragment.
        Throws:
        java.io.IOException - On a failed call to /api/version
        java.lang.InterruptedException - Call got interrupted
        HiroException - When calling /api/version responds with an error
      • addToHeaders

        public void addToHeaders​(HttpHeaderMap headers)
                          throws java.lang.InterruptedException,
                                 java.io.IOException,
                                 HiroException
        Add Authorization.
        Specified by:
        addToHeaders in class AbstractAPIHandler
        Parameters:
        headers - Map of headers with initial values.
        Throws:
        java.lang.InterruptedException - When a call (possibly of an overwritten method) gets interrupted.
        java.io.IOException - On IO errors.
        HiroException - On internal errors regarding hiro data processing.