Class BackupConfig
- java.lang.Object
-
- jetbrains.buildServer.serverSide.maintenance.OperationConfig
-
- jetbrains.buildServer.serverSide.maintenance.BackupConfig
-
- All Implemented Interfaces:
java.io.Serializable
public final class BackupConfig extends OperationConfig implements java.io.Serializable
Backup configuration.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_BACKUP_CHARSET_NAME
Default backup character set.static java.lang.String
DEFAULT_BACKUP_FILE_NAME
Default short file name fo backup.static java.text.SimpleDateFormat
TIMESTAMP_SUFFIX_FORMATTER
static java.lang.String
UPGRADE_BACKUP_FILE_NAME
Default short file name fo backup.-
Fields inherited from class jetbrains.buildServer.serverSide.maintenance.OperationConfig
myIncludeBuildLogs, myIncludeConfiguration, myIncludeDatabase, myIncludePersonalChanges, myIncludeSupplementaryData
-
-
Constructor Summary
Constructors Constructor Description BackupConfig()
Empty constructor.BackupConfig(BackupConfig config)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getCharsetName()
Returns the character set in which text from database will be saved.java.lang.String
getFileName()
Returns the path and name of file to backup to; without automatically added timestamp and without suffix/extension.java.lang.String
getResultFileName()
Returns the result file name, with timestamp suffix if applicable and file name extension.java.util.Date
getTimestamp()
Timestamp when the file name has been specified; this timestamp is used for generate timestamp suffix.boolean
isAddTimestampSuffix()
Determines whether the backup process will add the timestamp suffix to the file name.boolean
isCharsetSpecified()
Determines whether the character set is specified.boolean
isIncludeRunningBuilds()
Determines whether the running builds should be included.void
setAddTimestampSuffix(boolean addTimestampSuffix)
Sets whether a timestamp suffix should be added.void
setCharsetName(java.lang.String charsetName)
Specifies the character set.void
setFileName(java.lang.String fileName)
Sets the file name.void
setFileName(java.lang.String fileName, boolean addTimestampSuffix)
Specifies a file where the system should backup their data.void
setIncludeRunningBuilds(boolean includeRunningBuilds)
Specifies whether the running builds should be included.-
Methods inherited from class jetbrains.buildServer.serverSide.maintenance.OperationConfig
getOnlyTableNames, getSkipTableNames, hashCode, isIncludeBuildLogs, isIncludeConfiguration, isIncludeDatabase, isIncludePersonalChanges, isIncludeSupplementaryData, isSkipCreateIndices, setIncludeBuildLogs, setIncludeConfiguration, setIncludeDatabase, setIncludePersonalChanges, setIncludeSupplementaryData, setOnlyTableNames, setOnlyTableNames, setSkipCreateIndices, setSkipTableNames, setSkipTableNames, toString
-
-
-
-
Field Detail
-
DEFAULT_BACKUP_FILE_NAME
public static final java.lang.String DEFAULT_BACKUP_FILE_NAME
Default short file name fo backup.- See Also:
- Constant Field Values
-
UPGRADE_BACKUP_FILE_NAME
public static final java.lang.String UPGRADE_BACKUP_FILE_NAME
Default short file name fo backup.- See Also:
- Constant Field Values
-
TIMESTAMP_SUFFIX_FORMATTER
public static final java.text.SimpleDateFormat TIMESTAMP_SUFFIX_FORMATTER
-
DEFAULT_BACKUP_CHARSET_NAME
public static final java.lang.String DEFAULT_BACKUP_CHARSET_NAME
Default backup character set.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BackupConfig
public BackupConfig()
Empty constructor. Initializes all fields by default.
-
BackupConfig
public BackupConfig(@NotNull BackupConfig config)
Copy constructor.
-
-
Method Detail
-
setFileName
public void setFileName(@Nullable java.lang.String fileName, boolean addTimestampSuffix)
Specifies a file where the system should backup their data.- Parameters:
fileName
- name of file where to backup, without file name extension. This name can be relative to the [TeamCity_data_dir/backup] or absolute. Null or an empty string mean default file name.addTimestampSuffix
- whether to add timestamp suffix.- See Also:
getResultFileName()
-
setFileName
public void setFileName(@NotNull java.lang.String fileName)
Sets the file name. SeegetFileName()
andsetFileName(String, boolean)
.- Parameters:
fileName
- file name
-
getFileName
@NotNull public java.lang.String getFileName()
Returns the path and name of file to backup to; without automatically added timestamp and without suffix/extension.The name can be absolute or relative. In case of relative it will be relative the TeamCity_Data_Dir/backup directory.
- Specified by:
getFileName
in classOperationConfig
- Returns:
- the name of file; or a default name if not set.
-
isAddTimestampSuffix
public boolean isAddTimestampSuffix()
Determines whether the backup process will add the timestamp suffix to the file name.- Returns:
- see above.
-
setAddTimestampSuffix
public void setAddTimestampSuffix(boolean addTimestampSuffix)
Sets whether a timestamp suffix should be added.- Parameters:
addTimestampSuffix
- whether a timestamp suffix should be added.
-
getResultFileName
@NotNull public java.lang.String getResultFileName()
Returns the result file name, with timestamp suffix if applicable and file name extension. This file name can be relative or absolute depends on one given to constructor.- Specified by:
getResultFileName
in classOperationConfig
- Returns:
- the result file name. All slashes are unix-like.
-
isIncludeRunningBuilds
public boolean isIncludeRunningBuilds()
Determines whether the running builds should be included.- Returns:
- include running builds into backup.
-
setIncludeRunningBuilds
public void setIncludeRunningBuilds(boolean includeRunningBuilds)
Specifies whether the running builds should be included. Running builds should not be included when backup is performed when the server is working because that can cause an inconsistent backup file.- Parameters:
includeRunningBuilds
- see above.
-
getCharsetName
@Nullable public java.lang.String getCharsetName()
Returns the character set in which text from database will be saved.This character set affects on database text only; all files (including text ones) are backed up as is.
- Returns:
- character set, or null if not specified.
-
setCharsetName
public void setCharsetName(@Nullable java.lang.String charsetName)
Specifies the character set. SeegetCharsetName()
.- Parameters:
charsetName
- name of character set (@seeCharset
), or null to use the default character set.
-
isCharsetSpecified
public boolean isCharsetSpecified()
Determines whether the character set is specified.- Returns:
- character set is specified.
- See Also:
getCharsetName()
,setCharsetName(java.lang.String)
-
getTimestamp
@NotNull public java.util.Date getTimestamp()
Timestamp when the file name has been specified; this timestamp is used for generate timestamp suffix.- Returns:
- timestamp (with seconds accuracy).
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-