synchronized void renewSession ( String prevSessionToken ) throws SFException , SnowflakeSQLException { if ( sessionToken != null && ! sessionToken . equals ( prevSessionToken ) ) { logger . debug ( "not renew session because session token has not been updated." ) ; return ; } SessionUtil . LoginInput loginInput = new SessionUtil . LoginInput ( ) ; loginInput . setServerUrl ( ( String ) connectionPropertiesMap . get ( SFSessionProperty . SERVER_URL ) ) . setSessionToken ( sessionToken ) . setMasterToken ( masterToken ) . setIdToken ( idToken ) . setLoginTimeout ( loginTimeout ) . setDatabaseName ( this . getDatabase ( ) ) . setSchemaName ( this . getSchema ( ) ) . setRole ( this . getRole ( ) ) . setWarehouse ( this . getWarehouse ( ) ) ; SessionUtil . LoginOutput loginOutput = SessionUtil . renewSession ( loginInput ) ; if ( loginOutput . isUpdatedByTokenRequestIssue ( ) ) { setCurrentObjects ( loginInput , loginOutput ) ; } sessionToken = loginOutput . getSessionToken ( ) ; masterToken = loginOutput . getMasterToken ( ) ; }
A helper function to call global service and renew session .