public class SessionUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SessionUtil.LoginInput
A class for holding all information required for login
|
static class |
SessionUtil.LoginOutput
Login output information including session tokens, database versions
|
| Constructor and Description |
|---|
SessionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeSession(SessionUtil.LoginInput loginInput)
Close a session
|
static void |
deleteIdTokenCache()
Delete the id token cache
|
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
|
static SessionUtil.LoginOutput |
issueSession(SessionUtil.LoginInput loginInput)
Issue a session
|
static SessionUtil.LoginOutput |
openSession(SessionUtil.LoginInput loginInput)
Open a new session
|
static SessionUtil.LoginOutput |
renewSession(SessionUtil.LoginInput loginInput)
Renew a session.
|
static void |
updateSfDriverParamValues(Map<String,Object> parameters,
SFSession session) |
public static final String SF_QUERY_DATABASE
public static final String SF_QUERY_SCHEMA
public static final String SF_QUERY_WAREHOUSE
public static final String SF_QUERY_ROLE
public static final String SF_QUERY_REQUEST_ID
public static final String SF_PATH_AUTHENTICATOR_REQUEST
public static final String SF_QUERY_SESSION_DELETE
public static final String SF_HEADER_AUTHORIZATION
public static final String SF_HEADER_BASIC_AUTHTYPE
public static final String SF_HEADER_SNOWFLAKE_AUTHTYPE
public static final String SF_HEADER_TOKEN_TAG
public static long DEFAULT_CLIENT_MEMORY_LIMIT
public static final String CLIENT_STORE_TEMPORARY_CREDENTIAL
public static final String SERVICE_NAME
public static final String CLIENT_RESULT_COLUMN_CASE_INSENSITIVE
public static final String JDBC_RS_COLUMN_CASE_INSENSITIVE
public static final String CLIENT_RESULT_CHUNK_SIZE_JVM
public static final String CLIENT_RESULT_CHUNK_SIZE
public static final String CLIENT_MEMORY_LIMIT_JVM
public static final String CLIENT_MEMORY_LIMIT
public static final String CLIENT_PREFETCH_THREADS_JVM
public static final String CLIENT_PREFETCH_THREADS
public static final String CACHE_FILE_NAME
protected static final net.snowflake.client.core.FileCacheManager fileCacheManager
public static SessionUtil.LoginOutput openSession(SessionUtil.LoginInput loginInput) throws SFException, SnowflakeSQLException
loginInput - login informationSFException - if unexpected uri syntaxSnowflakeSQLException - if failed to establish connection with snowflakepublic static void deleteIdTokenCache()
public static SessionUtil.LoginOutput renewSession(SessionUtil.LoginInput loginInput) throws SFException, SnowflakeSQLException
Use cases: - Session and Master tokens are provided. No Id token: - succeed in getting a new Session token. - fail and raise SnowflakeReauthenticationRequest because Master token expires. Since no id token exists, the exception is thrown to the upstream. - Session and Id tokens are provided. No Master token: - fail and raise SnowflakeReauthenticationRequest and issue a new Session token - fail and raise SnowflakeReauthenticationRequest and fail to issue a new Session token as the
loginInput - login informationSFException - if unexpected uri informationSnowflakeSQLException - if failed to renew the sessionpublic static SessionUtil.LoginOutput issueSession(SessionUtil.LoginInput loginInput) throws SFException, SnowflakeSQLException
loginInput - login informationSFException - if unexpected uri informationSnowflakeSQLException - if failed to renew the sessionpublic static void closeSession(SessionUtil.LoginInput loginInput) throws SFException, SnowflakeSQLException
loginInput - login informationSnowflakeSQLException - if failed to close sessionSFException - if failed to close sessionpublic static Map<String,Object> getCommonParams(com.fasterxml.jackson.databind.JsonNode paramsNode)
paramsNode - parameters in JSON formCopyright © 2019. All rights reserved.