org.jclouds.http.internal
Class JavaUrlHttpCommandExecutorService

java.lang.Object
  extended by org.jclouds.http.internal.BaseHttpCommandExecutorService<HttpURLConnection>
      extended by org.jclouds.http.internal.JavaUrlHttpCommandExecutorService
All Implemented Interfaces:
HttpCommandExecutorService

@Singleton
public class JavaUrlHttpCommandExecutorService
extends BaseHttpCommandExecutorService<HttpURLConnection>

Basic implementation of a HttpCommandExecutorService.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jclouds.http.internal.BaseHttpCommandExecutorService
BaseHttpCommandExecutorService.HttpResponseCallable
 
Field Summary
static String DEFAULT_USER_AGENT
           
protected  com.google.common.base.Function<URI,Proxy> proxyForURI
           
protected  com.google.common.base.Supplier<SSLContext> sslContextSupplier
           
protected  com.google.common.base.Supplier<SSLContext> untrustedSSLContextProvider
           
protected  HostnameVerifier verifier
           
 
Fields inherited from class org.jclouds.http.internal.BaseHttpCommandExecutorService
contentMetadataCodec, errorHandler, headerLog, ioExecutor, ioRetryHandler, logger, retryHandler, utils, wire
 
Constructor Summary
JavaUrlHttpCommandExecutorService(HttpUtils utils, ContentMetadataCodec contentMetadataCodec, com.google.common.util.concurrent.ListeningExecutorService ioExecutor, DelegatingRetryHandler retryHandler, IOExceptionRetryHandler ioRetryHandler, DelegatingErrorHandler errorHandler, HttpWire wire, HostnameVerifier verifier, com.google.common.base.Supplier<SSLContext> untrustedSSLContextProvider, com.google.common.base.Function<URI,Proxy> proxyForURI)
           
 
Method Summary
protected  void cleanup(HttpURLConnection connection)
           
protected  void configureRequestHeaders(HttpURLConnection connection, HttpRequest request)
          Configure the HTTP request headers in the connection.
protected  HttpURLConnection convert(HttpRequest request)
           
protected  HttpURLConnection initConnection(HttpRequest request)
          Creates and initializes the connection.
protected  HttpResponse invoke(HttpURLConnection connection)
           
protected  void writeNothing(HttpURLConnection connection)
           
 
Methods inherited from class org.jclouds.http.internal.BaseHttpCommandExecutorService
invoke, submit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_USER_AGENT

public static final String DEFAULT_USER_AGENT

untrustedSSLContextProvider

protected final com.google.common.base.Supplier<SSLContext> untrustedSSLContextProvider

proxyForURI

protected final com.google.common.base.Function<URI,Proxy> proxyForURI

verifier

protected final HostnameVerifier verifier

sslContextSupplier

@Inject(optional=true)
protected com.google.common.base.Supplier<SSLContext> sslContextSupplier
Constructor Detail

JavaUrlHttpCommandExecutorService

@Inject
public JavaUrlHttpCommandExecutorService(HttpUtils utils,
                                                ContentMetadataCodec contentMetadataCodec,
                                                @Named(value="jclouds.io-worker-threads")
                                                com.google.common.util.concurrent.ListeningExecutorService ioExecutor,
                                                DelegatingRetryHandler retryHandler,
                                                IOExceptionRetryHandler ioRetryHandler,
                                                DelegatingErrorHandler errorHandler,
                                                HttpWire wire,
                                                @Named(value="untrusted")
                                                HostnameVerifier verifier,
                                                @Named(value="untrusted")
                                                com.google.common.base.Supplier<SSLContext> untrustedSSLContextProvider,
                                                com.google.common.base.Function<URI,Proxy> proxyForURI)
                                  throws SecurityException,
                                         NoSuchFieldException
Throws:
SecurityException
NoSuchFieldException
Method Detail

invoke

protected HttpResponse invoke(HttpURLConnection connection)
                       throws IOException,
                              InterruptedException
Specified by:
invoke in class BaseHttpCommandExecutorService<HttpURLConnection>
Throws:
IOException
InterruptedException

convert

protected HttpURLConnection convert(HttpRequest request)
                             throws IOException,
                                    InterruptedException
Specified by:
convert in class BaseHttpCommandExecutorService<HttpURLConnection>
Throws:
IOException
InterruptedException

initConnection

protected HttpURLConnection initConnection(HttpRequest request)
                                    throws IOException
Creates and initializes the connection.

Throws:
IOException

configureRequestHeaders

protected void configureRequestHeaders(HttpURLConnection connection,
                                       HttpRequest request)
Configure the HTTP request headers in the connection.


writeNothing

protected void writeNothing(HttpURLConnection connection)

cleanup

protected void cleanup(HttpURLConnection connection)
Specified by:
cleanup in class BaseHttpCommandExecutorService<HttpURLConnection>


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.