public class OptionsMetadata
Metadata extractor for CLI.
Constructors
OptionsMetadata(String defaultConnectionUrl, int proxyPort, OptionsMetadata.TextFormat textFormat, boolean forceBinary, boolean authenticate, boolean requiresMatcher, boolean replaceJdbcMetadataQueries, JSONObject commandMetadata)
public OptionsMetadata(String defaultConnectionUrl, int proxyPort, OptionsMetadata.TextFormat textFormat, boolean forceBinary, boolean authenticate, boolean requiresMatcher, boolean replaceJdbcMetadataQueries, JSONObject commandMetadata)
Parameters
public OptionsMetadata(String[] args)
Parameter
Methods
public String buildConnectionURL(String database)
Takes user inputs and builds a JDBC connection string from them.
Parameter
Returns
Type | Description |
String | The parsed JDBC connection string.
|
public String buildCredentialsFile()
Get credential file path from either command line or application default. If neither throw
error.
Returns
Type | Description |
String | The absolute path of the credentials file.
|
public boolean disableLocalhostCheck()
Returns
public JSONObject getCommandMetadataJSON()
Returns
Type | Description |
org.json.simple.JSONObject | |
public String getConnectionURL()
Returns
Type | Description |
String | the default connection URL that is used by the server.
|
public DatabaseName getDatabaseName(String database)
Returns the fully qualified database name based on the given database id or name.
Parameter
Returns
Type | Description |
com.google.spanner.v1.DatabaseName | |
public OptionsMetadata.DdlTransactionMode getDdlTransactionMode()
Returns
public String getDefaultConnectionUrl()
Returns the default connection URL that is used by the server. If a default connection URL has
been set, the database parameter in a connection request will be ignored, and the database in
this connection URL will be used instead.
Returns
Type | Description |
String | the default connection URL that is used by the server.
|
public DatabaseId getDefaultDatabaseId()
Returns the id of the default database or null if no default has been selected.
Returns
Type | Description |
com.google.cloud.spanner.DatabaseId | |
public InstanceId getDefaultInstanceId()
Returns the id of the default instance or null if no default has been selected.
Returns
Type | Description |
com.google.cloud.spanner.InstanceId | |
public int getMaxBacklog()
Returns
public Map<String,String> getPropertyMap()
Returns
public int getProxyPort()
Returns
public String getServerVersion()
Returns
public String getSocketFile(int localPort)
Parameter
Name | Description |
localPort | int
|
Returns
getTextFormat()
public OptionsMetadata.TextFormat getTextFormat()
Returns
public boolean hasDefaultConnectionUrl()
Returns
Type | Description |
boolean | true if the server uses a default connection URL and ignores the database in a
connection request
|
public boolean hasDefaultInstanceId()
Returns true if these options contain a default instance id.
Returns
public boolean isBinaryFormat()
Returns
public boolean isDebugMode()
Returns
isDomainSocketEnabled()
public boolean isDomainSocketEnabled()
Returns
public boolean isReplaceJdbcMetadataQueries()
Returns
public boolean isWindows()
Returns true if the OS is Windows.
Returns
public boolean requiresMatcher()
Returns
public boolean shouldAuthenticate()
Returns
public boolean shouldAutoDetectClient()
Returns