Class SessionUtil


  • public class SessionUtil
    extends Object
    Low level session util
    • Constructor Detail

      • SessionUtil

        public SessionUtil()
    • Method Detail

      • deleteIdTokenCache

        public static void deleteIdTokenCache​(String host,
                                              String user)
        Delete the id token cache
      • deleteMfaTokenCache

        public static void deleteMfaTokenCache​(String host,
                                               String user)
      • getCommonParams

        public static Map<String,​Object> getCommonParams​(com.fasterxml.jackson.databind.JsonNode paramsNode)
        Helper function to parse a JsonNode from a GS response containing CommonParameters, emitting an EnumMap of parameters
        Parameters:
        paramsNode - parameters in JSON form
        Returns:
        map object including key and value pairs
      • resetOCSPUrlIfNecessary

        public static void resetOCSPUrlIfNecessary​(String serverUrl)
                                            throws IOException
        Reset OCSP cache server if the snowflake server URL is for private link. If the URL is not for private link, do nothing.
        Parameters:
        serverUrl - The Snowflake URL includes protocol such as "https://"
        Throws:
        IOException
      • generateJWTToken

        public static String generateJWTToken​(PrivateKey privateKey,
                                              String privateKeyFile,
                                              String privateKeyFilePwd,
                                              String accountName,
                                              String userName)
                                       throws SFException
        Helper function to generate a JWT token
        Parameters:
        privateKey - private key
        privateKeyFile - path to private key file
        privateKeyFilePwd - password for private key file
        accountName - account name
        userName - user name
        Returns:
        JWT token
        Throws:
        SFException - if Snowflake error occurs