Class JWTManager

  • All Implemented Interfaces:
    AutoCloseable

    public final class JWTManager
    extends Object
    This class manages creating and automatically renewing the JWT token
    Author:
    obabarinsa
    • 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

      • JWTManager

        public JWTManager​(String accountName,
                          String username,
                          KeyPair keyPair,
                          TelemetryService telemetryService)
        Creates a JWTManager entity for a given account, user and KeyPair with the default time to renew (RENEWAL_INTERVAL_IN_MINUTES minutes)
        Parameters:
        accountName - - the snowflake account name of this user
        username - - the snowflake username of the current user
        keyPair - - the public/private key pair we're using to connect
        telemetryService - reference to the telemetry service
    • Method Detail

      • getToken

        public String getToken()
      • close

        public void close()
        Currently, it only shuts down the instance of ExecutorService.
        Specified by:
        close in interface AutoCloseable