org.jclouds.vcloud.config
Class VCloudRestClientModule

java.lang.Object
  extended by com.google.inject.AbstractModule
      extended by org.jclouds.rest.config.RestClientModule<VCloudClient,VCloudAsyncClient>
          extended by org.jclouds.vcloud.config.VCloudRestClientModule
All Implemented Interfaces:
com.google.inject.Module
Direct Known Subclasses:
BluelockVCloudZone01RestClientModule, GreenHouseDataElementVCloudRestClientModule, StratoGenVCloudMyCloudRestClientModule

public class VCloudRestClientModule
extends RestClientModule<VCloudClient,VCloudAsyncClient>

Configures the VCloud authentication service connection, including logging and http transport.

Author:
Adrian Cole

Nested Class Summary
static class VCloudRestClientModule.OrgCatalogItemSupplier
           
static class VCloudRestClientModule.OrgCatalogSupplier
           
static class VCloudRestClientModule.OrgMapSupplier
           
static class VCloudRestClientModule.OrgVDCSupplier
           
static class VCloudRestClientModule.URItoVDC
           
 
Field Summary
static Map<Class<?>,Class<?>> DELEGATE_MAP
           
 
Fields inherited from class org.jclouds.rest.config.RestClientModule
asyncClientType, delegates, syncClientType
 
Constructor Summary
VCloudRestClientModule()
           
 
Method Summary
protected  void bindErrorHandlers()
          overrides this to change the default error handlers for the http engine ex.
protected  void configure()
           
protected  void installDefaultVCloudEndpointsModule()
           
protected  URI provideAuthenticationURI(VCloudVersionsAsyncClient versionService, String version)
           
protected  Org provideOrg(com.google.common.base.Supplier<Map<String,? extends Org>> orgSupplier, ReferenceType defaultOrg)
           
protected  com.google.common.base.Supplier<Map<String,Map<String,? extends Catalog>>> provideOrgCatalogItemMapSupplierCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.OrgCatalogSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,Map<String,Map<String,? extends CatalogItem>>>> provideOrgCatalogItemSupplierCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.OrgCatalogItemSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,? extends Org>> provideOrgMapCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.OrgMapSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,Map<String,? extends VDC>>> provideOrgVDCSupplierCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.OrgVDCSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<URI,? extends VDC>> provideURIToVDC(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.URItoVDC supplier)
           
protected  VCloudLoginAsyncClient provideVCloudLogin(AsyncClientFactory factory)
           
protected  com.google.common.base.Supplier<VCloudSession> provideVCloudTokenCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudLoginAsyncClient login)
           
protected  VCloudVersionsAsyncClient provideVCloudVersions(AsyncClientFactory factory)
           
