public RefreshAheadConnectionInfoCache()

in core/src/main/java/com/google/cloud/sql/core/RefreshAheadConnectionInfoCache.java [44:69]


  public RefreshAheadConnectionInfoCache(
      ConnectionConfig config,
      ConnectionInfoRepository connectionInfoRepository,
      CredentialFactory tokenSourceFactory,
      ListeningScheduledExecutorService executor,
      ListenableFuture<KeyPair> keyPair,
      long minRefreshDelayMs) {

    CloudSqlInstanceName instanceName =
        new CloudSqlInstanceName(config.getCloudSqlInstance(), config.getDomainName());

    this.config = config;
    this.instanceName = instanceName;

    AccessTokenSupplier accessTokenSupplier =
        DefaultAccessTokenSupplier.newInstance(config.getAuthType(), tokenSourceFactory);

    this.refreshStrategy =
        new RefreshAheadStrategy(
            config.getCloudSqlInstance(),
            executor,
            () ->
                connectionInfoRepository.getConnectionInfo(
                    instanceName, accessTokenSupplier, config.getAuthType(), executor, keyPair),
            new AsyncRateLimiter(minRefreshDelayMs));
  }