in core/src/main/java/com/google/cloud/sql/core/LazyRefreshConnectionInfoCache.java [42:64]
public LazyRefreshConnectionInfoCache(
ConnectionConfig config,
ConnectionInfoRepository connectionInfoRepository,
CredentialFactory tokenSourceFactory,
KeyPair keyPair) {
CloudSqlInstanceName instanceName =
new CloudSqlInstanceName(config.getCloudSqlInstance(), config.getDomainName());
this.config = config;
this.instanceName = instanceName;
AccessTokenSupplier accessTokenSupplier =
DefaultAccessTokenSupplier.newInstance(config.getAuthType(), tokenSourceFactory);
this.refreshStrategy =
new LazyRefreshStrategy(
config.getCloudSqlInstance(),
() ->
connectionInfoRepository.getConnectionInfoSync(
instanceName, accessTokenSupplier, config.getAuthType(), keyPair),
DEFAULT_REFRESH_BUFFER);
}