Package org.basex.core.cmd
Class CreateBackup
- java.lang.Object
-
- org.basex.core.jobs.Job
-
- org.basex.core.Command
-
- org.basex.core.cmd.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 Summary
Constructors Constructor Description CreateBackup(String pattern)
Default constructor.CreateBackup(String pattern, String comment)
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLocks()
Collects lock strings (databases, special identifiers) when registering a query.static void
backup(String db, String comment, boolean compress, StaticOptions sopts, CreateBackup cmd)
Backups the specified database.void
build(CmdBuilder cb)
Builds a string representation from the command.double
progressInfo()
Returns a progress value (0 - 1).protected boolean
run()
Executes the command and serializes the result (internal call).String
shortInfo()
Returns short progress information.boolean
supportsProg()
Returns true if this command returns a progress value.-
Methods inherited from class org.basex.core.Command
addLocks, baseURI, baseURI, close, error, execute, execute, getOption, getOption, info, info, init, newData, run, run, setInput, setInput, stoppable, toString, toString, updated, updating
-
-
-
-
Constructor Detail
-
CreateBackup
public CreateBackup(String pattern)
Default constructor.- Parameters:
pattern
- database pattern (null
for general data)
-
-
Method Detail
-
run
protected boolean run()
Description copied from class:Command
Executes the command and serializes the result (internal call).
-
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 benull
)compress
- compress flagsopts
- static optionscmd
- 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.
-
shortInfo
public String shortInfo()
Description copied from class:Job
Returns short progress information. Can be overwritten to give more specific feedback.
-
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 classCommand
- 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 classJob
- 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.
-
-