jetbrains.buildServer.serverSide.maintenance
Class BackupConfig

java.lang.Object
  extended by jetbrains.buildServer.serverSide.maintenance.BackupConfig
All Implemented Interfaces:
java.io.Serializable

public class BackupConfig
extends java.lang.Object
implements java.io.Serializable

Backup configuration.

See Also:
Serialized Form

Field Summary
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
           
 
Constructor Summary
BackupConfig()
          Empty constructor.
BackupConfig(BackupConfig config)
          Copy constructor.
 
Method Summary
 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.
 int hashCode()
           
 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 isIncludeBuildLogs()
          Determines whether build logs are included into backup.
 boolean isIncludeConfiguration()
          Determines whether the server configuration is included into backup.
 boolean isIncludeDatabase()
          Determines whether the database is included into backup.
 boolean isIncludePersonalChanges()
          Determines whether personal changes are included into backup.
 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 setIncludeBuildLogs(boolean includeBuildLogs)
          Specifies whether to include build logs into backup or not.
 void setIncludeConfiguration(boolean includeConfiguration)
          Specifies whether to include server configuration into backup or not.
 void setIncludeDatabase(boolean includeDatabase)
          Specifies whether to include database into backup or not.
 void setIncludePersonalChanges(boolean includePersonalChanges)
          Specifies whether to include personal changes into backup or not.
 void setIncludeRunningBuilds(boolean includeRunningBuilds)
          Specifies whether the running builds should be included.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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

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. See getFileName() and setFileName(String, boolean).

Parameters:
fileName -

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.

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.

Returns:
the result file name. All slashes are unix-like.

isIncludeDatabase

public boolean isIncludeDatabase()
Determines whether the database is included into backup.

Returns:
the database is included.

setIncludeDatabase

public void setIncludeDatabase(boolean includeDatabase)
Specifies whether to include database into backup or not. It is included by default.


isIncludeConfiguration

public boolean isIncludeConfiguration()
Determines whether the server configuration is included into backup.

Returns:
the server configuration is included.

setIncludeConfiguration

public void setIncludeConfiguration(boolean includeConfiguration)
Specifies whether to include server configuration into backup or not. It is included by default.


isIncludePersonalChanges

public boolean isIncludePersonalChanges()
Determines whether personal changes are included into backup.

Returns:
personal changes are included.

setIncludePersonalChanges

public void setIncludePersonalChanges(boolean includePersonalChanges)
Specifies whether to include personal changes into backup or not. They are not included by default.


isIncludeBuildLogs

public boolean isIncludeBuildLogs()
Determines whether build logs are included into backup.

Returns:
build logs are included.

setIncludeBuildLogs

public void setIncludeBuildLogs(boolean includeBuildLogs)
Specifies whether to include build logs into backup or not. They are not included by default.


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. See getCharsetName().

Parameters:
charsetName - name of character set (@see Charset), 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 class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object