All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.client.TokensSupplier Maven / Gradle / Ivy

Go to download

This SDK is announced to be deprecated latest by 31 December 2022, please follow more details on SDK deprecation plan https://docs.commercetools.com/api/releases/2021-08-31-announced-long-term-support-plan-for-commercetools-sdks. We recommend you to use our new SDK here https://docs.commercetools.com/sdk/jvm-sdk#java-sdk-v2.

There is a newer version: 2.16.0
Show newest version
package io.sphere.sdk.client;

import io.sphere.sdk.http.HttpClient;

import java.util.concurrent.CompletionStage;
import java.util.function.Supplier;

/**
 * Component that asynchronous retrieves tokens.
 */
public interface TokensSupplier extends AutoCloseable, Supplier> {
    @Override
    CompletionStage get();

    @Override
    void close();

    static TokensSupplier of(final SphereAuthConfig config, final HttpClient httpClient, final boolean closeHttpClient) {
        return TokensSupplierImpl.of(config, httpClient, closeHttpClient);
    }

    static TokensSupplier ofCustomerPasswordFlowTokens(final SphereAuthConfig authConfig, final String email, final String password, final HttpClient httpClient, final boolean closeHttpClient) {
        return TokensSupplierImpl.ofCustomerPasswordFlowTokensImpl(authConfig, email, password, httpClient, closeHttpClient);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy