Class OptionsMetadata (0.18.2)

public class OptionsMetadata

Metadata extractor for CLI.

Inheritance

java.lang.Object > OptionsMetadata

Static Fields

DEFAULT_SERVER_VERSION

public static final String DEFAULT_SERVER_VERSION
Field Value
TypeDescription
String

Static Methods

isJava8()

public static boolean isJava8()

Returns true if the current JVM is Java 8.

Returns
TypeDescription
boolean

toServerVersionNum(String version)

public static String toServerVersionNum(String version)
Parameter
NameDescription
versionString
Returns
TypeDescription
String

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
NameDescription
defaultConnectionUrlString
proxyPortint
textFormatOptionsMetadata.TextFormat
forceBinaryboolean
authenticateboolean
requiresMatcherboolean
replaceJdbcMetadataQueriesboolean
commandMetadataorg.json.simple.JSONObject

OptionsMetadata(String[] args)

public OptionsMetadata(String[] args)
Parameter
NameDescription
argsString[]

Methods

buildConnectionURL(String database)

public String buildConnectionURL(String database)

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

Parameter
NameDescription
databaseString
Returns
TypeDescription
String

The parsed JDBC connection string.

buildCredentialsFile()

public String buildCredentialsFile()

Get credential file path from either command line or application default. If neither throw error.

Returns
TypeDescription
String

The absolute path of the credentials file.

disableLocalhostCheck()

public boolean disableLocalhostCheck()
Returns
TypeDescription
boolean

getCommandMetadataJSON()

public JSONObject getCommandMetadataJSON()
Returns
TypeDescription
org.json.simple.JSONObject

getConnectionURL() (deprecated)

public String getConnectionURL()
Returns
TypeDescription
String

the default connection URL that is used by the server.

getDatabaseName(String database)

public DatabaseName getDatabaseName(String database)

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

Parameter
NameDescription
databaseString
Returns
TypeDescription
com.google.spanner.v1.DatabaseName

getDdlTransactionMode()

public OptionsMetadata.DdlTransactionMode getDdlTransactionMode()
Returns
TypeDescription
OptionsMetadata.DdlTransactionMode

getDefaultConnectionUrl()

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

the default connection URL that is used by the server.

getDefaultDatabaseId()

public DatabaseId getDefaultDatabaseId()

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

Returns
TypeDescription
com.google.cloud.spanner.DatabaseId

getDefaultInstanceId()

public InstanceId getDefaultInstanceId()

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

Returns
TypeDescription
com.google.cloud.spanner.InstanceId

getMaxBacklog()

public int getMaxBacklog()
Returns
TypeDescription
int

getPropertyMap()

public Map<String,String> getPropertyMap()
Returns
TypeDescription
Map<String,String>

getProxyPort()

public int getProxyPort()
Returns
TypeDescription
int

getServerVersion()

public String getServerVersion()
Returns
TypeDescription
String

getServerVersionNum()

public String getServerVersionNum()
Returns
TypeDescription
String

getSocketFile(int localPort)

public String getSocketFile(int localPort)
Parameter
NameDescription
localPortint
Returns
TypeDescription
String

getSslMode()

public OptionsMetadata.SslMode getSslMode()
Returns
TypeDescription
OptionsMetadata.SslMode

getTextFormat()

public OptionsMetadata.TextFormat getTextFormat()
Returns
TypeDescription
OptionsMetadata.TextFormat

hasDefaultConnectionUrl()

public boolean hasDefaultConnectionUrl()
Returns
TypeDescription
boolean

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

hasDefaultInstanceId()

public boolean hasDefaultInstanceId()

Returns true if these options contain a default instance id.

Returns
TypeDescription
boolean

isBinaryFormat()

public boolean isBinaryFormat()
Returns
TypeDescription
boolean

isDebugMode()

public boolean isDebugMode()
Returns
TypeDescription
boolean

isDomainSocketEnabled()

public boolean isDomainSocketEnabled()
Returns
TypeDescription
boolean

isReplaceJdbcMetadataQueries()

public boolean isReplaceJdbcMetadataQueries()
Returns
TypeDescription
boolean

isWindows()

public boolean isWindows()

Returns true if the OS is Windows.

Returns
TypeDescription
boolean

replacePgCatalogTables()

public boolean replacePgCatalogTables()
Returns
TypeDescription
boolean

requiresMatcher()

public boolean requiresMatcher()
Returns
TypeDescription
boolean

shouldAuthenticate()

public boolean shouldAuthenticate()
Returns
TypeDescription
boolean

shouldAutoDetectClient()

public boolean shouldAutoDetectClient()
Returns
TypeDescription
boolean

useDefaultLocalStatements()

public boolean useDefaultLocalStatements()
Returns
TypeDescription
boolean