- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<Integer,V>
-
- com.aoindustries.aoserv.client.CachedObjectIntegerKey<Server>
-
- com.aoindustries.aoserv.client.mysql.Server
-
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable,SingleTableObject<Integer,Server>
public final class Server extends CachedObjectIntegerKey<Server>
AMySQLServercorresponds to a unique MySQL install space on one server. The server name must be unique per server.MySQLDatabases andMySQLServerUsers are unique perMySQLServer.- Author:
- AO Industries, Inc.
- See Also:
Database,UserServer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServer.MasterStatusstatic classServer.NameRepresents a name that may be used for a MySQL installation.static classServer.ReservedWordDeprecated.2019-07-14: Is this still used?
-
Field Summary
Fields Modifier and Type Field Description static StringCOLUMN_AO_SERVER_namestatic StringCOLUMN_NAME_namestatic PosixPathDATA_BASE_DIRThe directory that contains the MySQL data files.static PortDEFAULT_PORTThe default MySQL port.static intMAX_SERVER_NAME_LENGTHDeprecated.Please useServer.Name.MAX_LENGTHinstead.static List<String>PREFERRED_VERSION_PREFIXESGets the versions of MySQL in order of preference.static StringVERSION_4_0_PREFIXThe supported versions of MySQL.static StringVERSION_4_1_PREFIXThe supported versions of MySQL.static StringVERSION_5_0_PREFIXThe supported versions of MySQL.static StringVERSION_5_1_PREFIXThe supported versions of MySQL.static StringVERSION_5_6_PREFIXThe supported versions of MySQL.static StringVERSION_5_7_PREFIXThe supported versions of MySQL.static StringVERSION_8_0_PREFIXThe supported versions of MySQL.-
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
-
-
Constructor Summary
Constructors Constructor Description Server()
-
Method Summary
-
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
-
-
-
-
Field Detail
-
DEFAULT_PORT
public static final Port DEFAULT_PORT
The default MySQL port.
-
VERSION_8_0_PREFIX
public static final String VERSION_8_0_PREFIX
The supported versions of MySQL.- See Also:
- Constant Field Values
-
VERSION_5_7_PREFIX
public static final String VERSION_5_7_PREFIX
The supported versions of MySQL.- See Also:
- Constant Field Values
-
VERSION_5_6_PREFIX
public static final String VERSION_5_6_PREFIX
The supported versions of MySQL.- See Also:
- Constant Field Values
-
VERSION_5_1_PREFIX
public static final String VERSION_5_1_PREFIX
The supported versions of MySQL.- See Also:
- Constant Field Values
-
VERSION_5_0_PREFIX
public static final String VERSION_5_0_PREFIX
The supported versions of MySQL.- See Also:
- Constant Field Values
-
VERSION_4_1_PREFIX
public static final String VERSION_4_1_PREFIX
The supported versions of MySQL.- See Also:
- Constant Field Values
-
VERSION_4_0_PREFIX
public static final String VERSION_4_0_PREFIX
The supported versions of MySQL.- See Also:
- Constant Field Values
-
DATA_BASE_DIR
public static final PosixPath DATA_BASE_DIR
The directory that contains the MySQL data files.
-
PREFERRED_VERSION_PREFIXES
public static final List<String> PREFERRED_VERSION_PREFIXES
Gets the versions of MySQL in order of preference. Index0is the most preferred.
-
COLUMN_AO_SERVER_name
public static final String COLUMN_AO_SERVER_name
- See Also:
- Constant Field Values
-
COLUMN_NAME_name
public static final String COLUMN_NAME_name
- See Also:
- Constant Field Values
-
MAX_SERVER_NAME_LENGTH
@Deprecated public static final int MAX_SERVER_NAME_LENGTH
Deprecated.Please useServer.Name.MAX_LENGTHinstead.The maximum length of the name.- See Also:
- Constant Field Values
-
-
Method Detail
-
getColumnImpl
protected Object getColumnImpl(int i)
- Specified by:
getColumnImplin classAOServObject<Integer,Server>
-
getBind_id
public int getBind_id()
-
getBind
public Bind getBind() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getName
public Server.Name getName()
-
getAoServer_server_pkey
public int getAoServer_server_pkey()
-
getLinuxServer
public Server getLinuxServer() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getVersion
public SoftwareVersion getVersion() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getMaxConnections
public int getMaxConnections()
-
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,Server>- 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,Server>- Throws:
IOException
-
write
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<Integer,Server>- Throws:
IOException
-
addMySQLDatabase
public int addMySQLDatabase(Database.Name name, Package pack) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getDataDirectory
public PosixPath getDataDirectory()
-
getMinorVersion
public String getMinorVersion() throws SQLException, IOException
Gets the minor version number in X.X[-max] format. This corresponds to the installation directory under /usr/mysql/X.X[-max] or /opt/mysql-X.X[-max]- Throws:
SQLExceptionIOException
-
getMySQLDatabase
public Database getMySQLDatabase(Database.Name name) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getFailoverMySQLReplications
public List<MysqlReplication> getFailoverMySQLReplications() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getMySQLDatabases
public List<Database> getMySQLDatabases() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getMySQLDBUsers
public List<DatabaseUser> getMySQLDBUsers() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getMySQLServerUser
public UserServer getMySQLServerUser(User.Name username) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getMySQLServerUsers
public List<UserServer> getMySQLServerUsers() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getMySQLUsers
public List<User> getMySQLUsers() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<Integer,Server>
-
isMySQLDatabaseNameAvailable
public boolean isMySQLDatabaseNameAvailable(Database.Name name) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
restartMySQL
public void restartMySQL() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
startMySQL
public void startMySQL() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
stopMySQL
public void stopMySQL() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
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<Server>- Throws:
SQLExceptionIOException
-
getMasterStatus
public Server.MasterStatus getMasterStatus() throws IOException, SQLException
Gets the master status ornullif no master status provided by MySQL. If any error occurs, throws either IOException or SQLException.- Throws:
IOExceptionSQLException
-
-