Package com.google.cloud.spanner
Class DatabaseInfo
- java.lang.Object
-
- com.google.cloud.spanner.DatabaseInfo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DatabaseInfo.Builder
static class
DatabaseInfo.DatabaseField
Represent an updatable field in a Cloud Spanner database.static class
DatabaseInfo.State
State of the database.
-
Constructor Summary
Constructors Constructor Description DatabaseInfo(DatabaseId id, DatabaseInfo.State state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
com.google.cloud.Timestamp
getCreateTime()
Returns the creation time of the database.String
getDefaultLeader()
The read-write region which contains the database's leader replicas.Dialect
getDialect()
The dialect that is used by the database.com.google.cloud.Timestamp
getEarliestVersionTime()
Returns the earliest version time of the database.CustomerManagedEncryption
getEncryptionConfig()
Returns theCustomerManagedEncryption
of the database if the database is encrypted, ornull
if this database is not encrypted.DatabaseId
getId()
Returns the database id.Database
getProto()
Returns the raw proto instance that was used to construct thisDatabase
.boolean
getReconciling()
RestoreInfo
getRestoreInfo()
Returns theRestoreInfo
of the database if any is available, ornull
if noRestoreInfo
is available for this database.DatabaseInfo.State
getState()
Returns the state of the database.String
getVersionRetentionPeriod()
Returns the version retention period of the database.int
hashCode()
boolean
isDropProtectionEnabled()
String
toString()
-
-
-
Constructor Detail
-
DatabaseInfo
public DatabaseInfo(DatabaseId id, DatabaseInfo.State state)
-
-
Method Detail
-
getId
public DatabaseId getId()
Returns the database id.
-
getState
public DatabaseInfo.State getState()
Returns the state of the database.
-
getCreateTime
public com.google.cloud.Timestamp getCreateTime()
Returns the creation time of the database.
-
getVersionRetentionPeriod
public String getVersionRetentionPeriod()
Returns the version retention period of the database. This is the period for which Cloud Spanner retains all versions of data for the database. For instance, if set to 3 days, Cloud Spanner will retain data versions that are up to 3 days old.
-
getEarliestVersionTime
public com.google.cloud.Timestamp getEarliestVersionTime()
Returns the earliest version time of the database. This is the oldest timestamp that can be used to read old versions of the data.
-
getRestoreInfo
@Nullable public RestoreInfo getRestoreInfo()
Returns theRestoreInfo
of the database if any is available, ornull
if noRestoreInfo
is available for this database.
-
getEncryptionConfig
@Nullable public CustomerManagedEncryption getEncryptionConfig()
Returns theCustomerManagedEncryption
of the database if the database is encrypted, ornull
if this database is not encrypted.
-
getDefaultLeader
@Nullable public String getDefaultLeader()
The read-write region which contains the database's leader replicas. If this value was not explicitly set during a create database or update database ddl operations, it will beNULL
.
-
getDialect
@Nullable public Dialect getDialect()
The dialect that is used by the database. It can be one of the values as specified inDialect.values()
.
-
isDropProtectionEnabled
public boolean isDropProtectionEnabled()
-
getReconciling
public boolean getReconciling()
-
getProto
@Nullable public Database getProto()
Returns the raw proto instance that was used to construct thisDatabase
.
-
-