Package org.jclouds.s3.config
Class S3HttpApiModule<S extends S3Client>
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- org.jclouds.rest.config.RestModule
-
- org.jclouds.rest.config.HttpApiModule<A>
-
- org.jclouds.aws.config.AWSHttpApiModule<S>
-
- org.jclouds.s3.config.S3HttpApiModule<S>
-
- All Implemented Interfaces:
com.google.inject.Module
- Direct Known Subclasses:
AWSS3HttpApiModule
public class S3HttpApiModule<S extends S3Client> extends AWSHttpApiModule<S>
Configures the S3 connection, including logging and http transport.
-
-
Field Summary
-
Fields inherited from class org.jclouds.rest.config.HttpApiModule
api
-
Fields inherited from class org.jclouds.rest.config.RestModule
authException
-
-
Constructor Summary
Constructors Modifier Constructor Description S3HttpApiModule()protectedS3HttpApiModule(Class<S> syncClientType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbindErrorHandlers()overrides this to change the default error handlers for the http engine ex.protected voidbindRequestSigner()protected voidbindRetryHandlers()overrides this to change the default retry handlers for the http engine ex.protected com.google.common.cache.CacheLoader<String,com.google.common.base.Optional<String>>bucketToRegion(com.google.common.base.Supplier<Set<String>> regionSupplier, S3Client client)protected com.google.common.cache.LoadingCache<String,com.google.common.base.Optional<String>>bucketToRegion(com.google.common.cache.CacheLoader<String,com.google.common.base.Optional<String>> loader)protected voidconfigure()protected com.google.common.base.Supplier<String>defaultRegionForBucket(com.google.common.base.Supplier<String> defaultRegion)protected StringguiceProvideTimeStamp(com.google.common.base.Supplier<String> cache)protected com.google.common.base.Supplier<Date>guiceProvideTimeStampCacheDate(long seconds, com.google.common.base.Supplier<String> timestamp, DateService dateService)borrowing concurrency code to ensure that caching takes place properlyprotected com.google.common.cache.CacheLoader<String,com.google.common.base.Optional<String>>provideBucketToRegion(com.google.common.base.Supplier<Set<String>> regionSupplier, S3Client client)protected com.google.common.base.Supplier<URI>provideBucketURI(com.google.common.base.Supplier<String> defaultRegion, RegionToEndpointOrProviderIfNull regionToEndpoint)protected com.google.common.base.Supplier<String>provideDefaultRegionForBucket(com.google.common.base.Supplier<String> defaultRegion)protected RequestSignerprovideRequestSigner(RequestAuthorizeSignature in)protected StringprovideTimeStamp(com.google.common.base.Supplier<String> cache)protected com.google.common.base.Supplier<String>provideTimeStampCache(long seconds, DateService dateService)borrowing concurrency code to ensure that caching takes place properlyprotected com.google.common.base.Supplier<Date>provideTimeStampCacheDate(long seconds, com.google.common.base.Supplier<String> timestamp, DateService dateService)protected DateprovideTimeStampDate(com.google.common.base.Supplier<Date> cache)-
Methods inherited from class org.jclouds.aws.config.AWSHttpApiModule
provideRetryableCodes, provideRetryableServerCodes
-
Methods inherited from class org.jclouds.rest.config.RestModule
installLocations
-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
-
-
-
Method Detail
-
provideBucketToRegion
@Provides @Singleton protected final com.google.common.cache.CacheLoader<String,com.google.common.base.Optional<String>> provideBucketToRegion(com.google.common.base.Supplier<Set<String>> regionSupplier, S3Client client)
-
bucketToRegion
protected com.google.common.cache.CacheLoader<String,com.google.common.base.Optional<String>> bucketToRegion(com.google.common.base.Supplier<Set<String>> regionSupplier, S3Client client)
-
bucketToRegion
@Provides @Singleton protected final com.google.common.cache.LoadingCache<String,com.google.common.base.Optional<String>> bucketToRegion(com.google.common.cache.CacheLoader<String,com.google.common.base.Optional<String>> loader)
-
provideDefaultRegionForBucket
@Provides @Singleton protected final com.google.common.base.Supplier<String> provideDefaultRegionForBucket(com.google.common.base.Supplier<String> defaultRegion)
-
defaultRegionForBucket
protected com.google.common.base.Supplier<String> defaultRegionForBucket(com.google.common.base.Supplier<String> defaultRegion)
-
provideBucketURI
@Provides @Singleton protected final com.google.common.base.Supplier<URI> provideBucketURI(com.google.common.base.Supplier<String> defaultRegion, RegionToEndpointOrProviderIfNull regionToEndpoint)
-
configure
protected void configure()
- Overrides:
configurein classHttpApiModule<S extends S3Client>
-
bindErrorHandlers
protected void bindErrorHandlers()
Description copied from class:HttpApiModuleoverrides 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:
bindErrorHandlersin classAWSHttpApiModule<S extends S3Client>
-
bindRequestSigner
protected void bindRequestSigner()
-
provideRequestSigner
@Provides @Singleton protected final RequestSigner provideRequestSigner(RequestAuthorizeSignature in)
-
bindRetryHandlers
protected void bindRetryHandlers()
Description copied from class:HttpApiModuleoverrides this to change the default retry handlers for the http engine ex.bind(HttpRetryHandler.class).annotatedWith(Redirection.class).to(AWSRedirectionRetryHandler.class); bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(AWSClientErrorRetryHandler.class);
- Overrides:
bindRetryHandlersin classAWSHttpApiModule<S extends S3Client>
-
guiceProvideTimeStamp
@Provides protected final String guiceProvideTimeStamp(com.google.common.base.Supplier<String> cache)
-
provideTimeStampCache
@Provides @Singleton protected final com.google.common.base.Supplier<String> provideTimeStampCache(@Named("jclouds.session-interval") long seconds, DateService dateService)
borrowing concurrency code to ensure that caching takes place properly
-
provideTimeStampDate
@Provides protected Date provideTimeStampDate(com.google.common.base.Supplier<Date> cache)
-
guiceProvideTimeStampCacheDate
@Provides @Singleton protected final com.google.common.base.Supplier<Date> guiceProvideTimeStampCacheDate(@Named("jclouds.session-interval") long seconds, com.google.common.base.Supplier<String> timestamp, DateService dateService)
borrowing concurrency code to ensure that caching takes place properly
-
provideTimeStampCacheDate
protected com.google.common.base.Supplier<Date> provideTimeStampCacheDate(@Named("jclouds.session-interval") long seconds, com.google.common.base.Supplier<String> timestamp, DateService dateService)
-
-