Class HttpAuthorizationHandler

    • Constructor Detail

      • HttpAuthorizationHandler

        public HttpAuthorizationHandler​(@NotNull
                                        @NotNull Session session)
        Instantiates a new HttpAuthorizationHandler for a given Session.
        Parameters:
        session - The Session to provide authorization for.
    • Method Detail

      • execute

        public org.apache.hc.core5.http.ClassicHttpResponse execute​(@NotNull
                                                                    @NotNull org.apache.hc.core5.http.ClassicHttpRequest classicHttpRequest,
                                                                    @NotNull
                                                                    org.apache.hc.client5.http.classic.ExecChain.Scope scope,
                                                                    @NotNull
                                                                    @NotNull org.apache.hc.client5.http.classic.ExecChain execChain)
                                                             throws IOException,
                                                                    org.apache.hc.core5.http.HttpException

        When this method is called the HttpAuthorizationHandler acts as a ExecChainHandler in the context of a ExecChain. It will check whether the given request contains an HttpHeaders.AUTHORIZATION Header and in case it is missing it shall provide such a Header according to the provided and active Session.

        Specified by:
        execute in interface org.apache.hc.client5.http.classic.ExecChainHandler
        Parameters:
        classicHttpRequest - the actual request.
        scope - the execution scope.
        execChain - the next element in the request execution chain.
        Throws:
        IOException
        org.apache.hc.core5.http.HttpException