java.lang.Object
com.aoindustries.aoserv.client.AoservObject<User.Name,User>
com.aoindustries.aoserv.client.CachedObject<User.Name,User>
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
Each
Username
is unique across all systems and must
be allocated to a Package
before use in any of the
account types.- Author:
- AO Industries, Inc.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents 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
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 TypeMethodDescriptionvoid
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) void
addLinuxAccount
(Group.Name primaryGroup, User.Gecos name, User.Gecos officeLocation, User.Gecos officePhone, User.Gecos homePhone, String type, PosixPath shell) void
addLinuxAccount
(Group primaryGroup, User.Gecos name, User.Gecos officeLocation, User.Gecos officePhone, User.Gecos homePhone, UserType typeObject, Shell shellObject) void
void
int
boolean
boolean
boolean
checkPassword
(String password) Checks the strength of a password as used by thisUsername
.void
disable
(DisableLog dl) void
enable()
Lists the reasons an object may not be removed.protected Object
getColumnImpl
(int i) static int
groupPasswordsSet
(List<? extends PasswordProtected> pps) void
Initializes this object from the raw database contents.boolean
Checks if this object is disabled.boolean
isUsed()
void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
remove()
Removes this object, and all dependant objects, from the system.void
setPassword
(String password) void
write
(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
-
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
-
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:
IOException
SQLException
-
addLinuxAccount
public void addLinuxAccount(Group primaryGroup, User.Gecos name, User.Gecos officeLocation, User.Gecos officePhone, User.Gecos homePhone, UserType typeObject, Shell shellObject) throws IOException, SQLException - Throws:
IOException
SQLException
-
addLinuxAccount
public void addLinuxAccount(Group.Name primaryGroup, User.Gecos name, User.Gecos officeLocation, User.Gecos officePhone, User.Gecos homePhone, String type, PosixPath shell) throws IOException, SQLException - Throws:
IOException
SQLException
-
addMysqlUser
- Throws:
IOException
SQLException
-
addPostgresUser
- Throws:
IOException
SQLException
-
arePasswordsSet
- Specified by:
arePasswordsSet
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
canDisable
- Specified by:
canDisable
in interfaceDisablable
- Throws:
IOException
SQLException
-
canEnable
- Specified by:
canEnable
in interfaceDisablable
- Throws:
SQLException
IOException
-
checkPassword
Checks the strength of a password as used by thisUsername
.- Specified by:
checkPassword
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
disable
- Specified by:
disable
in interfaceDisablable
- Throws:
IOException
SQLException
-
enable
- Specified by:
enable
in interfaceDisablable
- Throws:
IOException
SQLException
-
getAdministrator
- Throws:
IOException
SQLException
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<User.Name,
User>
-
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
- Specified by:
getDisableLog
in interfaceDisablable
- Throws:
SQLException
IOException
-
getLinuxAccount
- Throws:
IOException
SQLException
-
getMysqlUser
- Throws:
IOException
SQLException
-
getPackage_name
-
getPackage
- Throws:
SQLException
IOException
-
getPostgresUser
- Throws:
IOException
SQLException
-
getTableId
- Specified by:
getTableId
in classAoservObject<User.Name,
User>
-
getUsername
-
groupPasswordsSet
public static int groupPasswordsSet(List<? extends PasswordProtected> pps) throws IOException, SQLException - Throws:
IOException
SQLException
-
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<User.Name,
User> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
isUsed
- Throws:
IOException
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<User.Name,
User> - Throws:
IOException
-
getCannotRemoveReasons
Description 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:
SQLException
IOException
-
canSetPassword
- Specified by:
canSetPassword
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<User.Name,
User> - Throws:
IOException
-