Skip to content

Commit

Permalink
docs: Add missing javadoc comments to public methods. (#2080)
Browse files Browse the repository at this point in the history
The checkstyle rules are becoming more strict. All public methods must now have javadoc.
  • Loading branch information
hessjcg authored Oct 23, 2024
1 parent 5db195b commit 00e0b1a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
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
2 changes: 2 additions & 0 deletions core/src/main/java/com/google/cloud/sql/RefreshStrategy.java
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();
}

0 comments on commit 00e0b1a

Please sign in to comment.