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
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
ConstructorsConstructorDescriptionDeprecated, 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 TypeMethodDescriptionintbooleanbooleanbooleanbooleancanSwitchUser(Administrator other) booleanstatic List<PasswordChecker.Result> checkPassword(User.Name username, String password) Validates a password and returns a description of the problem.checkPassword(String password) intSorts by username.voiddisable(DisableLog dl) Validates a password and returns a description of the problem.voidenable()Lists the reasons an object may not be removed.getCity()protected ObjectgetColumnImpl(int i) getEmail()getFax()getName()Gets the hashed password for this business_administrator.getState()getTitle()Deprecated.getZip()booleanhasPermission(Permission permission) Checks if this business administrator has the provided permission.booleanhasPermission(Permission.Name permission) Checks if this business administrator has the provided permission.booleanhasPermission(String permission) Checks if this business administrator has the provided permission.voidInitializes this object from the raw database contents.booleanbooleanbooleanbooleanbooleanbooleanChecks if this object is disabled.booleanbooleanvoidread(StreamableInput in, AoservProtocol.Version protocolVersion) voidremove()Removes this object, and all dependant objects, from the system.voidsetPassword(String plaintext) Sets the password for thisAdministrator.voidsetProfile(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) voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.account.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
-
Constructor Details
-
Administrator
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
-
arePasswordsSet
- Specified by:
arePasswordsSetin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
canDisable
- Specified by:
canDisablein interfaceDisablable- Throws:
SQLExceptionIOException
-
canSwitchUsers
public boolean canSwitchUsers() -
getSupportCode
-
canSwitchUser
- Throws:
SQLExceptionIOException
-
canEnable
- Specified by:
canEnablein interfaceDisablable- Throws:
SQLExceptionIOException
-
checkPassword
- Specified by:
checkPasswordin 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, thennullis returned.- Throws:
IOException
-
disable
Validates a password and returns a description of the problem. If the password is valid, thennullis returned.- Specified by:
disablein interfaceDisablable- Throws:
IOExceptionSQLException
-
enable
- Specified by:
enablein interfaceDisablable- Throws:
IOExceptionSQLException
-
getTicketActions
- Throws:
IOExceptionSQLException
-
getTicketAssignments
- Throws:
IOExceptionSQLException
-
getAddress1
-
getAddress2
-
getBirthday
-
getCellPhone
-
getCity
-
getColumnImpl
- Specified by:
getColumnImplin classAoservObject<User.Name,Administrator>
-
getCountry
- Throws:
SQLExceptionIOException
-
getCreated
-
getCreatedTickets
- Throws:
IOExceptionSQLException
-
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
- Specified by:
getDisableLogin interfaceDisablable- Throws:
SQLExceptionIOException
-
getEmail
-
getFax
-
getHomePhone
-
getMasterUser
- Throws:
IOExceptionSQLException
-
getMonthlyCharges
- Throws:
IOExceptionSQLException
-
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:
getTableIdin classAoservObject<User.Name,Administrator>
-
getTitle
-
getTransactions
Deprecated.- Throws:
IOExceptionSQLException
-
getUsername_userId
-
getUsername
- Throws:
SQLExceptionIOException
-
getWorkPhone
-
getZip
-
isActiveAccounting
- Throws:
IOExceptionSQLException
-
isActiveBankAccounting
- Throws:
IOExceptionSQLException
-
isActiveDnsAdmin
- Throws:
IOExceptionSQLException
-
isActiveTableInvalidator
- Throws:
IOExceptionSQLException
-
isActiveWebAdmin
- Throws:
IOExceptionSQLException
-
isPreferred
public boolean isPreferred() -
isPrivate
public boolean isPrivate() -
init
Description copied from class:AoservObjectInitializes this object from the raw database contents.- Specified by:
initin classAoservObject<User.Name,Administrator> - 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,Administrator> - 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 - Throws:
SQLExceptionIOException
-
remove
Description copied from interface:RemovableRemoves this object, and all dependant objects, from the system.- Specified by:
removein interfaceRemovable- Throws:
IOExceptionSQLException
-
setPassword
Sets the password for thisAdministrator. All connections must be over secure protocols for this method to work. If the connections are not secure, anIOExceptionis thrown.- Specified by:
setPasswordin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
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:
IOExceptionSQLException
-
write
- Specified by:
writein interfaceAoservStreamable- Specified by:
writein interfaceAoservWritable- Specified by:
writein classAoservObject<User.Name,Administrator> - Throws:
IOException
-
canSetPassword
public boolean canSetPassword()- Specified by:
canSetPasswordin interfacePasswordProtected
-
getPermissions
- Throws:
IOExceptionSQLException
-
hasPermission
Checks if this business administrator has the provided permission.- Throws:
IOExceptionSQLException
-
hasPermission
Checks if this business administrator has the provided permission.- Throws:
IOExceptionSQLException
-
hasPermission
Checks if this business administrator has the provided permission.- Throws:
IOExceptionSQLException
-
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:
compareToin interfaceComparable<Administrator>
-
