Class AbstractPipelineHttpSOAPClient

    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • httpClient

        @NonnullAfterInit
        private org.apache.http.client.HttpClient httpClient
        HTTP client used to send requests and receive responses.
      • httpClientSecurityParameters

        @Nullable
        private HttpClientSecurityParameters httpClientSecurityParameters
        HTTP client security parameters.
    • Constructor Detail

      • AbstractPipelineHttpSOAPClient

        public AbstractPipelineHttpSOAPClient()
        Constructor.
    • Method Detail

      • getHttpClient

        @Nonnull
        public org.apache.http.client.HttpClient getHttpClient()
        Get the client used to make outbound HTTP requests.
        Returns:
        the client instance
      • setHttpClient

        public void setHttpClient​(@Nonnull
                                  org.apache.http.client.HttpClient client)
        Set the client used to make outbound HTTP requests.

        This client SHOULD employ a thread-safe HttpClient and may be shared with other objects.

        Parameters:
        client - client object
      • getHttpClientSecurityParameters

        @Nullable
        public HttpClientSecurityParameters getHttpClientSecurityParameters()
        Get the optional client security parameters.
        Returns:
        the client security parameters, or null
      • setHttpClientSecurityParameters

        public void setHttpClientSecurityParameters​(@Nullable
                                                    HttpClientSecurityParameters params)
        Set the optional client security parameters.
        Parameters:
        params - the new client security parameters
      • getTLSCriteriaSetStrategy

        @Nullable
        public Function<InOutOperationContext,​CriteriaSet> getTLSCriteriaSetStrategy()
        Get the strategy function which builds the dynamically-populated criteria set which is input to the TLS TrustEngine, if no static criteria set is supplied either via context or locally-configured HttpClientSecurityParameters.
        Returns:
        the strategy function, or null
      • setTLSCriteriaSetStrategy

        public void setTLSCriteriaSetStrategy​(@Nullable
                                              Function<InOutOperationContext,​CriteriaSet> function)
        Set the strategy function which builds the dynamically-populated criteria set which is input to the TLS TrustEngine, if no static criteria set is supplied either via context or locally-configured HttpClientSecurityParameters.
        Parameters:
        function - the strategy function, or null
      • send

        public void send​(@Nonnull @NotEmpty
                         String endpoint,
                         @Nonnull
                         InOutOperationContext operationContext)
                  throws SOAPException,
                         SecurityException
        Sends a message and waits for a response.
        Specified by:
        send in interface SOAPClient
        Parameters:
        endpoint - the endpoint to which to send the message
        operationContext - the operation context containing the outbound SOAP message
        Throws:
        SOAPException - thrown if there is a problem sending the message or receiving the response or if the response is a SOAP fault
        SecurityException - thrown if the response does not meet any security policy associated with the message context
      • buildHttpRequest

        @Nonnull
        protected org.apache.http.client.methods.HttpUriRequest buildHttpRequest​(@Nonnull @NotEmpty
                                                                                 String endpoint,
                                                                                 @Nonnull
                                                                                 InOutOperationContext operationContext)
        Build the HttpUriRequest instance to be executed by the HttpClient.
        Parameters:
        endpoint - the endpoint to which the message will be sent
        operationContext - the current operation context
        Returns:
        the HTTP request to be executed
      • buildHttpContext

        @Nonnull
        protected org.apache.http.client.protocol.HttpClientContext buildHttpContext​(@Nonnull
                                                                                     org.apache.http.client.methods.HttpUriRequest request,
                                                                                     @Nonnull
                                                                                     InOutOperationContext operationContext)
        Build the HttpClientContext instance to be used by the HttpClient.
        Parameters:
        request - the HTTP client request
        operationContext - the current operation context
        Returns:
        the client context instance
      • resolveClientContext

        @Nonnull
        protected org.apache.http.client.protocol.HttpClientContext resolveClientContext​(@Nonnull
                                                                                         InOutOperationContext operationContext)
        Resolve the effective HttpClientContext instance to use for the current request.

        The default implementation first attempts to resolve the outbound subcontext value HttpClientRequestContext.getHttpClientContext(). If no context value is present, a new empty context instance will be returned via HttpClientContext.create().

        Note that any security-related attributes supplied directly the client context returned here will override the corresponding values supplied via both operation context and locally-configured instances of HttpClientSecurityParameters.

        Parameters:
        operationContext - the current operation context
        Returns:
        the effective client context instance to use
      • buildTLSCriteriaSet

        @Nonnull
        protected CriteriaSet buildTLSCriteriaSet​(@Nonnull
                                                  org.apache.http.client.methods.HttpUriRequest request,
                                                  @Nonnull
                                                  InOutOperationContext operationContext)
        Build the dynamic CriteriaSet instance to be used for TLS trust evaluation.
        Parameters:
        request - the HTTP client request
        operationContext - the current operation context
        Returns:
        the new criteria set instance