Class SFSession


  • public class SFSession
    extends SFBaseSession
    Snowflake session implementation
    • Method Detail

      • isSafeToClose

        public boolean isSafeToClose()
        Function that checks if the active session can be closed when the connection is closed. If there are active asynchronous queries running, the session should stay open even if the connection closes so that the queries can finish running.
        Specified by:
        isSafeToClose in class SFBaseSession
        Returns:
        true if it is safe to close this session, false if not
      • addQueryToActiveQueryList

        public void addQueryToActiveQueryList​(String queryID)
        Add async query to list of active async queries based on its query ID
        Parameters:
        queryID - query ID
      • addSFSessionProperty

        public void addSFSessionProperty​(String propertyName,
                                         Object propertyValue)
                                  throws SFException
        Add a property If a property is known for connection, add it to connection properties If not, add it as a dynamic session parameters

        Make sure a property is not added more than once and the number of properties does not exceed limit.

        Parameters:
        propertyName - property name
        propertyValue - property value
        Throws:
        SFException - exception raised from Snowflake components
      • containProperty

        public boolean containProperty​(String key)
      • getSessionToken

        public String getSessionToken()
        get session token
        Returns:
        session token
      • startHeartbeatForThisSession

        protected void startHeartbeatForThisSession()
        Start heartbeat for this session
      • stopHeartbeatForThisSession

        protected void stopHeartbeatForThisSession()
        Stop heartbeat for this session
      • getInjectSocketTimeout

        public int getInjectSocketTimeout()
      • setInjectSocketTimeout

        public void setInjectSocketTimeout​(int injectSocketTimeout)
      • getHttpClientSocketTimeout

        public int getHttpClientSocketTimeout()
      • getHttpClientConnectionTimeout

        public int getHttpClientConnectionTimeout()
      • isClosed

        public boolean isClosed()
      • getInjectClientPause

        public int getInjectClientPause()
      • setInjectClientPause

        public void setInjectClientPause​(int injectClientPause)
      • getAndIncrementSequenceId

        protected int getAndIncrementSequenceId()
      • getTelemetryClient

        public Telemetry getTelemetryClient()
        Description copied from class: SFBaseSession
        Returns the telemetry client, if supported, by this session. If not, should return a NoOpTelemetryClient.
        Specified by:
        getTelemetryClient in class SFBaseSession
      • closeTelemetryClient

        public void closeTelemetryClient()
      • getIdToken

        public String getIdToken()
      • getMfaToken

        public String getMfaToken()
      • isAsyncSession

        public boolean isAsyncSession()
        Specified by:
        isAsyncSession in class SFBaseSession
        Returns:
        whether this session uses async queries
      • setSfClientConfig

        public void setSfClientConfig​(SFClientConfig sfClientConfig)