Package com.aoindustries.aoserv.backup
Interface BackupEnvironment
- All Known Implementing Classes:
FileEnvironment,LinuxEnvironment,MacOsXEnvironment,PosixFileEnvironment,WindowsEnvironment
public interface BackupEnvironment
A
BackupEnvironment tells the BackupDaemon how to run.
All paths are represented as a String to allow anything to be backed-up, not just local files.
- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup(FileReplication ffr) Called in a finally block after any backup-pass completes, no data will be obtained from the environment after this is called.Gets the connection to the master server.Gets the default source IP address orInetAddress.UNSPECIFIEDto use the system default.longgetDeviceIdentifier(FileReplication ffr, String filename) Gets the device file major and minor.String[]getDirectoryList(FileReplication ffr, String filename) Gets the listing for a directory.intGets the number of items per batch.A fast pseudo-random number generator for non-cryptographic purposes.Gets theIteratorof filenames ornullif completed.intgetGid(FileReplication ffr, String filename) Gets the group ID.getInputStream(FileReplication ffr, String filename) Gets a stream reading the file.longgetLength(FileReplication ffr, String filename) Gets the length of the file.Gets the logger for this environment.longgetModifyTime(FileReplication ffr, String filename) Gets the modified time.getNameOfFile(FileReplication ffr, String filename) Gets the name of a file (the part after the last slash).Gets the list of MySQL server versions (in the same order as the list returned bygetReplicatedMysqlServers.Gets the list of MySQL server instance names that are being replicated.Gets the set of paths that must be found in the backup set.getServerPath(FileReplication ffr, String filename) Converts an environment-specific filename into a server path.longgetStatMode(FileReplication ffr, String filename) Gets the stat mode (or a generated and equivalent one) for a file.Gets the host this process is running on.intgetUid(FileReplication ffr, String filename) Gets the user ID.voidinit(FileReplication ffr) Called before any backup-pass data is retrieved from the environment.voidCalled right after a backup pass ends.voidpreBackup(FileReplication ffr) Called right before a backup pass begins.readLink(FileReplication ffr, String filename) Reads a symbolic link.
-
Method Details
-
getStatMode
Gets the stat mode (or a generated and equivalent one) for a file.- Throws:
IOException
-
getDirectoryList
Gets the listing for a directory.- Throws:
IOException
-
getUid
Gets the user ID.- Throws:
IOException
-
getGid
Gets the group ID.- Throws:
IOException
-
getModifyTime
Gets the modified time.- Throws:
IOException
-
getLength
Gets the length of the file.- Throws:
IOException
-
readLink
Reads a symbolic link.- Throws:
IOException
-
getDeviceIdentifier
Gets the device file major and minor.- Throws:
IOException
-
getInputStream
Gets a stream reading the file.- Throws:
IOException
-
getNameOfFile
Gets the name of a file (the part after the last slash). -
getConnector
Gets the connection to the master server.- Throws:
IOExceptionSQLException
-
getThisHost
Gets the host this process is running on.- Throws:
IOExceptionSQLException
-
getFailoverBatchSize
Gets the number of items per batch. A higher value will consume more RAM but better hide latency.- Throws:
IOExceptionSQLException
-
preBackup
Called right before a backup pass begins. Implementations should call super.preBackup first.The process is:
- preBackup
- init
- cleanup (always)
- postBackup (only when backup pass successful)
- Throws:
IOExceptionSQLException
-
init
Called before any backup-pass data is retrieved from the environment.cleanup()will also be called in a finally block. Implementations should call super.init first.- Throws:
IOExceptionSQLException- See Also:
-
cleanup
Called in a finally block after any backup-pass completes, no data will be obtained from the environment after this is called. Implementations should call super.cleanup in a finally block.- Throws:
IOExceptionSQLException- See Also:
-
postBackup
Called right after a backup pass ends. Implementations should call super.postBackup last.- Throws:
IOExceptionSQLException- See Also:
-
getRequiredFilenames
Gets the set of paths that must be found in the backup set. These paths must not include any trailing separators.- Throws:
IOExceptionSQLException
-
getFilenameIterator
Gets theIteratorof filenames ornullif completed.- Throws:
IOExceptionSQLException
-
getDefaultSourceIpAddress
Gets the default source IP address orInetAddress.UNSPECIFIEDto use the system default.- Throws:
IOExceptionSQLException
-
getReplicatedMysqlServers
Gets the list of MySQL server instance names that are being replicated. This is only used for failover mode (retention == 1), and should only be used for a replication that includes MySQL replication (Server only)- Throws:
IOExceptionSQLException- See Also:
-
getReplicatedMysqlMinorVersions
Gets the list of MySQL server versions (in the same order as the list returned bygetReplicatedMysqlServers. This is only used for failover mode (retention == 1), and should only be used for a replication that includes MySQL replication (Server only)- Throws:
IOExceptionSQLException- See Also:
-
getFastRandom
Random getFastRandom()A fast pseudo-random number generator for non-cryptographic purposes.Gets a Random source for the backup daemon. This does not need to be cryptographically strong because it is only used to randomize some sleep times to distribute load on the server processes.
-
getLogger
Logger getLogger()Gets the logger for this environment. -
getServerPath
Converts an environment-specific filename into a server path. The server path must begin with /, may not contain /../, and must use / as the path separator.
-
