Class Backup.Builder
- java.lang.Object
-
- com.google.cloud.spanner.BackupInfo.Builder
-
- com.google.cloud.spanner.Backup.Builder
-
- Enclosing class:
- Backup
public static class Backup.Builder extends BackupInfo.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BackupInfo.Builder
addAllReferencingBackups(List<String> referencingBackups)
Output Only.Backup
build()
Builds the backup from this builder.BackupInfo.Builder
setDatabase(DatabaseId database)
Required for creating a new backup.BackupInfo.Builder
setEncryptionConfig(BackupEncryptionConfig encryptionConfig)
Optional for creating a new backup.BackupInfo.Builder
setExpireTime(com.google.cloud.Timestamp expireTime)
Required for creating a new backup.protected BackupInfo.Builder
setMaxExpireTime(com.google.cloud.Timestamp maxExpireTime)
Output Only.BackupInfo.Builder
setVersionTime(com.google.cloud.Timestamp versionTime)
Optional for creating a new backup.
-
-
-
Field Detail
-
id
protected final BackupId id
-
-
Method Detail
-
build
public Backup build()
Description copied from class:BackupInfo.Builder
Builds the backup from this builder.- Specified by:
build
in classBackupInfo.Builder
-
setExpireTime
public BackupInfo.Builder setExpireTime(com.google.cloud.Timestamp expireTime)
Description copied from class:BackupInfo.Builder
Required for creating a new backup.Sets the expiration time of the backup. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 366 days from the time the request is received. Once the expireTime has passed, Cloud Spanner will delete the backup and free the resources used by the backup.
- Specified by:
setExpireTime
in classBackupInfo.Builder
-
setVersionTime
public BackupInfo.Builder setVersionTime(com.google.cloud.Timestamp versionTime)
Description copied from class:BackupInfo.Builder
Optional for creating a new backup.Specifies the timestamp to have an externally consistent copy of the database. If no version time is specified, it will be automatically set to the backup create time.
The version time can be as far in the past as specified by the database earliest version time (see
Database.getEarliestVersionTime()
).- Specified by:
setVersionTime
in classBackupInfo.Builder
-
setDatabase
public BackupInfo.Builder setDatabase(DatabaseId database)
Description copied from class:BackupInfo.Builder
Required for creating a new backup.Sets the source database to use for creating the backup.
- Specified by:
setDatabase
in classBackupInfo.Builder
-
setEncryptionConfig
public BackupInfo.Builder setEncryptionConfig(BackupEncryptionConfig encryptionConfig)
Description copied from class:BackupInfo.Builder
Optional for creating a new backup.The encryption configuration to be used for the backup. The possible configurations are
CustomerManagedEncryption
,GoogleDefaultEncryption
andUseDatabaseEncryption
.If no encryption config is given the backup will be created with the same encryption as set by the database (
UseDatabaseEncryption
).- Specified by:
setEncryptionConfig
in classBackupInfo.Builder
-
setMaxExpireTime
protected BackupInfo.Builder setMaxExpireTime(com.google.cloud.Timestamp maxExpireTime)
Description copied from class:BackupInfo.Builder
Output Only.Returns the max allowed expiration time of the backup, with microseconds granularity.
- Overrides:
setMaxExpireTime
in classBackupInfo.Builder
-
addAllReferencingBackups
protected BackupInfo.Builder addAllReferencingBackups(List<String> referencingBackups)
Description copied from class:BackupInfo.Builder
Output Only.Returns the names of the destination backups being created by copying this source backup.
- Overrides:
addAllReferencingBackups
in classBackupInfo.Builder
-
-