Class URLConnectionEngine

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.net.ssl.HostnameVerifier hostnameVerifier  
      protected javax.net.ssl.SSLContext sslContext  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      protected void commitHeaders​(ClientInvocation request, java.net.HttpURLConnection connection)
      Add headers to HttpURLConnection from ClientInvocation.
      protected java.net.HttpURLConnection createConnection​(ClientInvocation request)
      Create HttpUrlConnection from ClientInvorcation and set request method
      protected void executeRequest​(ClientInvocation request, java.net.HttpURLConnection connection)
      Execute request using HttpURLConnection with body from invocation if needed.
      protected javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getHeaders​(java.net.HttpURLConnection connection)
      Create map with response headers.
      javax.net.ssl.HostnameVerifier getHostnameVerifier()
      {inheritDoc}
      javax.net.ssl.SSLContext getSslContext()
      {inheritDoc}
      ClientResponse invoke​(ClientInvocation request)
      void setHostnameVerifier​(javax.net.ssl.HostnameVerifier hostnameVerifier)  
      void setSslContext​(javax.net.ssl.SSLContext sslContext)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sslContext

        protected javax.net.ssl.SSLContext sslContext
      • hostnameVerifier

        protected javax.net.ssl.HostnameVerifier hostnameVerifier
    • Constructor Detail

      • URLConnectionEngine

        public URLConnectionEngine()
    • Method Detail

      • getHeaders

        protected javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getHeaders​(java.net.HttpURLConnection connection)
        Create map with response headers.
        Parameters:
        connection - - HttpURLConnection
        Returns:
        map key - list of values
      • createConnection

        protected java.net.HttpURLConnection createConnection​(ClientInvocation request)
                                                       throws java.io.IOException
        Create HttpUrlConnection from ClientInvorcation and set request method
        Parameters:
        request - ClientInvocation
        Returns:
        HttpURLConnection with method & url already set
        Throws:
        java.io.IOException - if url or io exceptions
      • executeRequest

        protected void executeRequest​(ClientInvocation request,
                                      java.net.HttpURLConnection connection)
        Execute request using HttpURLConnection with body from invocation if needed.
        Parameters:
        request - ClientInvocation
        connection - HttpURLConnection
      • commitHeaders

        protected void commitHeaders​(ClientInvocation request,
                                     java.net.HttpURLConnection connection)
        Add headers to HttpURLConnection from ClientInvocation. Should be executed before writing body.
        Parameters:
        request - ClientInvocation
        connection - HttpURLConnection
      • getSslContext

        public javax.net.ssl.SSLContext getSslContext()
        {inheritDoc}
        Specified by:
        getSslContext in interface ClientHttpEngine
        Returns:
      • setSslContext

        public void setSslContext​(javax.net.ssl.SSLContext sslContext)
      • setHostnameVerifier

        public void setHostnameVerifier​(javax.net.ssl.HostnameVerifier hostnameVerifier)