org.jclouds.cloudstack.config
Class CloudStackRestClientModule
java.lang.Object
com.google.inject.AbstractModule
org.jclouds.rest.config.RestClientModule<CloudStackClient,CloudStackAsyncClient>
org.jclouds.cloudstack.config.CloudStackRestClientModule
- All Implemented Interfaces:
- com.google.inject.Module
public class CloudStackRestClientModule
- extends RestClientModule<CloudStackClient,CloudStackAsyncClient>
Configures the cloudstack connection.
- Author:
- Adrian Cole
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 |
DELEGATE_MAP
public static final Map<Class<?>,Class<?>> DELEGATE_MAP
CloudStackRestClientModule
public CloudStackRestClientModule()
bindAsyncClient
protected void bindAsyncClient()
- Overrides:
bindAsyncClient
in class RestClientModule<CloudStackClient,CloudStackAsyncClient>
bindClient
protected void bindClient()
- Overrides:
bindClient
in class RestClientModule<CloudStackClient,CloudStackAsyncClient>
configure
protected void configure()
- Overrides:
configure
in class RestClientModule<CloudStackClient,CloudStackAsyncClient>
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<CloudStackClient,CloudStackAsyncClient>
authenticationFilterForCredentialType
@Provides
protected AuthenticationFilter authenticationFilterForCredentialType(CredentialType credentialType,
AddSessionKeyAndJSessionIdToRequest addSessionKeyAndJSessionIdToRequest,
QuerySigner querySigner)
- we use the type of credentials specified at login to determine which way we want to filter the
request.
for ex, if we are getting passwords, we know we will need to login/logout. Otherwise we are
signing requests.
makeSureFilterRetriesOnTimeout
@Provides
protected com.google.common.base.Function<Credentials,LoginResponse> makeSureFilterRetriesOnTimeout(LoginWithPasswordCredentials loginWithPasswordCredentials)
provideLoginResponseCache
@Provides
public com.google.common.cache.LoadingCache<Credentials,LoginResponse> provideLoginResponseCache(com.google.common.base.Function<Credentials,LoginResponse> getLoginResponse,
int seconds)
provideLoginResponseSupplier
@Provides
protected com.google.common.base.Supplier<LoginResponse> provideLoginResponseSupplier(com.google.common.cache.LoadingCache<Credentials,LoginResponse> cache,
Credentials creds)
Copyright © 2009-2012 jclouds. All Rights Reserved.