java.lang.Object
com.aoindustries.aoserv.client.AoservObject<Integer,UserServer>
com.aoindustries.aoserv.client.CachedObject<Integer,UserServer>
com.aoindustries.aoserv.client.CachedObjectIntegerKey<UserServer>
com.aoindustries.aoserv.client.linux.UserServer
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AoservReadable,AoservStreamable,AoservWritable,Disablable,PasswordProtected,Removable,SingleTableObject<Integer,UserServer>
public final class UserServer
extends CachedObjectIntegerKey<UserServer>
implements Removable, PasswordProtected, Disablable
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final intThe default number of days email messages will be kept in the "Junk" folder.static final intThe default SpamAssassin discard score.static final floatThe default SpamAssassin required score.static final intThe default number of days email messages will be kept in the "Trash" folder.static final intThe UID of the root user.Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
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 TypeMethodDescriptionintaddEmailAddress(Address address) intbooleanbooleanbooleancheckPassword(String password) longcopyHomeDirectory(Server toServer) voidcopyPassword(UserServer other) voiddisable(DisableLog dl) voidenable()intLists the reasons an object may not be removed.protected ObjectgetColumnImpl(int i) static PosixPathgetDefaultHomeDirectory(User.Name username) Gets the default non-hashed home directory of/home/username.static PosixPathgetHashedHomeDirectory(User.Name username) Gets the optional hashed home directory of/home/u/username.getHome()long[]getImapFolderSizes(String[] folderNames) intGets the age of junk that will be auto-deleted, in days, or-1to not auto-delete.Gets the primaryGroupUserfor thisUserServer.intGets the minimum score where spam assassin should discard email or-1if this feature is disabled.floatgetSudo()Gets thesudosetting for this user ornullwhen nosudoallowed.intGets the age of trash that will be auto-deleted, in days, or-1to not auto-delete.getUid()voidInitializes this object from the raw database contents.booleanbooleanChecks if this object is disabled.intbooleanpasswordMatches(String password) voidread(StreamableInput in, AoservProtocol.Version protocolVersion) voidremove()Removes this object, and all dependant objects, from the system.voidsetAutoresponder(InboxAddress from, String subject, String content, boolean enabled) voidsetCronTable(String cronTable) voidvoidsetJunkEmailRetention(int days) voidsetPassword(String password) voidsetPredisablePassword(String password) voidsetSpamAssassinDiscardScore(int discardScore) voidsetSpamAssassinRequiredScore(float requiredScore) voidsetTrashEmailRetention(int days) voidsetUseInbox(boolean useInbox) AoservObject.toString()implementation that is allowed to throw exceptions.booleanuseInbox()voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCodeMethods 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
-
ROOT_UID
public static final int ROOT_UIDThe UID of the root user.Note: Copied from PosixFile.java to avoid interproject dependency.
- See Also:
-
COLUMN_USERNAME_name
- See Also:
-
COLUMN_AO_SERVER_name
- See Also:
-
DEFAULT_TRASH_EMAIL_RETENTION
public static final int DEFAULT_TRASH_EMAIL_RETENTIONThe default number of days email messages will be kept in the "Trash" folder.- See Also:
-
DEFAULT_JUNK_EMAIL_RETENTION
public static final int DEFAULT_JUNK_EMAIL_RETENTIONThe default number of days email messages will be kept in the "Junk" folder.- See Also:
-
DEFAULT_SPAM_ASSASSIN_REQUIRED_SCORE
public static final float DEFAULT_SPAM_ASSASSIN_REQUIRED_SCOREThe default SpamAssassin required score.- See Also:
-
DEFAULT_SPAM_ASSASSIN_DISCARD_SCORE
public static final int DEFAULT_SPAM_ASSASSIN_DISCARD_SCOREThe default SpamAssassin discard score.- See Also:
-
-
Constructor Details
-
UserServer
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
-
canDisable
- Specified by:
canDisablein interfaceDisablable- 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
-
canEnable
- Specified by:
canEnablein interfaceDisablable- Throws:
SQLExceptionIOException
-
checkPassword
- Specified by:
checkPasswordin interfacePasswordProtected- Throws:
SQLExceptionIOException
-
copyHomeDirectory
- Throws:
IOExceptionSQLException
-
copyPassword
- Throws:
IOExceptionSQLException
-
disable
- Specified by:
disablein interfaceDisablable- Throws:
IOExceptionSQLException
-
enable
- Specified by:
enablein interfaceDisablable- Throws:
IOExceptionSQLException
-
getColumnImpl
- Specified by:
getColumnImplin classAoservObject<Integer,UserServer>
-
getCvsRepositories
- Throws:
IOExceptionSQLException
-
getEmailAttachmentBlocks
- Throws:
IOExceptionSQLException
-
getAutoresponderContent
- Throws:
IOExceptionSQLException
-
getAutoresponderFrom
- Throws:
IOExceptionSQLException
-
getAutoresponderSubject
-
getAutoresponderPath
-
isAutoresponderEnabled
public boolean isAutoresponderEnabled() -
getCronTable
- Throws:
IOExceptionSQLException
-
getDefaultHomeDirectory
Gets the default non-hashed home directory of/home/username. -
getHashedHomeDirectory
Gets the optional hashed home directory of/home/u/username. -
getDisableLog
- Specified by:
getDisableLogin interfaceDisablable- Throws:
SQLExceptionIOException
-
getEmailAddresses
- Throws:
SQLExceptionIOException
-
getHttpdSites
- Throws:
IOExceptionSQLException
-
getInboxAttributes
- Throws:
IOExceptionSQLException
-
getImapFolderSizes
- Throws:
IOExceptionSQLException
-
getLinuxAccAddresses
- Throws:
IOExceptionSQLException
-
getHome
-
getLinuxAccount_username_id
-
getLinuxAccount
- Throws:
SQLExceptionIOException
-
getPredisablePassword
-
getCreated
-
useInbox
public boolean useInbox() -
getTrashEmailRetention
public int getTrashEmailRetention()Gets the age of trash that will be auto-deleted, in days, or-1to not auto-delete. -
getJunkEmailRetention
public int getJunkEmailRetention()Gets the age of junk that will be auto-deleted, in days, or-1to not auto-delete. -
getEmailSpamAssassinIntegrationMode
- Throws:
SQLExceptionIOException
-
getSpamAssassinRequiredScore
public float getSpamAssassinRequiredScore() -
getSpamAssassinDiscardScore
public int getSpamAssassinDiscardScore()Gets the minimum score where spam assassin should discard email or-1if this feature is disabled. -
getSudo
Gets thesudosetting for this user ornullwhen nosudoallowed. -
getPrimaryLinuxServerGroup
Gets the primaryGroupUserfor thisUserServer.- Throws:
SQLException- if the primary group is not found or two or more groups are marked as primary or the primary group does not exist on the same serverIOException
-
getAoServer_server_id
public int getAoServer_server_id() -
getServer
- Throws:
SQLExceptionIOException
-
getTableId
- Specified by:
getTableIdin classAoservObject<Integer,UserServer>
-
getUid
-
init
Description copied from class:AoservObjectInitializes this object from the raw database contents.- Specified by:
initin classAoservObject<Integer,UserServer> - Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
isProcmailManual
- Throws:
IOExceptionSQLException
-
arePasswordsSet
- Specified by:
arePasswordsSetin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
read
- Specified by:
readin interfaceAoservReadable- Specified by:
readin interfaceAoservStreamable- Specified by:
readin classAoservObject<Integer,UserServer> - Throws:
IOException
-
getEmailLists
- Throws:
IOExceptionSQLException
-
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
-
setCronTable
- Throws:
IOExceptionSQLException
-
setPassword
- Specified by:
setPasswordin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
setAutoresponder
public void setAutoresponder(InboxAddress from, String subject, String content, boolean enabled) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
setTrashEmailRetention
- Throws:
IOExceptionSQLException
-
setJunkEmailRetention
- Throws:
IOExceptionSQLException
-
setEmailSpamAssassinIntegrationMode
public void setEmailSpamAssassinIntegrationMode(SpamAssassinMode mode) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
setSpamAssassinRequiredScore
- Throws:
IOExceptionSQLException
-
setSpamAssassinDiscardScore
- Throws:
IOExceptionSQLException
-
setUseInbox
- Throws:
IOExceptionSQLException
-
setPredisablePassword
- Throws:
IOExceptionSQLException
-
toStringImpl
Description copied from class:AoservObjectAoservObject.toString()implementation that is allowed to throw exceptions.Implementation Note:
This default implementation callsAoservObject.toString()on the key (fromAoservObject.getKey()). When the key isnull, uses the default implementation fromObject.toString().- Overrides:
toStringImplin classCachedObjectIntegerKey<UserServer>- Throws:
SQLExceptionIOException
-
write
- Specified by:
writein interfaceAoservStreamable- Specified by:
writein interfaceAoservWritable- Specified by:
writein classAoservObject<Integer,UserServer> - Throws:
IOException
-
canSetPassword
- Specified by:
canSetPasswordin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
passwordMatches
- Throws:
IOExceptionSQLException
-
addEmailAddress
- Throws:
IOExceptionSQLException
-