protected  com.google.common.base.Supplier<Map<String,ReferenceType>> provideVDCtoORG(long seconds, AtomicReference<AuthorizationException> authException, org.jclouds.vcloud.config.VCloudRestClientModule.OrgNameToOrgSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,String>> provideVDCtoORG(com.google.common.base.Supplier<Map<String,? extends Org>> orgNameToOrgSuppier)
           
protected  com.google.common.base.Predicate<URI> successTester(com.google.inject.Injector injector, long completed)
           
 
Methods inherited from class org.jclouds.rest.config.RestClientModule
bindAsyncClient, bindClient, bindRetryHandlers
 
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELEGATE_MAP

public static final Map<Class<?>,Class<?>> DELEGATE_MAP
Constructor Detail

VCloudRestClientModule

public VCloudRestClientModule()
Method Detail

provideVCloudLogin

@Provides
@Singleton
protected VCloudLoginAsyncClient provideVCloudLogin(AsyncClientFactory factory)

provideVCloudTokenCache

@Provides
@Singleton
protected com.google.common.base.Supplier<VCloudSession> provideVCloudTokenCache(@Named(value="jclouds.session-interval")
                                                                                                    long seconds,
                                                                                                    AtomicReference<AuthorizationException> authException,
                                                                                                    VCloudLoginAsyncClient login)

configure

protected void configure()
Overrides:
configure in class RestClientModule<VCloudClient,VCloudAsyncClient>

provideVDCtoORG

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,String>> provideVDCtoORG(com.google.common.base.Supplier<Map<String,? extends Org>> orgNameToOrgSuppier)

provideOrgMapCache

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,? extends Org>> provideOrgMapCache(@Named(value="jclouds.session-interval")
                                                                                                           long seconds,
                                                                                                           AtomicReference<AuthorizationException> authException,
                                                                                                           VCloudRestClientModule.OrgMapSupplier supplier)

installDefaultVCloudEndpointsModule

protected void installDefaultVCloudEndpointsModule()

provideVDCtoORG

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,ReferenceType>> provideVDCtoORG(@Named(value="jclouds.session-interval")
                                                                                                        long seconds,
                                                                                                        AtomicReference<AuthorizationException> authException,
                                                                                                        org.jclouds.vcloud.config.VCloudRestClientModule.OrgNameToOrgSupplier supplier)

provideURIToVDC

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<URI,? extends VDC>> provideURIToVDC(@Named(value="jclouds.session-interval")
                                                                                                     long seconds,
                                                                                                     AtomicReference<AuthorizationException> authException,
                                                                                                     VCloudRestClientModule.URItoVDC supplier)

provideAuthenticationURI

@Provides
@Singleton
protected URI provideAuthenticationURI(VCloudVersionsAsyncClient versionService,
                                                          @Named(value="jclouds.api-version")
                                                          String version)
                                throws InterruptedException,
                                       ExecutionException,
                                       TimeoutException
Throws:
InterruptedException
ExecutionException
TimeoutException

provideVCloudVersions

@Provides
@Singleton
protected VCloudVersionsAsyncClient provideVCloudVersions(AsyncClientFactory factory)

provideOrg

@Provides
@Singleton
protected Org provideOrg(com.google.common.base.Supplier<Map<String,? extends Org>> orgSupplier,
                                            ReferenceType defaultOrg)

successTester

@Provides
@Singleton
protected com.google.common.base.Predicate<URI> successTester(com.google.inject.Injector injector,
                                                                                 @Named(value="jclouds.vcloud.timeout.task-complete")
                                                                                 long completed)

provideOrgCatalogItemMapSupplierCache

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,Map<String,? extends Catalog>>> provideOrgCatalogItemMapSupplierCache(@Named(value="jclouds.session-interval")
                                                                                                                                              long seconds,
                                                                                                                                              AtomicReference<AuthorizationException> authException,
                                                                                                                                              VCloudRestClientModule.OrgCatalogSupplier supplier)

provideOrgVDCSupplierCache

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,Map<String,? extends VDC>>> provideOrgVDCSupplierCache(@Named(value="jclouds.session-interval")
                                                                                                                               long seconds,
                                                                                                                               AtomicReference<AuthorizationException> authException,
                                                                                                                               VCloudRestClientModule.OrgVDCSupplier supplier)

provideOrgCatalogItemSupplierCache

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,Map<String,Map<String,? extends CatalogItem>>>> provideOrgCatalogItemSupplierCache(@Named(value="jclouds.session-interval")
                                                                                                                                                           long seconds,
                                                                                                                                                           AtomicReference<AuthorizationException> authException,
                                                                                                                                                           VCloudRestClientModule.OrgCatalogItemSupplier supplier)

bindErrorHandlers

protected void bindErrorHandlers()
Description copied from class: RestClientModule
overrides this to change the default error handlers for the http engine ex.
 bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(
       ParseAWSErrorFromXmlContent.class);
 bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(
       ParseAWSErrorFromXmlContent.class);
 bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(
       ParseAWSErrorFromXmlContent.class);
 

Overrides:
bindErrorHandlers in class RestClientModule<VCloudClient,VCloudAsyncClient>


Copyright © 2009-2011 jclouds. All Rights Reserved.