Refine search
@Override protected void configure() { bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(RetryOnRenew.class); bindHttpApi(binder(), V2AuthenticationApi.class); bindHttpApi(binder(), V3AuthenticationApi.class); }
@Override protected void configure() { // AuthenticationApi is used directly for filters and retry handlers, so let's bind it explicitly bindSyncToAsyncHttpApi(binder(), AuthenticationApi.class, AuthenticationAsyncApi.class); }
/** * adds an explicit binding for {@code async} by parsing its annotations. * * @param <S> * sync interface that blocks * @param <A> * api type with http annotations * @param binder * guice binder * @param api * type with http annotations */ public static <S, A> void bindHttpApi(Binder binder, Class<A> api) { bindClass(binder, api); bindAnnotatedHttpApiProvider(binder, api); }
/** * adds an explicit binding for {@code async} by parsing its annotations. Then, adds an explicit binding for an * interface which synchronously blocks on similar calls to an {@code async} type. * * @param <S> * sync interface that blocks * @param <A> * async type where all methods have same args as {@code sync}, but returns {@link ListenableFuture} * @param binder * guice binder * @param sync * type interface that blocks * @param async * type type that returns {@link ListenableFuture} * * @deprecated will be removed in jclouds 1.7, as async interfaces are no * longer supported. */ @Deprecated public static <S, A> void bindSyncToAsyncHttpApi(Binder binder, Class<S> sync, Class<A> async) { bindClass(binder, sync); bindClass(binder, async); bindAnnotatedSyncToAsyncHttpApiProvider(binder, async); bindHttpApiProvider(binder, sync, async); }
/** * adds an explicit binding for an interface which synchronously blocks on * similar calls to an {@code async} type. * * @param <S> * sync interface that blocks * @param <A> * async type where all methods have same args as {@code sync}, but * returns {@link ListenableFuture} * @param binder * guice binder * @param sync * type interface that blocks * @param async * type type that returns {@link ListenableFuture} * * @deprecated will be removed in jclouds 1.7, as async interfaces are no * longer supported. */ @Deprecated public static <S, A> void bindSyncToAsyncApi(Binder binder, Class<S> sync, Class<A> async) { bindClass(binder, sync); bindClass(binder, async); bindCallGetOnFutures(binder, sync, async); }
@Override public void configure() { bind(new TypeLiteral<Function<Invocation, Object>>() { }).to(InvokeHttpMethod.class); bindHttpApi(binder(), HttpClient.class); } });
super.configure(); bind(ComputeService.class).to(GoogleComputeEngineService.class); }).to(GoogleComputeEngineServiceAdapter.class); bind(TemplateBuilderImpl.class).to(GoogleComputeEngineArbitraryCpuRamTemplateBuilderImpl.class); }).to(SubnetworkLoader.class); bindHttpApi(binder(), Resources.class);
@Override protected void configure() { bind(AsyncBlobStore.class).to(LocalAsyncBlobStore.class).asEagerSingleton(); // forward all requests from TransientBlobStore to TransientAsyncBlobStore. needs above binding as cannot proxy a class bindSyncToAsyncApi(binder(), LocalBlobStore.class, AsyncBlobStore.class); install(new BlobStoreObjectModule()); bind(BlobStore.class).to(LocalBlobStore.class); bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT); bind(LocalStorageStrategy.class).to(TransientStorageStrategy.class); bind(BlobRequestSigner.class).to(LocalBlobRequestSigner.class); }
@Override protected void configure() { bind(new TypeLiteral<Map<Class<?>, Class<?>>>() { }).toInstance(sync2Async); bind(new TypeLiteral<Function<Invocation, Object>>() { }).to(InvokeSyncToAsyncHttpMethod.class); BinderUtils.bindSyncToAsyncHttpApi(binder(), HttpClient.class, HttpAsyncClient.class); }
@Override protected void configure() { bind(new TypeLiteral<RestContext<VCloudDirectorAdminApi, VCloudDirectorAdminAsyncApi>>() { }).to(new TypeLiteral<RestContextImpl<VCloudDirectorAdminApi, VCloudDirectorAdminAsyncApi>>() { }); // Bind apis that are used directly in Functions, Predicates and other circumstances bindSyncToAsyncHttpApi(binder(), OrgApi.class, OrgAsyncApi.class); bindSyncToAsyncHttpApi(binder(), SessionApi.class, SessionAsyncApi.class); bindSyncToAsyncHttpApi(binder(), TaskApi.class, TaskAsyncApi.class); bindSyncToAsyncHttpApi(binder(), VAppApi.class, VAppAsyncApi.class); bindSyncToAsyncHttpApi(binder(), VmApi.class, VmAsyncApi.class); bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(InvalidateSessionAndRetryOn401AndLogoutOnClose.class); super.configure(); bindSyncToAsyncHttpApi(binder(), VCloudDirectorAdminApi.class, VCloudDirectorAdminAsyncApi.class); }
@Override protected void configure() { bind(new TypeLiteral<ApiContext<CloudStackDomainApi>>() { }).to(new TypeLiteral<ApiContextImpl<CloudStackDomainApi>>() { }); bind(new TypeLiteral<ApiContext<CloudStackGlobalApi>>() { }).to(new TypeLiteral<ApiContextImpl<CloudStackGlobalApi>>() { }); bind(CredentialType.class).toProvider(CredentialTypeFromPropertyOrDefault.class); // session client is used directly for filters and retry handlers, so let's bind it explicitly bindHttpApi(binder(), SessionApi.class); bindHttpApi(binder(), CloudStackDomainApi.class); bindHttpApi(binder(), CloudStackGlobalApi.class); bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(InvalidateSessionAndRetryOn401AndLogoutOnClose.class); super.configure(); }
@Override protected void configure() { bind(new TypeLiteral<RestContext<CloudStackDomainClient, CloudStackDomainAsyncClient>>() { }).to(new TypeLiteral<RestContextImpl<CloudStackDomainClient, CloudStackDomainAsyncClient>>() { }); bind(new TypeLiteral<RestContext<CloudStackGlobalClient, CloudStackGlobalAsyncClient>>() { }).to(new TypeLiteral<RestContextImpl<CloudStackGlobalClient, CloudStackGlobalAsyncClient>>() { }); bind(CredentialType.class).toProvider(CredentialTypeFromPropertyOrDefault.class); // session client is used directly for filters and retry handlers, so let's bind it explicitly bindSyncToAsyncHttpApi(binder(), SessionClient.class, SessionAsyncClient.class); bindSyncToAsyncHttpApi(binder(), CloudStackDomainClient.class, CloudStackDomainAsyncClient.class); bindSyncToAsyncHttpApi(binder(), CloudStackGlobalClient.class, CloudStackGlobalAsyncClient.class); bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(InvalidateSessionAndRetryOn401AndLogoutOnClose.class); super.configure(); }
@Override protected void configure() { bindHttpApi(binder(), AuthorizationApi.class); bind(CredentialType.class).toProvider(CredentialTypeFromPropertyOrDefault.class); bind(new TypeLiteral<Supplier<PrivateKey>>() {}).annotatedWith(Authorization.class).to(PrivateKeySupplier.class); bind(new TypeLiteral<Supplier<CertificateFingerprint>>() {}).annotatedWith(Authorization.class).to(CertificateFingerprintSupplier.class); }
@Override protected void configure() { // OpenStackAuthClient is used directly for filters and retry handlers, so let's bind it explicitly bindSyncToAsyncHttpApi(binder(), OpenStackAuthClient.class, OpenStackAuthAsyncClient.class); install(new FactoryModuleBuilder().build(URIFromAuthenticationResponseForService.Factory.class)); bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(RetryOnRenew.class); }
@Override protected void configure() { super.configure(); bindHttpApi(binder(), UseApiToResolveProjectName.GetProject.class); bind(OAuthScopes.class).toInstance(ReadOrWriteScopes.create( // "https://www.googleapis.com/auth/compute.readonly", // "https://www.googleapis.com/auth/compute" // )); }
@Override protected void configure() { // datacenter api is needed for obtaining zone ids bindSyncToAsyncHttpApi(binder(), DatacenterApi.class, DatacenterAsyncApi.class); bind(ImplicitLocationSupplier.class).to(OnlyLocationOrFirstZone.class).in(Scopes.SINGLETON); bind(ZoneIdToURISupplier.class).to(ZoneIdToURIFromDatacentersApi.class).in(Scopes.SINGLETON); bind(ZoneIdsSupplier.class).to(ZoneIdsFromZoneIdToURIKeySet.class).in(Scopes.SINGLETON); } }
@Override protected void configure() { // AuthenticationApi is used directly for filters and retry handlers, so let's bind it explicitly bindHttpApi(binder(), CloudIdentityAuthenticationApi.class); }
@Override public void configure() { bind(new TypeLiteral<Function<Invocation, Object>>() { }).to(InvokeHttpMethod.class); bindHttpApi(binder(), HttpClient.class); } });
super.configure(); bind(ComputeService.class).to(GoogleComputeEngineService.class); }).to(GoogleComputeEngineServiceAdapter.class); bind(TemplateBuilderImpl.class).to(GoogleComputeEngineArbitraryCpuRamTemplateBuilderImpl.class); }).to(DiskURIToImage.class); bindHttpApi(binder(), Resources.class);
@Override protected void configure() { bind(AsyncBlobStore.class).to(LocalAsyncBlobStore.class).asEagerSingleton(); // forward all requests from TransientBlobStore to TransientAsyncBlobStore. needs above binding as cannot proxy a class bindSyncToAsyncApi(binder(), LocalBlobStore.class, AsyncBlobStore.class); bind(BlobStore.class).to(LocalBlobStore.class); install(new BlobStoreObjectModule()); bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT); bind(LocalStorageStrategy.class).to(FilesystemStorageStrategyImpl.class); bind(BlobUtils.class).to(FileSystemBlobUtilsImpl.class); bind(FilesystemBlobKeyValidator.class).to(FilesystemBlobKeyValidatorImpl.class); bind(FilesystemContainerNameValidator.class).to(FilesystemContainerNameValidatorImpl.class); bind(BlobRequestSigner.class).to(LocalBlobRequestSigner.class); }