- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<User.Name,V>
-
- com.aoindustries.aoserv.client.account.CachedObjectUserNameKey<User>
-
- com.aoindustries.aoserv.client.account.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
EachUsernameis unique across all systems and must be allocated to aPackagebefore use in any of the account types.- Author:
- AO Industries, Inc.
- See Also:
Administrator,User,User,User
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUser.NameRepresents the most general form of a user name.
-
Field Summary
-
Fields inherited from class com.aoindustries.aoserv.client.account.CachedObjectUserNameKey
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 User()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAdministrator(String name, String title, Date birthday, boolean isPrivate, String workPhone, String homePhone, String cellPhone, String fax, Email email, String address1, String address2, String city, String state, String country, String zip, boolean enableEmailSupport)voidaddLinuxAccount(Group.Name primaryGroup, User.Gecos name, User.Gecos office_location, User.Gecos office_phone, User.Gecos home_phone, String type, PosixPath shell)voidaddLinuxAccount(Group primaryGroup, User.Gecos name, User.Gecos office_location, User.Gecos office_phone, User.Gecos home_phone, UserType typeObject, Shell shellObject)voidaddMySQLUser()voidaddPostgresUser()intarePasswordsSet()booleancanDisable()booleancanEnable()booleancanSetPassword()List<PasswordChecker.Result>checkPassword(String password)Checks the strength of a password as used by thisUsername.voiddisable(DisableLog dl)voidenable()AdministratorgetAdministrator()List<CannotRemoveReason<?>>getCannotRemoveReasons()Lists the reasons an object may not be removed.protected ObjectgetColumnImpl(int i)DisableLoggetDisableLog()UsergetLinuxAccount()UsergetMySQLUser()PackagegetPackage()Account.NamegetPackage_name()UsergetPostgresUser()Table.TableIDgetTableID()User.NamegetUsername()static intgroupPasswordsSet(List<? extends PasswordProtected> pps)voidinit(ResultSet result)Initializes this object from the raw database contents.booleanisDisabled()Checks if this object is disabled.booleanisUsed()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.account.CachedObjectUserNameKey
equals, getKey, hashCode, toStringImpl
-
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
-
addAdministrator
public void addAdministrator(String name, String title, Date birthday, boolean isPrivate, String workPhone, String homePhone, String cellPhone, String fax, Email email, String address1, String address2, String city, String state, String country, String zip, boolean enableEmailSupport) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
addLinuxAccount
public void addLinuxAccount(Group primaryGroup, User.Gecos name, User.Gecos office_location, User.Gecos office_phone, User.Gecos home_phone, UserType typeObject, Shell shellObject) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
addLinuxAccount
public void addLinuxAccount(Group.Name primaryGroup, User.Gecos name, User.Gecos office_location, User.Gecos office_phone, User.Gecos home_phone, String type, PosixPath shell) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
addMySQLUser
public void addMySQLUser() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
addPostgresUser
public void addPostgresUser() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
arePasswordsSet
public int arePasswordsSet() throws IOException, SQLException- Specified by:
arePasswordsSetin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
canDisable
public boolean canDisable() throws IOException, SQLException- Specified by:
canDisablein interfaceDisablable- Throws:
IOExceptionSQLException
-
canEnable
public boolean canEnable() throws SQLException, IOException- Specified by:
canEnablein interfaceDisablable- Throws:
SQLExceptionIOException
-
checkPassword
public List<PasswordChecker.Result> checkPassword(String password) throws IOException, SQLException
Checks the strength of a password as used by thisUsername.- Specified by:
checkPasswordin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
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
-
getAdministrator
public Administrator getAdministrator() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getColumnImpl
protected Object getColumnImpl(int i)
- 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
public DisableLog getDisableLog() throws SQLException, IOException
- Specified by:
getDisableLogin interfaceDisablable- Throws:
SQLExceptionIOException
-
getLinuxAccount
public User getLinuxAccount() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getMySQLUser
public User getMySQLUser() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getPackage_name
public Account.Name getPackage_name()
-
getPackage
public Package getPackage() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getPostgresUser
public User getPostgresUser() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<User.Name,User>
-
getUsername
public User.Name getUsername()
-
groupPasswordsSet
public static int groupPasswordsSet(List<? extends PasswordProtected> pps) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
init
public void init(ResultSet result) throws SQLException
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
-
isUsed
public boolean isUsed() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
read
public void read(StreamableInput in, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
readin interfaceAOServReadable- Specified by:
readin interfaceAOServStreamable- Specified by:
readin classAOServObject<User.Name,User>- Throws:
IOException
-
getCannotRemoveReasons
public List<CannotRemoveReason<?>> 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 SQLException, IOException
- Specified by:
setPasswordin interfacePasswordProtected- Throws:
SQLExceptionIOException
-
canSetPassword
public boolean canSetPassword() throws IOException, SQLException- Specified by:
canSetPasswordin interfacePasswordProtected- 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<User.Name,User>- Throws:
IOException
-
-