Class BackupConfig

  • All Implemented Interfaces:
    java.io.Serializable

    public final class BackupConfig
    extends OperationConfig
    implements java.io.Serializable
    Backup configuration.
    See Also:
    Serialized Form
    • 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()
      • 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 class OperationConfig
        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 class OperationConfig
        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. See getCharsetName().
        Parameters:
        charsetName - name of character set (@see Charset), or null to use the default character set.
      • 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