Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add missing javadoc comments to public methods. #2080

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/src/main/java/com/google/cloud/sql/ConnectorConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,52 +153,62 @@ public static class Builder {
private String universeDomain;
private RefreshStrategy refreshStrategy = RefreshStrategy.BACKGROUND;

/** Chained setter for TargetPrinciple field. */
public Builder withTargetPrincipal(String targetPrincipal) {
this.targetPrincipal = targetPrincipal;
return this;
}

/** Chained setter for GoogleCredentialsSupplier field. */
public Builder withGoogleCredentialsSupplier(
Supplier<GoogleCredentials> googleCredentialsSupplier) {
this.googleCredentialsSupplier = googleCredentialsSupplier;
return this;
}

/** Chained setter for GoogleCredentials field. */
public Builder withGoogleCredentials(GoogleCredentials googleCredentials) {
this.googleCredentials = googleCredentials;
return this;
}

/** Chained setter for GoogleCredentialsPath field. */
public Builder withGoogleCredentialsPath(String googleCredentialsPath) {
this.googleCredentialsPath = googleCredentialsPath;
return this;
}

/** Chained setter for Delegates field. */
public Builder withDelegates(List<String> delegates) {
this.delegates = delegates;
return this;
}

/** Chained setter for AdminRootUrl field. */
public Builder withAdminRootUrl(String adminRootUrl) {
this.adminRootUrl = adminRootUrl;
return this;
}

/** Chained setter for AdminServicePath field. */
public Builder withAdminServicePath(String adminServicePath) {
this.adminServicePath = adminServicePath;
return this;
}

/** Chained setter for AdminQuotaProject field. */
public Builder withAdminQuotaProject(String adminQuotaProject) {
this.adminQuotaProject = adminQuotaProject;
return this;
}

/** Chained setter for UniverseDomain field. */
public Builder withUniverseDomain(String universeDomain) {
this.universeDomain = universeDomain;
return this;
}

/** Chained setter for RefreshStrategy field. */
public Builder withRefreshStrategy(RefreshStrategy refreshStrategy) {
this.refreshStrategy = refreshStrategy;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public interface CredentialFactory {
/** Name of system property that can specify an alternative credential factory. */
String CREDENTIAL_FACTORY_PROPERTY = "cloudSql.socketFactory.credentialFactory";

/** Creates the HttpRequestInitializer. */
HttpRequestInitializer create();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

/** Enum for supported refresh strategies. */
public enum RefreshStrategy {
/** Use the Background refresh strategy. */
BACKGROUND,
/** Use the Lazy refresh strategy. */
LAZY
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,26 +239,31 @@ public static class Builder {
private ConnectorConfig connectorConfig = new ConnectorConfig.Builder().build();
private AuthType authType = DEFAULT_AUTH_TYPE;

/** Chained setter for CloudSqlInstance field. */
public Builder withCloudSqlInstance(String cloudSqlInstance) {
this.cloudSqlInstance = cloudSqlInstance;
return this;
}

/** Chained setter for NamedConnector field. */
public Builder withNamedConnector(String namedConnector) {
this.namedConnector = namedConnector;
return this;
}

/** Chained setter for ConnectorConfig field. */
public Builder withConnectorConfig(ConnectorConfig connectorConfig) {
this.connectorConfig = connectorConfig;
return this;
}

/** Chained setter for UnixSocketPath field. */
public Builder withUnixSocketPath(String unixSocketPath) {
this.unixSocketPath = unixSocketPath;
return this;
}

/** Chained setter for AuthType field. */
public Builder withAuthType(AuthType authType) {
this.authType = authType;
return this;
Expand All @@ -276,6 +281,7 @@ public Builder withIpTypes(List<IpType> ipTypes) {
return this;
}

/** Chained setter for UnixSocketPathSuffix field. */
public Builder withUnixSocketPathSuffix(String unixSocketPathSuffix) {
this.unixSocketPathSuffix = unixSocketPathSuffix;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@

/** Provide the refresh strategy to the DefaultConnectionInfoCache. */
public interface RefreshStrategy {
/** Return the current valid ConnectionInfo, blocking if necessary for up to the timeout. */
ConnectionInfo getConnectionInfo(long timeoutMs);

/** Force a refresh of the ConnectionInfo, possibly in the background. */
void forceRefresh();

/** Refresh the ConnectionInfo if it has expired or is near expiration. */
void refreshIfExpired();

/**
* Stop background threads and refresh operations in progress and refuse to start subsequent
* refresh operations.
*/
void close();
}
Loading