Class ConnectorRegistry (1.15.0)

public final class ConnectorRegistry

Configure the CloudSQL JDBC Connector.

Inheritance

java.lang.Object > ConnectorRegistry

Static Methods

addArtifactId(String artifactId)

public static void addArtifactId(String artifactId)

Adds an external application name to the user agent string for tracking. This is known to be used by the spring-cloud-gcp project.

Parameter
NameDescription
artifactIdString

close(String name)

public static void close(String name)

Close a named connector. This will stop all background credential refresh processes. All future attempts to connect via this named connection will fail.

Parameter
NameDescription
nameString

the name of the connector to close.

register(String name, ConnectorConfig config)

public static void register(String name, ConnectorConfig config)

Register a named connection so that it can later be referenced by name in a JDBC or R2DBC URL.

Parameters
NameDescription
nameString

the named connection name.

configConnectorConfig

the full configuration of the connection.

reset()

public static void reset()

Resets the entire CloudSQL JDBC Connector. This will stop all background threads. The next attempt to open a connection or register a configuration will start a new ConnectorRegistry.

shutdown()

public static void shutdown()

Shutdown the entire CloudSQL JDBC Connector. This will stop all background threads. All future attempts to connect to a CloudSQL database will fail.

Constructors

ConnectorRegistry()

public ConnectorRegistry()