Class FileReplication
- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<Integer,V>
-
- com.aoindustries.aoserv.client.CachedObjectIntegerKey<FileReplication>
-
- com.aoindustries.aoserv.client.backup.FileReplication
-
- All Implemented Interfaces:
BitRateProvider,Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable,SingleTableObject<Integer,FileReplication>
public final class FileReplication extends CachedObjectIntegerKey<FileReplication> implements BitRateProvider
Causes a server to replicate itself to another machine on a regular basis.- Author:
- AO Industries, Inc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileReplication.Activity
-
Field Summary
-
Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
pkey
-
Fields inherited from class com.aoindustries.aoserv.client.CachedObject
table
-
Fields inherited from class com.aoindustries.aoserv.client.AOServObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
-
Fields inherited from interface com.aoapps.hodgepodge.io.BitRateProvider
MINIMUM_BIT_RATE
-
-
Constructor Summary
Constructors Constructor Description FileReplication()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddFailoverFileLog(long startTime, long endTime, int scanned, int updated, long bytes, boolean isSuccessful)intaddFileBackupSetting(String path, boolean backupEnabled, boolean required)FileReplication.ActivitygetActivity()BackupPartitiongetBackupPartition()May be filtered.LonggetBitRate()intgetBlockSize()protected ObjectgetColumnImpl(int i)HostAddressgetConnectAddress()Gets a connect address that should override the normal address resolution mechanisms.InetAddressgetConnectFrom()Gets the address connections should be made from that overrides the normal address resolution mechanism.booleangetEnabled()Gets the enabled flag for this replication.List<FileReplicationLog>getFailoverFileLogs(int maxRows)Gets the most recent (by start time) log entries for failover file replications, up to the maximum number of rows.List<FileReplicationSchedule>getFailoverFileSchedules()List<MysqlReplication>getFailoverMySQLReplications()FileReplicationSettinggetFileBackupSetting(String path)List<FileReplicationSetting>getFileBackupSettings()HostgetHost()LinuxIdgetQuotaGID()When set, the group ID will always be set to this value, regardless what the client sends.BackupRetentiongetRetention()Table.TableIDgetTableID()booleangetUseCompression()voidinit(ResultSet result)Initializes this object from the raw database contents.voidread(StreamableInput in, AoservProtocol.Version protocolVersion)Server.DaemonAccessrequestReplicationDaemonAccess()voidsetBitRate(Long bitRate)voidsetFailoverFileSchedules(List<Short> hours, List<Short> minutes)voidsetFileBackupSettings(List<String> paths, List<Boolean> backupEnableds, List<Boolean> requireds)StringtoStringImpl()AOServObject.toString()implementation that is allowed to throw exceptions.voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion)-
Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCode
-
Methods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTable
-
Methods inherited from class com.aoindustries.aoserv.client.AOServObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxID, getLinuxUserName, getMacAddress, getMySQLDatabaseName, getMySQLServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
-
-
-
Method Detail
-
addFailoverFileLog
public int addFailoverFileLog(long startTime, long endTime, int scanned, int updated, long bytes, boolean isSuccessful) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
getBitRate
public Long getBitRate()
- Specified by:
getBitRatein interfaceBitRateProvider
-
setBitRate
public void setBitRate(Long bitRate) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getBlockSize
public int getBlockSize()
- Specified by:
getBlockSizein interfaceBitRateProvider
-
getColumnImpl
protected Object getColumnImpl(int i)
- Specified by:
getColumnImplin classAOServObject<Integer,FileReplication>
-
getFailoverFileSchedules
public List<FileReplicationSchedule> getFailoverFileSchedules() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getHost
public Host getHost() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getBackupPartition
public BackupPartition getBackupPartition() throws SQLException, IOException
May be filtered.- Throws:
SQLExceptionIOException
-
getFailoverFileLogs
public List<FileReplicationLog> getFailoverFileLogs(int maxRows) throws IOException, SQLException
Gets the most recent (by start time) log entries for failover file replications, up to the maximum number of rows. May return less than this number of rows. The results are sorted by start_time descending (most recent at index zero).- Throws:
IOExceptionSQLException
-
getFailoverMySQLReplications
public List<MysqlReplication> getFailoverMySQLReplications() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getUseCompression
public boolean getUseCompression()
-
getRetention
public BackupRetention getRetention() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getConnectAddress
public HostAddress getConnectAddress()
Gets a connect address that should override the normal address resolution mechanisms. This allows a replication to be specifically sent through a gigabit connection or alternate route.
-
getConnectFrom
public InetAddress getConnectFrom()
Gets the address connections should be made from that overrides the normal address resolution mechanism. This allows a replication to be specifically sent through a gigabit connection or alternate route.
-
getEnabled
public boolean getEnabled()
Gets the enabled flag for this replication.
-
getQuotaGID
public LinuxId getQuotaGID()
When set, the group ID will always be set to this value, regardless what the client sends. This gid is only unique per backup_partition, thus on a single host the same gid may be used for different accounts. Also, the gid will not exist in /etc/groups and has nothing to do with the shell accounts on the server. This is to track quotas per backup partition by group ID. This may only be set (and must be set) when stored on a backup_partition with quota_enabled.
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<Integer,FileReplication>
-
init
public void init(ResultSet result) throws SQLException
Description copied from class:AOServObjectInitializes this object from the raw database contents.- Specified by:
initin classAOServObject<Integer,FileReplication>- Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
read
public void read(StreamableInput in, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
readin interfaceAOServReadable- Specified by:
readin interfaceAOServStreamable- Specified by:
readin classAOServObject<Integer,FileReplication>- Throws:
IOException
-
toStringImpl
public String toStringImpl() throws SQLException, IOException
Description copied from class:AOServObjectAOServObject.toString()implementation that is allowed to throw exceptions.Implementation Note:
This default implementation callsAOServObject.toString()on the key (fromAOServObject.getKey()). When the key isnull, uses the default implementation fromObject.toString().- Overrides:
toStringImplin classCachedObjectIntegerKey<FileReplication>- Throws:
SQLExceptionIOException
-
write
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<Integer,FileReplication>- Throws:
IOException
-
addFileBackupSetting
public int addFileBackupSetting(String path, boolean backupEnabled, boolean required) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getFileBackupSetting
public FileReplicationSetting getFileBackupSetting(String path) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getFileBackupSettings
public List<FileReplicationSetting> getFileBackupSettings() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
setFailoverFileSchedules
public void setFailoverFileSchedules(List<Short> hours, List<Short> minutes) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
setFileBackupSettings
public void setFileBackupSettings(List<String> paths, List<Boolean> backupEnableds, List<Boolean> requireds) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
requestReplicationDaemonAccess
public Server.DaemonAccess requestReplicationDaemonAccess() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getActivity
public FileReplication.Activity getActivity() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
-