Package net.snowflake.ingest.connection
Class OAuthManager
- java.lang.Object
-
- net.snowflake.ingest.connection.OAuthManager
-
- All Implemented Interfaces:
AutoCloseable
public final class OAuthManager extends Object
This class manages creating and automatically refresh the OAuth token
-
-
Field Summary
Fields Modifier and Type Field Description protected String
account
protected static org.slf4j.Logger
LOGGER
protected String
publicKeyFingerPrint
protected AtomicBoolean
refreshFailed
protected TelemetryService
telemetryService
protected ScheduledExecutorService
tokenRefresher
protected String
user
-
Constructor Summary
Constructors Constructor Description OAuthManager(String accountName, String username, OAuthClient oAuthClient, double updateThresholdRatio)
Creates a OAuthManager entity for a given account, user and OAuthClient with a specified time to refresh the token.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Currently, it only shuts down the instance of ExecutorService.
-
-
-
Field Detail
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
account
protected final String account
-
publicKeyFingerPrint
protected String publicKeyFingerPrint
-
user
protected final String user
-
refreshFailed
protected final AtomicBoolean refreshFailed
-
tokenRefresher
protected ScheduledExecutorService tokenRefresher
-
telemetryService
protected final TelemetryService telemetryService
-
-
Constructor Detail
-
OAuthManager
public OAuthManager(String accountName, String username, OAuthClient oAuthClient, double updateThresholdRatio)
Creates a OAuthManager entity for a given account, user and OAuthClient with a specified time to refresh the token. Use for testing only.- Parameters:
accountName
- - the snowflake account name of this userusername
- - the snowflake username of the current useroAuthClient
- - the OAuth client to perform token refreshupdateThresholdRatio
- - the ratio between the expiration time of a token and the time needed to refresh it.
-
-
Method Detail
-
close
public void close()
Currently, it only shuts down the instance of ExecutorService.- Specified by:
close
in interfaceAutoCloseable
-
-