org.jclouds.trmk.vcloud_0_8.config
Class TerremarkVCloudRestClientModule<S extends TerremarkVCloudClient,A extends TerremarkVCloudAsyncClient>

java.lang.Object
  extended by com.google.inject.AbstractModule
      extended by org.jclouds.rest.config.RestClientModule<S,A>
          extended by org.jclouds.trmk.vcloud_0_8.config.TerremarkVCloudRestClientModule<S,A>
All Implemented Interfaces:
com.google.inject.Module
Direct Known Subclasses:
TerremarkECloudRestClientModule, TerremarkVCloudExpressRestClientModule

public class TerremarkVCloudRestClientModule<S extends TerremarkVCloudClient,A extends TerremarkVCloudAsyncClient>
extends RestClientModule<S,A>


Nested Class Summary
static class TerremarkVCloudRestClientModule.OrgCatalogItemSupplier
           
static class TerremarkVCloudRestClientModule.OrgCatalogSupplier
           
static class TerremarkVCloudRestClientModule.OrgMapSupplier
           
static class TerremarkVCloudRestClientModule.OrgNameToKeysListSupplier
           
static class TerremarkVCloudRestClientModule.OrgVDCSupplier
           
static class TerremarkVCloudRestClientModule.URItoVDC
           
 
Field Summary
 
Fields inherited from class org.jclouds.rest.config.RestClientModule
asyncClientType, delegates, syncClientType
 
Constructor Summary
TerremarkVCloudRestClientModule(Class<S> syncClientType, Class<A> asyncClientType)
           
TerremarkVCloudRestClientModule(Class<S> syncClientType, Class<A> asyncClientType, Map<Class<?>,Class<?>> delegateMap)
           
 
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(TerremarkVCloudVersionsAsyncClient 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, TerremarkVCloudRestClientModule.OrgCatalogSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,Map<String,Map<String,? extends CatalogItem>>>> provideOrgCatalogItemSupplierCache(long seconds, AtomicReference<AuthorizationException> authException, TerremarkVCloudRestClientModule.OrgCatalogItemSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,? extends Org>> provideOrgMapCache(long seconds, AtomicReference<AuthorizationException> authException, TerremarkVCloudRestClientModule.OrgMapSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,ReferenceType>> provideOrgToKeysListCache(long seconds, AtomicReference<AuthorizationException> authException, TerremarkVCloudRestClientModule.OrgNameToKeysListSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<String,Map<String,? extends VDC>>> provideOrgVDCSupplierCache(long seconds, AtomicReference<AuthorizationException> authException, TerremarkVCloudRestClientModule.OrgVDCSupplier supplier)
           
protected  com.google.common.base.Supplier<Map<URI,? extends VDC>> provideURIToVDC(long seconds, AtomicReference<AuthorizationException> authException, TerremarkVCloudRestClientModule.URItoVDC supplier)
           
protected  TerremarkVCloudLoginAsyncClient provideVCloudLogin(AsyncClientFactory factory)
           
protected  com.google.common.base.Supplier<VCloudSession> provideVCloudTokenCache(long seconds, AtomicReference<AuthorizationException> authException, TerremarkVCloudLoginAsyncClient login)
           
protected  TerremarkVCloudVersionsAsyncClient provideVCloudVersions(AsyncClientFactory factory)
           
protected  com.google.common.base.Supplier<Map<String,ReferenceType>> provideVDCtoORG(long seconds, AtomicReference<AuthorizationException> authException, org.jclouds.trmk.vcloud_0_8.config.TerremarkVCloudRestClientModule.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
 

Constructor Detail

TerremarkVCloudRestClientModule

public TerremarkVCloudRestClientModule(Class<S> syncClientType,
                                       Class<A> asyncClientType)

TerremarkVCloudRestClientModule

public TerremarkVCloudRestClientModule(Class<S> syncClientType,
                                       Class<A> asyncClientType,
                                       Map<Class<?>,Class<?>> delegateMap)
Method Detail

configure

protected void configure()
Overrides:
configure in class RestClientModule<S extends TerremarkVCloudClient,A extends TerremarkVCloudAsyncClient>

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,
                                                                                                           TerremarkVCloudRestClientModule.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.trmk.vcloud_0_8.config.TerremarkVCloudRestClientModule.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,
                                                                                                     TerremarkVCloudRestClientModule.URItoVDC supplier)

provideAuthenticationURI

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

provideVCloudVersions

@Provides
@Singleton
protected TerremarkVCloudVersionsAsyncClient 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,
                                                                                                                                              TerremarkVCloudRestClientModule.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,
                                                                                                                               TerremarkVCloudRestClientModule.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,
                                                                                                                                                           TerremarkVCloudRestClientModule.OrgCatalogItemSupplier supplier)

provideVCloudLogin

@Provides
@Singleton
protected TerremarkVCloudLoginAsyncClient provideVCloudLogin(AsyncClientFactory factory)

provideVCloudTokenCache

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

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<S extends TerremarkVCloudClient,A extends TerremarkVCloudAsyncClient>

provideOrgToKeysListCache

@Provides
@Singleton
protected com.google.common.base.Supplier<Map<String,ReferenceType>> provideOrgToKeysListCache(@Named(value="jclouds.session-interval")
                                                                                                                  long seconds,
                                                                                                                  AtomicReference<AuthorizationException> authException,
                                                                                                                  TerremarkVCloudRestClientModule.OrgNameToKeysListSupplier supplier)


Copyright © 2009-2011 jclouds. All Rights Reserved.