Class Administrator
java.lang.Object
com.aoindustries.aoserv.client.AoservObject<User.Name,Administrator>
com.aoindustries.aoserv.client.CachedObject<User.Name,Administrator>
com.aoindustries.aoserv.client.account.CachedObjectUserNameKey<Administrator>
com.aoindustries.aoserv.client.account.Administrator
- All Implemented Interfaces:
Streamable
,StreamReadable
,StreamWritable
,Row
,AoservReadable
,AoservStreamable
,AoservWritable
,Disablable
,PasswordProtected
,Removable
,SingleTableObject<User.Name,
,Administrator> Comparable<Administrator>
public final class Administrator
extends CachedObjectUserNameKey<Administrator>
implements PasswordProtected, Removable, Disablable, Comparable<Administrator>
An
Administrator
is a username and password pair, usually
representing an individual or an application, that has administrative control
over all resources in an Account
or any any of its child businesses.- Author:
- AO Industries, Inc.
- See Also:
-
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
ConstructorDescriptionDeprecated.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
boolean
boolean
boolean
canSwitchUser
(Administrator other) boolean
static List
<PasswordChecker.Result> checkPassword
(User.Name username, String password) Validates a password and returns a description of the problem.checkPassword
(String password) int
Sorts by username.void
disable
(DisableLog dl) Validates a password and returns a description of the problem.void
enable()
Lists the reasons an object may not be removed.getCity()
protected Object
getColumnImpl
(int i) getEmail()
getFax()
getName()
Gets the hashed password for this business_administrator.getState()
getTitle()
Deprecated.getZip()
boolean
hasPermission
(Permission permission) Checks if this business administrator has the provided permission.boolean
hasPermission
(Permission.Name permission) Checks if this business administrator has the provided permission.boolean
hasPermission
(String permission) Checks if this business administrator has the provided permission.void
Initializes this object from the raw database contents.boolean
boolean
boolean
boolean
boolean
boolean
Checks if this object is disabled.boolean
boolean
void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
remove()
Removes this object, and all dependant objects, from the system.void
setPassword
(String plaintext) Sets the password for thisAdministrator
.void
setProfile
(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) 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
-
Administrator
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
arePasswordsSet
- Specified by:
arePasswordsSet
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
canDisable
- Specified by:
canDisable
in interfaceDisablable
- Throws:
SQLException
IOException
-
canSwitchUsers
public boolean canSwitchUsers() -
getSupportCode
-
canSwitchUser
- Throws:
SQLException
IOException
-
canEnable
- Specified by:
canEnable
in interfaceDisablable
- Throws:
SQLException
IOException
-
checkPassword
- Specified by:
checkPassword
in interfacePasswordProtected
- Throws:
IOException
-
checkPassword
public static List<PasswordChecker.Result> checkPassword(User.Name username, String password) throws IOException Validates a password and returns a description of the problem. If the password is valid, thennull
is returned.- Throws:
IOException
-
disable
Validates a password and returns a description of the problem. If the password is valid, thennull
is returned.- Specified by:
disable
in interfaceDisablable
- Throws:
IOException
SQLException
-
enable
- Specified by:
enable
in interfaceDisablable
- Throws:
IOException
SQLException
-
getTicketActions
- Throws:
IOException
SQLException
-
getTicketAssignments
- Throws:
IOException
SQLException
-
getAddress1
-
getAddress2
-
getBirthday
-
getCellPhone
-
getCity
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<User.Name,
Administrator>
-
getCountry
- Throws:
SQLException
IOException
-
getCreated
-
getCreatedTickets
- Throws:
IOException
SQLException
-
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
-
getEmail
-
getFax
-
getHomePhone
-
getMasterUser
- Throws:
IOException
SQLException
-
getMonthlyCharges
- Throws:
IOException
SQLException
-
getName
-
getPassword
Gets the hashed password for this business_administrator. This information is only available if all communication has been over secure connections. Otherwise, all passwords will be changed toNO_PASSWORD
.- See Also:
-
getState
-
getTableId
- Specified by:
getTableId
in classAoservObject<User.Name,
Administrator>
-
getTitle
-
getTransactions
Deprecated.- Throws:
IOException
SQLException
-
getUsername_userId
-
getUsername
- Throws:
SQLException
IOException
-
getWorkPhone
-
getZip
-
isActiveAccounting
- Throws:
IOException
SQLException
-
isActiveBankAccounting
- Throws:
IOException
SQLException
-
isActiveDnsAdmin
- Throws:
IOException
SQLException
-
isActiveTableInvalidator
- Throws:
IOException
SQLException
-
isActiveWebAdmin
- Throws:
IOException
SQLException
-
isPreferred
public boolean isPreferred() -
isPrivate
public boolean isPrivate() -
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<User.Name,
Administrator> - 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<User.Name,
Administrator> - 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
Sets the password for thisAdministrator
. All connections must be over secure protocols for this method to work. If the connections are not secure, anIOException
is thrown.- Specified by:
setPassword
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
setProfile
public void setProfile(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) throws IOException, SQLException - Throws:
IOException
SQLException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<User.Name,
Administrator> - Throws:
IOException
-
canSetPassword
public boolean canSetPassword()- Specified by:
canSetPassword
in interfacePasswordProtected
-
getPermissions
- Throws:
IOException
SQLException
-
hasPermission
Checks if this business administrator has the provided permission.- Throws:
IOException
SQLException
-
hasPermission
Checks if this business administrator has the provided permission.- Throws:
IOException
SQLException
-
hasPermission
Checks if this business administrator has the provided permission.- Throws:
IOException
SQLException
-
compareTo
Sorts by username.TODO: Consider handling comparisons at the AoservTable and making all AoservObject's comparable. We could then return things as sets where appropriate. Maybe have getMap, getList, getSet, and getSortedSet as appropriate?
- Specified by:
compareTo
in interfaceComparable<Administrator>
-