- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<Integer,V>
-
- com.aoindustries.aoserv.client.CachedObjectIntegerKey<UserServer>
-
- com.aoindustries.aoserv.client.mysql.UserServer
-
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable,Disablable,PasswordProtected,Removable,SingleTableObject<Integer,UserServer>
public final class UserServer extends CachedObjectIntegerKey<UserServer> implements Removable, PasswordProtected, Disablable
AMySQLServerUsergrants aMySQLUseraccess to aServer. Once access is granted to theServer, access may then be granted to individualMySQLDatabases viaMySQLDBUsers.- Author:
- AO Industries, Inc.
- See Also:
User,Database,DatabaseUser,Server
-
-
Field Summary
Fields Modifier and Type Field Description static StringANY_HOSTConvenience constants for the most commonly used host values.static StringANY_LOCAL_HOSTConvenience constants for the most commonly used host values.static intDEFAULT_MAX_CONNECTIONSstatic intDEFAULT_MAX_QUESTIONSstatic intDEFAULT_MAX_UPDATESstatic intDEFAULT_MAX_USER_CONNECTIONSstatic intMAX_HOST_LENGTHstatic intUNLIMITED_CONNECTIONSstatic intUNLIMITED_QUESTIONSstatic intUNLIMITED_UPDATESstatic intUNLIMITED_USER_CONNECTIONS-
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.aoindustries.aoserv.client.password.PasswordProtected
ALL, NONE, SOME
-
-
Constructor Summary
Constructors Constructor Description UserServer()
-
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
-
UNLIMITED_QUESTIONS
public static final int UNLIMITED_QUESTIONS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_QUESTIONS
public static final int DEFAULT_MAX_QUESTIONS
- See Also:
- Constant Field Values
-
UNLIMITED_UPDATES
public static final int UNLIMITED_UPDATES
- See Also:
- Constant Field Values
-
DEFAULT_MAX_UPDATES
public static final int DEFAULT_MAX_UPDATES
- See Also:
- Constant Field Values
-
UNLIMITED_CONNECTIONS
public static final int UNLIMITED_CONNECTIONS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_CONNECTIONS
public static final int DEFAULT_MAX_CONNECTIONS
- See Also:
- Constant Field Values
-
UNLIMITED_USER_CONNECTIONS
public static final int UNLIMITED_USER_CONNECTIONS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_USER_CONNECTIONS
public static final int DEFAULT_MAX_USER_CONNECTIONS
- See Also:
- Constant Field Values
-
MAX_HOST_LENGTH
public static final int MAX_HOST_LENGTH
- See Also:
- Constant Field Values
-
ANY_HOST
public static final String ANY_HOST
Convenience constants for the most commonly used host values.- See Also:
- Constant Field Values
-
ANY_LOCAL_HOST
public static final String ANY_LOCAL_HOST
Convenience constants for the most commonly used host values.
-
-
Method Detail
-
arePasswordsSet
public int arePasswordsSet() throws IOException, SQLException- Specified by:
arePasswordsSetin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
canDisable
public boolean canDisable()
- Specified by:
canDisablein interfaceDisablable
-
canEnable
public boolean canEnable() throws SQLException, IOException- Specified by:
canEnablein interfaceDisablable- Throws:
SQLExceptionIOException
-
checkPassword
public List<PasswordChecker.Result> checkPassword(String password) throws IOException
- Specified by:
checkPasswordin interfacePasswordProtected- Throws:
IOException
-
disable
public void disable(DisableLog dl) throws IOException, SQLException
- Specified by:
disablein interfaceDisablable- Throws:
IOExceptionSQLException
-
enable
public void enable() throws IOException, SQLException- Specified by:
enablein interfaceDisablable- Throws:
IOExceptionSQLException
-
getColumnImpl
protected Object getColumnImpl(int i)
- Specified by:
getColumnImplin classAOServObject<Integer,UserServer>
-
isDisabled
public boolean isDisabled()
Description copied from interface:DisablableChecks if this object is disabled. This should execute very quickly (not incur any round-trip to any database) and thus does not throw any checked exceptions.- Specified by:
isDisabledin interfaceDisablable
-
getDisableLog_id
public Integer getDisableLog_id()
-
getDisableLog
public DisableLog getDisableLog() throws SQLException, IOException
- Specified by:
getDisableLogin interfaceDisablable- Throws:
SQLExceptionIOException
-
getHost
public String getHost()
-
getMySQLDBUsers
public List<DatabaseUser> getMySQLDBUsers() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getMySQLUser_username
public User.Name getMySQLUser_username()
-
getMySQLUser
public User getMySQLUser() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
isSpecial
public boolean isSpecial()
-
getPredisablePassword
public String getPredisablePassword()
-
getMaxQuestions
public int getMaxQuestions()
-
getMaxUpdates
public int getMaxUpdates()
-
getMaxConnections
public int getMaxConnections()
-
getMaxUserConnections
public int getMaxUserConnections()
-
getMySQLServer_id
public int getMySQLServer_id()
-
getMySQLServer
public Server getMySQLServer() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<Integer,UserServer>
-
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,UserServer>- 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,UserServer>- Throws:
IOException
-
getCannotRemoveReasons
public List<CannotRemoveReason<UserServer>> getCannotRemoveReasons() throws SQLException, IOException
Description copied from interface:RemovableLists the reasons an object may not be removed.- Specified by:
getCannotRemoveReasonsin interfaceRemovable- Returns:
- an empty
List<CannotRemoveReason>if this object may be removed, or a list of descriptions - Throws:
SQLExceptionIOException
-
remove
public void remove() throws IOException, SQLExceptionDescription copied from interface:RemovableRemoves this object, and all dependant objects, from the system.- Specified by:
removein interfaceRemovable- Throws:
IOExceptionSQLException
-
setPassword
public void setPassword(String password) throws IOException, SQLException
- Specified by:
setPasswordin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
setPredisablePassword
public void setPredisablePassword(String password) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
toStringImpl
public String toStringImpl() throws IOException, SQLException
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<UserServer>- Throws:
IOExceptionSQLException
-
write
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<Integer,UserServer>- Throws:
IOException
-
canSetPassword
public boolean canSetPassword() throws SQLException, IOException- Specified by:
canSetPasswordin interfacePasswordProtected- Throws:
SQLExceptionIOException
-
-