Class OptionsMetadata (0.5.1)

publicclass OptionsMetadata

Metadata extractor for CLI.

Inheritance

java.lang.Object > OptionsMetadata

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
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

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

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.

getMaxBacklog()

publicintgetMaxBacklog()
Returns
Type Description
int

getPropertyMap()

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

getProxyPort()

publicintgetProxyPort()
Returns
Type Description
int

getServerVersion()

publicStringgetServerVersion()
Returns
Type Description

getSocketFile(int localPort)

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

getTextFormat()

publicOptionsMetadata.TextFormatgetTextFormat()
Returns
Type Description

hasDefaultConnectionUrl()

publicbooleanhasDefaultConnectionUrl()
Returns
Type Description
boolean

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

isBinaryFormat()

publicbooleanisBinaryFormat()
Returns
Type Description

isDebugMode()

publicbooleanisDebugMode()
Returns
Type Description

isDomainSocketEnabled()

publicbooleanisDomainSocketEnabled()
Returns
Type Description

isReplaceJdbcMetadataQueries()

publicbooleanisReplaceJdbcMetadataQueries()
Returns
Type Description

isWindows()

publicbooleanisWindows()

Returns true if the OS is Windows.

Returns
Type Description

requiresMatcher()

publicbooleanrequiresMatcher()
Returns
Type Description

shouldAuthenticate()

publicbooleanshouldAuthenticate()
Returns
Type Description

shouldAutoDetectClient()

publicbooleanshouldAutoDetectClient()
Returns
Type Description

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.