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, authException, delegates, syncClientType, URI_SUPPLIER_TYPE
 
Constructor Summary
VCloudRestClientModule()
           
 
Method Summary
protected  void bindCacheLoaders()
           
protected  void bindErrorHandlers()
          overrides this to change the default error handlers for the http engine ex.
protected  void configure()
           
protected  FenceMode defaultFenceMode(String fenceMode)
           
protected  com.google.common.cache.LoadingCache<URI,Envelope> envelopes(com.google.common.cache.CacheLoader<URI,Envelope> envelopes)
           
protected  void installDefaultVCloudEndpointsModule()
           
protected  void installLocations()
           
protected  com.google.common.base.Supplier<URI> provideAuthenticationURI(VCloudVersionsClient versionService, String version)
           
protected  Org provideOrg(com.google.common.base.Supplier<Map<String,Org>> orgSupplier, ReferenceType defaultOrg)
           
protected  com.google.common.base.Supplier<Map<String,Map<String,Catalog>>> provideOrgCatalogItemMapSupplierCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.OrgCatalogSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,Map<String,Map<String,CatalogItem>>>> provideOrgCatalogItemSupplierCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.OrgCatalogItemSupplier supplier)
           
protected  com.google.common.base.Supplier<URI> provideOrgListURI(com.google.common.base.Supplier<VCloudSession> sessionSupplier)
           
protected  com.google.common.base.Supplier<Map<String,Org>> provideOrgMapCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.OrgMapSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,Map<String,VDC>>> provideOrgVDCSupplierCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.OrgVDCSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<URI,VDC>> provideURIToVDC(long seconds, AtomicReference<AuthorizationException> authException, VCloudRestClientModule.URItoVDC supplier)
           
protected  com.google.common.base.Supplier<VCloudSession> provideVCloudTokenCache(long seconds, AtomicReference<AuthorizationException> authException, VCloudLoginClient login)
           
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,Org>> orgNameToOrgSuppier)
           
protected  com.google.common.base.Predicate<URI> successTester(com.google.inject.Injector injector, long completed)
           
protected  com.google.common.cache.LoadingCache<URI,VAppTemplate> vAppTemplates(com.google.common.cache.CacheLoader<URI,VAppTemplate> vAppTemplates)
           
 
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

provideVCloudTokenCache

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

configure

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

bindCacheLoaders

protected void bindCacheLoaders()

provideVDCtoORG

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

provideOrgMapCache

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

provideOrgListURI

@Provides
@Singleton
protected com.google.common.base.Supplier<URI> provideOrgListURI(com.google.common.base.Supplier<VCloudSession> sessionSupplier)

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,VDC>> provideURIToVDC(@Named(value="jclouds.session-interval")
                                                                                           long seconds,
                                                                                           AtomicReference<AuthorizationException> authException,
                                                                                           VCloudRestClientModule.URItoVDC supplier)

provideAuthenticationURI

@Provides
@Singleton
protected com.google.common.base.Supplier<URI> provideAuthenticationURI(VCloudVersionsClient versionService,
                                                                                           @Named(value="jclouds.api-version")
                                                                                           String version)

provideOrg

@Provides
@Singleton
protected Org provideOrg(com.google.common.base.Supplier<Map<String,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,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,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,CatalogItem>>>> provideOrgCatalogItemSupplierCache(@Named(value="jclouds.session-interval")
                                                                                                                                                 long seconds,
                                                                                                                                                 AtomicReference<AuthorizationException> authException,
                                                                                                                                                 VCloudRestClientModule.OrgCatalogItemSupplier supplier)

defaultFenceMode

@Provides
@Singleton
protected FenceMode defaultFenceMode(@Named(value="jclouds.vcloud.defaults.fencemode")
                                                        String fenceMode)

vAppTemplates

@Provides
@Singleton
protected com.google.common.cache.LoadingCache<URI,VAppTemplate> vAppTemplates(com.google.common.cache.CacheLoader<URI,VAppTemplate> vAppTemplates)

envelopes

@Provides
@Singleton
protected com.google.common.cache.LoadingCache<URI,Envelope> envelopes(com.google.common.cache.CacheLoader<URI,Envelope> envelopes)

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>

installLocations

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


Copyright © 2009-2012 jclouds. All Rights Reserved.