new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule());
@ConfiguresHttpCommandExecutorService public static class ProfitBricksHttpCommandExecutorServiceModule extends AbstractModule { @Override protected void configure() { install(new SSLModule()); bind(HttpCommandExecutorService.class).to(ResponseStatusFromPayloadHttpCommandExecutorService.class) .in(Scopes.SINGLETON); } @Provides public ParseSax<ServiceFault> serviceFaultParser(ParseSax.Factory factory, Injector injector) { return factory.create(injector.getInstance(ServiceFaultResponseHandler.class)); } }
/** * Configures {@link JavaUrlHttpCommandExecutorService}. * * Note that this uses threads */ @ConfiguresHttpCommandExecutorService public class JavaUrlHttpCommandExecutorServiceModule extends AbstractModule { @Override protected void configure() { install(new SSLModule()); bind(HttpCommandExecutorService.class).to(JavaUrlHttpCommandExecutorService.class).in(Scopes.SINGLETON); } }
new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule());
/** * Configures {@link JavaUrlHttpCommandExecutorService}. * * Note that this uses threads */ @ConfiguresHttpCommandExecutorService public class JavaUrlHttpCommandExecutorServiceModule extends AbstractModule { @Override protected void configure() { install(new SSLModule()); bind(HttpCommandExecutorService.class).to(JavaUrlHttpCommandExecutorService.class).in(Scopes.SINGLETON); } }
public void deleteBucket() { String accessId = System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR ); String secretKey = System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR ); Properties overrides = new Properties(); overrides.setProperty( "s3" + ".identity", accessId ); overrides.setProperty( "s3" + ".credential", secretKey ); Blob bo = null; BlobStore blobStore = null; final Iterable<? extends Module> MODULES = ImmutableSet .of(new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule()); BlobStoreContext context = ContextBuilder.newBuilder("s3").credentials( accessId, secretKey ).modules( MODULES ) .overrides( overrides ).buildView( BlobStoreContext.class ); blobStore = context.getBlobStore(); blobStore.deleteContainer( bucketName ); }
@ConfiguresHttpCommandExecutorService public static class ProfitBricksHttpCommandExecutorServiceModule extends AbstractModule { @Override protected void configure() { install(new SSLModule()); bind(HttpCommandExecutorService.class).to(ResponseStatusFromPayloadHttpCommandExecutorService.class) .in(Scopes.SINGLETON); } @Provides public ParseSax<ServiceFault> serviceFaultParser(ParseSax.Factory factory, Injector injector) { return factory.create(injector.getInstance(ServiceFaultResponseHandler.class)); } }
.of( new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule() );
/** * Configures {@link JavaUrlHttpCommandExecutorService}. * * Note that this uses threads */ @ConfiguresHttpCommandExecutorService public class JavaUrlHttpCommandExecutorServiceModule extends AbstractModule { @Override protected void configure() { install(new SSLModule()); bind(HttpCommandExecutorService.class).to(JavaUrlHttpCommandExecutorService.class).in(Scopes.SINGLETON); } }
/** * Delete the configured s3 bucket. */ public void deleteBucket() { logger.debug("\n\nDelete bucket\n"); String accessId = System.getProperty(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR); String secretKey = System.getProperty(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR); Properties overrides = new Properties(); overrides.setProperty("s3" + ".identity", accessId); overrides.setProperty("s3" + ".credential", secretKey); final Iterable<? extends Module> MODULES = ImmutableSet .of(new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule()); BlobStoreContext context = ContextBuilder.newBuilder("s3").credentials(accessId, secretKey).modules(MODULES) .overrides(overrides).buildView(BlobStoreContext.class); BlobStore blobStore = context.getBlobStore(); blobStore.deleteContainer( bucketName ); }
/** * Configures {@link JavaUrlHttpCommandExecutorService}. * * Note that this uses threads * * @author Adrian Cole */ @ConfiguresHttpCommandExecutorService public class JavaUrlHttpCommandExecutorServiceModule extends AbstractModule { @Override protected void configure() { install(new SSLModule()); bind(HttpCommandExecutorService.class).to(JavaUrlHttpCommandExecutorService.class).in(Scopes.SINGLETON); } }
.of(new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule());
@ConfiguresHttpCommandExecutorService static class HttpModule extends AbstractModule { protected void configure() { } }
new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule() );
@ConfiguresHttpCommandExecutorService static class HttpModule extends AbstractModule { protected void configure() { } }
new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule());
final Iterable<? extends Module> MODULES = ImmutableSet.of( new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule() );
new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule() );
protected Module createConnectionModule() { return new JavaUrlHttpCommandExecutorServiceModule(); }
@Override protected Module createConnectionModule() { return new JavaUrlHttpCommandExecutorServiceModule(); }