java.lang.Object
com.aoindustries.aoserv.client.AoservObject<Integer,UserServer>
com.aoindustries.aoserv.client.CachedObject<Integer,UserServer>
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
A
MysqlServerUser
grants a MysqlUser
access
to a Server
. Once access is granted to the Server
,
access may then be granted to individual MysqlDatabase
s via
MysqlDbUser
s.- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Convenience constants for the most commonly used host values.static final String
Convenience constants for the most commonly used host values.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
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
ConstructorDescriptionDeprecated.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
boolean
boolean
checkPassword
(String password) void
disable
(DisableLog dl) void
enable()
Lists the reasons an object may not be removed.protected Object
getColumnImpl
(int i) getHost()
int
int
int
int
int
void
Initializes this object from the raw database contents.boolean
Checks if this object is disabled.boolean
void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
remove()
Removes this object, and all dependant objects, from the system.void
setPassword
(String password) void
setPredisablePassword
(String password) AoservObject.toString()
implementation that is allowed to throw exceptions.void
write
(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
-
Field Details
-
UNLIMITED_QUESTIONS
public static final int UNLIMITED_QUESTIONS- See Also:
-
DEFAULT_MAX_QUESTIONS
public static final int DEFAULT_MAX_QUESTIONS- See Also:
-
UNLIMITED_UPDATES
public static final int UNLIMITED_UPDATES- See Also:
-
DEFAULT_MAX_UPDATES
public static final int DEFAULT_MAX_UPDATES- See Also:
-
UNLIMITED_CONNECTIONS
public static final int UNLIMITED_CONNECTIONS- See Also:
-
DEFAULT_MAX_CONNECTIONS
public static final int DEFAULT_MAX_CONNECTIONS- See Also:
-
UNLIMITED_USER_CONNECTIONS
public static final int UNLIMITED_USER_CONNECTIONS- See Also:
-
DEFAULT_MAX_USER_CONNECTIONS
public static final int DEFAULT_MAX_USER_CONNECTIONS- See Also:
-
MAX_HOST_LENGTH
public static final int MAX_HOST_LENGTH- See Also:
-
ANY_HOST
Convenience constants for the most commonly used host values.- See Also:
-
ANY_LOCAL_HOST
Convenience constants for the most commonly used host values.
-
-
Constructor Details
-
UserServer
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
arePasswordsSet
- Specified by:
arePasswordsSet
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
canDisable
public boolean canDisable()- Specified by:
canDisable
in interfaceDisablable
-
canEnable
- Specified by:
canEnable
in interfaceDisablable
- Throws:
SQLException
IOException
-
checkPassword
- Specified by:
checkPassword
in interfacePasswordProtected
- Throws:
IOException
-
disable
- Specified by:
disable
in interfaceDisablable
- Throws:
IOException
SQLException
-
enable
- Specified by:
enable
in interfaceDisablable
- Throws:
IOException
SQLException
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<Integer,
UserServer>
-
isDisabled
public boolean isDisabled()Description copied from interface:Disablable
Checks 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:
isDisabled
in interfaceDisablable
-
getDisableLog_id
-
getDisableLog
- Specified by:
getDisableLog
in interfaceDisablable
- Throws:
SQLException
IOException
-
getHost
-
getMysqlDbUsers
- Throws:
IOException
SQLException
-
getMysqlUser_username
-
getMysqlUser
- Throws:
SQLException
IOException
-
isSpecial
public boolean isSpecial() -
getPredisablePassword
-
getMaxQuestions
public int getMaxQuestions() -
getMaxUpdates
public int getMaxUpdates() -
getMaxConnections
public int getMaxConnections() -
getMaxUserConnections
public int getMaxUserConnections() -
getMysqlServer_id
public int getMysqlServer_id() -
getMysqlServer
- Throws:
IOException
SQLException
-
getTableId
- Specified by:
getTableId
in classAoservObject<Integer,
UserServer>
-
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<Integer,
UserServer> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<Integer,
UserServer> - Throws:
IOException
-
getCannotRemoveReasons
public List<CannotRemoveReason<UserServer>> getCannotRemoveReasons() throws SQLException, IOExceptionDescription copied from interface:Removable
Lists the reasons an object may not be removed.- Specified by:
getCannotRemoveReasons
in interfaceRemovable
- Returns:
- an empty
List<CannotRemoveReason>
if this object may be removed, or a list of descriptions - Throws:
SQLException
IOException
-
remove
Description copied from interface:Removable
Removes this object, and all dependant objects, from the system.- Specified by:
remove
in interfaceRemovable
- Throws:
IOException
SQLException
-
setPassword
- Specified by:
setPassword
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
setPredisablePassword
- Throws:
IOException
SQLException
-
toStringImpl
Description copied from class:AoservObject
AoservObject.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:
toStringImpl
in classCachedObjectIntegerKey<UserServer>
- Throws:
IOException
SQLException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<Integer,
UserServer> - Throws:
IOException
-
canSetPassword
- Specified by:
canSetPassword
in interfacePasswordProtected
- Throws:
SQLException
IOException
-