Class ManualClosingApacheHttpClient43Engine

    • Field Detail

      • httpClient

        protected final org.apache.http.client.HttpClient httpClient
      • closed

        protected boolean closed
      • allowClosingHttpClient

        protected final boolean allowClosingHttpClient
      • responseBufferSize

        protected int responseBufferSize
      • defaultProxy

        protected org.apache.http.HttpHost defaultProxy
      • chunked

        protected boolean chunked
      • followRedirects

        protected boolean followRedirects
      • fileUploadInMemoryThresholdLimit

        protected int fileUploadInMemoryThresholdLimit
        For uploading File's over JAX-RS framework, this property, together with fileUploadMemoryUnit, defines the maximum File size allowed in memory. If fileSize exceeds this size, it will be stored to fileUploadTempFileDir.

        Defaults to 1 MB
      • fileUploadTempFileDir

        protected File fileUploadTempFileDir
        Temp directory to write output request stream to. Any file to be uploaded has to be written out to the output request stream to be sent to the service and when the File is too huge the output request stream is written out to the disk rather than to memory.

        Defaults to JVM temp directory.
    • Constructor Detail

      • ManualClosingApacheHttpClient43Engine

        public ManualClosingApacheHttpClient43Engine()
      • ManualClosingApacheHttpClient43Engine

        public ManualClosingApacheHttpClient43Engine​(org.apache.http.HttpHost defaultProxy)
      • ManualClosingApacheHttpClient43Engine

        public ManualClosingApacheHttpClient43Engine​(org.apache.http.client.HttpClient httpClient)
      • ManualClosingApacheHttpClient43Engine

        public ManualClosingApacheHttpClient43Engine​(org.apache.http.client.HttpClient httpClient,
                                                     boolean closeHttpClient)
      • ManualClosingApacheHttpClient43Engine

        public ManualClosingApacheHttpClient43Engine​(org.apache.http.client.HttpClient httpClient,
                                                     HttpContextProvider httpContextProvider)
    • Method Detail

      • getResponseBufferSize

        public int getResponseBufferSize()
        Response stream is wrapped in a BufferedInputStream. Default is 8192. Value of 0 will not wrap it. Value of -1 will use a SelfExpandingBufferedInputStream
        Returns:
        response buffer size
      • setResponseBufferSize

        public void setResponseBufferSize​(int responseBufferSize)
        Response stream is wrapped in a BufferedInputStream. Default is 8192. Value of 0 will not wrap it. Value of -1 will use a SelfExpandingBufferedInputStream
        Parameters:
        responseBufferSize - response buffer size
      • getFileUploadInMemoryThresholdLimit

        public int getFileUploadInMemoryThresholdLimit()
        Based on memory unit
        Returns:
        threshold limit
      • setFileUploadInMemoryThresholdLimit

        public void setFileUploadInMemoryThresholdLimit​(int fileUploadInMemoryThresholdLimit)
      • getFileUploadTempFileDir

        public File getFileUploadTempFileDir()
      • setFileUploadTempFileDir

        public void setFileUploadTempFileDir​(File fileUploadTempFileDir)
      • getHttpClient

        public org.apache.http.client.HttpClient getHttpClient()
      • setSslContext

        public void setSslContext​(SSLContext sslContext)
      • setHostnameVerifier

        public void setHostnameVerifier​(HostnameVerifier hostnameVerifier)
      • invoke

        public javax.ws.rs.core.Response invoke​(javax.ws.rs.client.Invocation inv)
        Specified by:
        invoke in interface ClientHttpEngine
      • createHttpMethod

        protected org.apache.http.client.methods.HttpRequestBase createHttpMethod​(String url,
                                                                                  String restVerb)
      • loadHttpMethod

        protected void loadHttpMethod​(ClientInvocation request,
                                      org.apache.http.client.methods.HttpRequestBase httpMethod)
                               throws Exception
        Throws:
        Exception
      • commitHeaders

        protected void commitHeaders​(ClientInvocation request,
                                     org.apache.http.client.methods.HttpRequestBase httpMethod)
      • isChunked

        public boolean isChunked()
      • setChunked

        public void setChunked​(boolean chunked)
      • cleanUpAfterExecute

        protected void cleanUpAfterExecute​(org.apache.http.client.methods.HttpRequestBase httpMethod)
        If passed httpMethod is of type HttpPost then obtain its entity. If the entity has an enclosing File then delete it by invoking this method after the request has completed. The entity will have an enclosing File only if it was too huge to fit into memory.
        Parameters:
        httpMethod - - the httpMethod to clean up.
      • buildEntity

        protected org.apache.http.HttpEntity buildEntity​(ClientInvocation request)
                                                  throws IOException
        Build the HttpEntity to be sent to the Service as part of (POST) request. Creates a off-memory ManualClosingApacheHttpClient43Engine.FileExposingFileEntity or a regular in-memory ByteArrayEntity depending on if the request OutputStream fit into memory when built by calling.
        Parameters:
        request - -
        Returns:
        - the built HttpEntity
        Throws:
        IOException - -
      • getTempfilePrefix

        protected String getTempfilePrefix()
        Use context information, which will include node name, to avoid conflicts in case of multiple VMS using same temp directory location.
        Returns:
        -
      • createDefaultHttpClient

        protected org.apache.http.client.HttpClient createDefaultHttpClient()
      • getDefaultProxy

        public org.apache.http.HttpHost getDefaultProxy()
      • setRedirectRequired

        protected void setRedirectRequired​(ClientInvocation request,
                                           org.apache.http.client.methods.HttpRequestBase httpMethod)
      • setRedirectNotRequired

        protected void setRedirectNotRequired​(ClientInvocation request,
                                              org.apache.http.client.methods.HttpRequestBase httpMethod)
      • isClosed

        public boolean isClosed()