Class CreateBackup


  • public final class CreateBackup
    extends Command
    Evaluates the 'backup' command and creates a backup of a database.
    Author:
    BaseX Team 2005-24, BSD License, Christian Gruen
    • Constructor Detail

      • CreateBackup

        public CreateBackup​(String pattern)
        Default constructor.
        Parameters:
        pattern - database pattern (null for general data)
      • CreateBackup

        public CreateBackup​(String pattern,
                            String comment)
        Default constructor.
        Parameters:
        pattern - database pattern (null for general data)
        comment - (can be null)
    • Method Detail

      • run

        protected boolean run()
        Description copied from class: Command
        Executes the command and serializes the result (internal call).
        Specified by:
        run in class Command
        Returns:
        success of operation
      • backup

        public static void backup​(String db,
                                  String comment,
                                  boolean compress,
                                  StaticOptions sopts,
                                  CreateBackup cmd)
                           throws IOException
        Backups the specified database.
        Parameters:
        db - name of the database (empty string for general data)
        comment - comment (can be null)
        compress - compress flag
        sopts - static options
        cmd - calling command instance
        Throws:
        IOException - I/O Exception
      • addLocks

        public void addLocks()
        Description copied from class: Job
        Collects lock strings (databases, special identifiers) when registering a query.
        Overrides:
        addLocks in class Job
      • shortInfo

        public String shortInfo()
        Description copied from class: Job
        Returns short progress information. Can be overwritten to give more specific feedback.
        Overrides:
        shortInfo in class Job
        Returns:
        header information
      • supportsProg

        public boolean supportsProg()
        Description copied from class: Command
        Returns true if this command returns a progress value. This method is only required by the GUI.
        Overrides:
        supportsProg in class Command
        Returns:
        result of check
      • progressInfo

        public double progressInfo()
        Description copied from class: Job
        Returns a progress value (0 - 1). Can be overwritten to give more specific feedback.
        Overrides:
        progressInfo in class Job
        Returns:
        header information
      • build

        public void build​(CmdBuilder cb)
        Description copied from class: Command
        Builds a string representation from the command. This string must be correctly built, as commands are sent to the server as strings.
        Overrides:
        build in class Command
        Parameters:
        cb - command builder