java.lang.Object
com.aoindustries.aoserv.client.AoservObject<User.Name,User>
com.aoindustries.aoserv.client.CachedObject<User.Name,User>
com.aoindustries.aoserv.client.mysql.CachedObjectUserNameKey<User>
com.aoindustries.aoserv.client.mysql.User
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AoservReadable,AoservStreamable,AoservWritable,Disablable,PasswordProtected,Removable,SingleTableObject<User.Name,User>
public final class User
extends CachedObjectUserNameKey<User>
implements PasswordProtected, Removable, Disablable
A
MysqlUser stores the details of a MySQL account
that are common to all servers.- Author:
- AO Industries, Inc.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final User.NameThe username of the MySQLmysql.sessionuser added in MySQL 5.7.static final User.NameThe username of the MySQLmysql.sysuser added in MySQL 5.7.static final User.NameThe default username for MySQL monitoring.static final StringA password may be set to null, which means that the account will be disabled.static final Stringstatic final User.NameThe username of the MySQL super user.Fields inherited from class com.aoindustries.aoserv.client.mysql.CachedObjectUserNameKey
pkeyFields inherited from class com.aoindustries.aoserv.client.CachedObject
tableFields inherited from class com.aoindustries.aoserv.client.AoservObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITEFields inherited from interface com.aoindustries.aoserv.client.password.PasswordProtected
ALL, NONE, SOME -
Constructor Summary
ConstructorsConstructorDescriptionUser()Deprecated, for removal: This API element is subject to removal in a future version.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptionintaddMysqlServerUser(Server mysqlServer, String host) intbooleancanAlter()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleancanDrop()booleanbooleancanEvent()booleanbooleancanFile()booleancanGrant()booleancanIndex()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanstatic List<PasswordChecker.Result> checkPassword(User.Name username, String password) checkPassword(String password) voiddisable(DisableLog dl) voidenable()Lists the reasons an object may not be removed.protected ObjectgetColumnImpl(int i) getMysqlServerUser(Server mysqlServer) voidInitializes this object from the raw database contents.booleanChecks if this object is disabled.booleanbooleanbooleanstatic booleanSpecial MySQL users may not be added or removed.booleanisSuper()voidread(StreamableInput in, AoservProtocol.Version protocolVersion) voidremove()Removes this object, and all dependant objects, from the system.voidsetPassword(String password) voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.mysql.CachedObjectUserNameKey
equals, getKey, hashCode, toStringImplMethods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTableMethods 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
-
MAX_USERNAME_LENGTH
Deprecated.Please useUser.Name.MAX_LENGTHinstead.The maximum length of a MySQL username.- See Also:
-
ROOT
The username of the MySQL super user. -
MYSQL_SESSION
The username of the MySQLmysql.sessionuser added in MySQL 5.7. -
MYSQL_SYS
The username of the MySQLmysql.sysuser added in MySQL 5.7. -
MYSQLMON
The default username for MySQL monitoring. -
NO_PASSWORD
A password may be set to null, which means that the account will be disabled. -
NO_PASSWORD_DB_VALUE
- See Also:
-
-
Constructor Details
-
User
Deprecated, for removal: This API element is subject to removal in a future version.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
isSpecial
Special MySQL users may not be added or removed. -
addMysqlServerUser
- Throws:
IOExceptionSQLException
-
arePasswordsSet
- Specified by:
arePasswordsSetin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
canAlter
public boolean canAlter() -
canShowDb
public boolean canShowDb() -
isSuper
public boolean isSuper() -
canCreateTempTable
public boolean canCreateTempTable() -
canLockTables
public boolean canLockTables() -
canExecute
public boolean canExecute() -
isReplicationSlave
public boolean isReplicationSlave() -
isReplicationClient
public boolean isReplicationClient() -
canCreateView
public boolean canCreateView() -
canShowView
public boolean canShowView() -
canCreateRoutine
public boolean canCreateRoutine() -
canAlterRoutine
public boolean canAlterRoutine() -
canCreateUser
public boolean canCreateUser() -
canEvent
public boolean canEvent() -
canTrigger
public boolean canTrigger() -
canCreate
public boolean canCreate() -
canDelete
public boolean canDelete() -
canDisable
- Specified by:
canDisablein interfaceDisablable- Throws:
IOExceptionSQLException
-
canDrop
public boolean canDrop() -
canEnable
- Specified by:
canEnablein interfaceDisablable- Throws:
SQLExceptionIOException
-
canFile
public boolean canFile() -
canGrant
public boolean canGrant() -
canIndex
public boolean canIndex() -
canInsert
public boolean canInsert() -
canProcess
public boolean canProcess() -
canReference
public boolean canReference() -
canReload
public boolean canReload() -
canSelect
public boolean canSelect() -
canShutdown
public boolean canShutdown() -
canUpdate
public boolean canUpdate() -
checkPassword
- Specified by:
checkPasswordin interfacePasswordProtected- Throws:
IOException
-
checkPassword
public static List<PasswordChecker.Result> checkPassword(User.Name username, String password) throws IOException - Throws:
IOException
-
disable
- Specified by:
disablein interfaceDisablable- Throws:
IOExceptionSQLException
-
enable
- Specified by:
enablein interfaceDisablable- Throws:
IOExceptionSQLException
-
getColumnImpl
- Specified by:
getColumnImplin classAoservObject<User.Name,User>
-
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
-
getDisableLog
- Specified by:
getDisableLogin interfaceDisablable- Throws:
SQLExceptionIOException
-
getMysqlServerUser
- Throws:
IOExceptionSQLException
-
getMysqlServerUsers
- Throws:
IOExceptionSQLException
-
getTableId
- Specified by:
getTableIdin classAoservObject<User.Name,User>
-
getUsername_id
-
getUsername
- Throws:
SQLExceptionIOException
-
isSpecial
public boolean isSpecial() -
init
Description copied from class:AoservObjectInitializes this object from the raw database contents.- Specified by:
initin classAoservObject<User.Name,User> - Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
readin interfaceAoservReadable- Specified by:
readin interfaceAoservStreamable- Specified by:
readin classAoservObject<User.Name,User> - Throws:
IOException
-
getCannotRemoveReasons
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
-
remove
Description copied from interface:RemovableRemoves this object, and all dependant objects, from the system.- Specified by:
removein interfaceRemovable- Throws:
IOExceptionSQLException
-
setPassword
- Specified by:
setPasswordin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
write
- Specified by:
writein interfaceAoservStreamable- Specified by:
writein interfaceAoservWritable- Specified by:
writein classAoservObject<User.Name,User> - Throws:
IOException
-
canSetPassword
public boolean canSetPassword()- Specified by:
canSetPasswordin interfacePasswordProtected
-

User.Name.MAX_LENGTHinstead.