Class OAuthManager

  • All Implemented Interfaces:
    AutoCloseable

    public final class OAuthManager
    extends Object
    This class manages creating and automatically refresh the OAuth token
    • Field Detail

      • LOGGER

        protected static final org.slf4j.Logger LOGGER
      • account

        protected final String account
      • publicKeyFingerPrint

        protected String publicKeyFingerPrint
      • user

        protected final String user
    • 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 user
        username - - the snowflake username of the current user
        oAuthClient - - the OAuth client to perform token refresh
        updateThresholdRatio - - 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 interface AutoCloseable