Class OptionsMetadata (0.20.0)

publicclass OptionsMetadata

Metadata extractor for CLI.

Inheritance

java.lang.Object > OptionsMetadata

Static Fields

DEFAULT_SERVER_VERSION

publicstaticfinalStringDEFAULT_SERVER_VERSION
Field Value
Type Description
String

Static Methods

isJava8()

publicstaticbooleanisJava8()

Returns true if the current JVM is Java 8.

Returns
Type Description
boolean

toServerVersionNum(String version)

publicstaticStringtoServerVersionNum(Stringversion)
Parameter
Name Description
version String
Returns
Type Description
String

Constructors

OptionsMetadata(String defaultConnectionUrl, int proxyPort, OptionsMetadata.TextFormat textFormat, boolean forceBinary, boolean authenticate, boolean requiresMatcher, boolean replaceJdbcMetadataQueries, JSONObject commandMetadata)

publicOptionsMetadata(StringdefaultConnectionUrl,intproxyPort,OptionsMetadata.TextFormattextFormat,booleanforceBinary,booleanauthenticate,booleanrequiresMatcher,booleanreplaceJdbcMetadataQueries,JSONObjectcommandMetadata)
Parameters
Name Description
defaultConnectionUrl String
proxyPort int
textFormat OptionsMetadata.TextFormat
forceBinary boolean
authenticate boolean
requiresMatcher boolean
replaceJdbcMetadataQueries boolean
commandMetadata org.json.simple.JSONObject

OptionsMetadata(String[] args)

publicOptionsMetadata(String[]args)
Parameter
Name Description
args String[]

Methods

buildConnectionURL(String database)

publicStringbuildConnectionURL(Stringdatabase)

Takes user inputs and builds a JDBC connection string from them.

Parameter
Name Description
database String
Returns
Type Description
String

The parsed JDBC connection string.

buildCredentialsFile()

publicStringbuildCredentialsFile()

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.

disableLocalhostCheck()

publicbooleandisableLocalhostCheck()
Returns
Type Description
boolean

getCommandMetadataJSON()

publicJSONObjectgetCommandMetadataJSON()
Returns
Type Description
org.json.simple.JSONObject

getConnectionURL() (deprecated)

publicStringgetConnectionURL()
Returns
Type Description
String

the default connection URL that is used by the server.

getDatabaseName(String database)

publicDatabaseNamegetDatabaseName(Stringdatabase)

Returns the fully qualified database name based on the given database id or name.

Parameter
Name Description
database String
Returns
Type Description
com.google.spanner.v1.DatabaseName

getDdlTransactionMode()

publicOptionsMetadata.DdlTransactionModegetDdlTransactionMode()
Returns
Type Description
OptionsMetadata.DdlTransactionMode

getDefaultConnectionUrl()

publicStringgetDefaultConnectionUrl()

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.

getDefaultDatabaseId()

publicDatabaseIdgetDefaultDatabaseId()

Returns the id of the default database or null if no default has been selected.

Returns
Type Description
com.google.cloud.spanner.DatabaseId

getDefaultInstanceId()

publicInstanceIdgetDefaultInstanceId()

Returns the id of the default instance or null if no default has been selected.

Returns
Type Description
com.google.cloud.spanner.InstanceId

getMaxBacklog()

publicintgetMaxBacklog()
Returns
Type Description
int

getPropertyMap()

publicMap<String,String>getPropertyMap()
Returns
Type Description
Map<String,String>

getProxyPort()

publicintgetProxyPort()
Returns
Type Description
int

getServerVersion()

publicStringgetServerVersion()
Returns
Type Description
String

getServerVersionNum()

publicStringgetServerVersionNum()
Returns
Type Description
String

getSocketFile(int localPort)

publicStringgetSocketFile(intlocalPort)
Parameter
Name Description
localPort int
Returns
Type Description
String

getSslMode()

publicOptionsMetadata.SslModegetSslMode()
Returns
Type Description
OptionsMetadata.SslMode

getTextFormat()

publicOptionsMetadata.TextFormatgetTextFormat()
Returns
Type Description
OptionsMetadata.TextFormat

hasDefaultConnectionUrl()

publicbooleanhasDefaultConnectionUrl()
Returns
Type Description
boolean

true if the server uses a default connection URL and ignores the database in a connection request

hasDefaultInstanceId()

publicbooleanhasDefaultInstanceId()

Returns true if these options contain a default instance id.

Returns
Type Description
boolean

isBinaryFormat()

publicbooleanisBinaryFormat()
Returns
Type Description
boolean

isDebugMode()

publicbooleanisDebugMode()
Returns
Type Description
boolean

isDomainSocketEnabled()

publicbooleanisDomainSocketEnabled()
Returns
Type Description
boolean

isReplaceJdbcMetadataQueries()

publicbooleanisReplaceJdbcMetadataQueries()
Returns
Type Description
boolean

isWindows()

publicbooleanisWindows()

Returns true if the OS is Windows.

Returns
Type Description
boolean

replacePgCatalogTables()

publicbooleanreplacePgCatalogTables()
Returns
Type Description
boolean

requiresMatcher()

publicbooleanrequiresMatcher()
Returns
Type Description
boolean

shouldAuthenticate()

publicbooleanshouldAuthenticate()
Returns
Type Description
boolean

shouldAutoDetectClient()

publicbooleanshouldAutoDetectClient()
Returns
Type Description
boolean

useDefaultLocalStatements()

publicbooleanuseDefaultLocalStatements()
Returns
Type Description
boolean

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.