- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<Integer,V>
-
- 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
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOLUMN_AO_SERVER_namestatic StringCOLUMN_USERNAME_namestatic intDEFAULT_JUNK_EMAIL_RETENTIONThe default number of days email messages will be kept in the "Junk" folder.static intDEFAULT_SPAM_ASSASSIN_DISCARD_SCOREThe default SpamAssassin discard score.static floatDEFAULT_SPAM_ASSASSIN_REQUIRED_SCOREThe default SpamAssassin required score.static intDEFAULT_TRASH_EMAIL_RETENTIONThe default number of days email messages will be kept in the "Trash" folder.static intROOT_UIDThe UID of the root user.-
Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
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 UserServer()
-
Method Summary
-
Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCode
-
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
-
-
-
-
Field Detail
-
ROOT_UID
public static final int ROOT_UID
The UID of the root user. Note: Copied from PosixFile.java to avoid interproject dependency.- See Also:
- Constant Field Values
-
COLUMN_USERNAME_name
public static final String COLUMN_USERNAME_name
- See Also:
- Constant Field Values
-
COLUMN_AO_SERVER_name
public static final String COLUMN_AO_SERVER_name
- See Also:
- Constant Field Values
-
DEFAULT_TRASH_EMAIL_RETENTION
public static final int DEFAULT_TRASH_EMAIL_RETENTION
The default number of days email messages will be kept in the "Trash" folder.- See Also:
- Constant Field Values
-
DEFAULT_JUNK_EMAIL_RETENTION
public static final int DEFAULT_JUNK_EMAIL_RETENTION
The default number of days email messages will be kept in the "Junk" folder.- See Also:
- Constant Field Values
-
DEFAULT_SPAM_ASSASSIN_REQUIRED_SCORE
public static final float DEFAULT_SPAM_ASSASSIN_REQUIRED_SCORE
The default SpamAssassin required score.- See Also:
- Constant Field Values
-
DEFAULT_SPAM_ASSASSIN_DISCARD_SCORE
public static final int DEFAULT_SPAM_ASSASSIN_DISCARD_SCORE
The default SpamAssassin discard score.- See Also:
- Constant Field Values
-
-
Method Detail
-
canDisable
public boolean canDisable() throws IOException, SQLException- 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
public boolean canEnable() throws SQLException, IOException- Specified by:
canEnablein interfaceDisablable- Throws:
SQLExceptionIOException
-
checkPassword
public List<PasswordChecker.Result> checkPassword(String password) throws SQLException, IOException
- Specified by:
checkPasswordin interfacePasswordProtected- Throws:
SQLExceptionIOException
-
copyHomeDirectory
public long copyHomeDirectory(Server toServer) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
copyPassword
public void copyPassword(UserServer other) throws IOException, SQLException
- 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
-
getColumnImpl
protected Object getColumnImpl(int i)
- Specified by:
getColumnImplin classAOServObject<Integer,UserServer>
-
getCvsRepositories
public List<CvsRepository> getCvsRepositories() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getEmailAttachmentBlocks
public List<AttachmentBlock> getEmailAttachmentBlocks() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getAutoresponderContent
public String getAutoresponderContent() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getAutoresponderFrom
public InboxAddress getAutoresponderFrom() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getAutoresponderSubject
public String getAutoresponderSubject()
-
getAutoresponderPath
public String getAutoresponderPath()
-
isAutoresponderEnabled
public boolean isAutoresponderEnabled()
-
getCronTable
public String getCronTable() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getDefaultHomeDirectory
public static PosixPath getDefaultHomeDirectory(User.Name username)
Gets the default non-hashed home directory of/home/username.
-
getHashedHomeDirectory
public static PosixPath getHashedHomeDirectory(User.Name username)
Gets the optional hashed home directory of/home/u/username.
-
getDisableLog
public DisableLog getDisableLog() throws SQLException, IOException
- Specified by:
getDisableLogin interfaceDisablable- Throws:
SQLExceptionIOException
-
getEmailAddresses
public List<Address> getEmailAddresses() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getHttpdSharedTomcats
public List<SharedTomcat> getHttpdSharedTomcats() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getHttpdSites
public List<Site> getHttpdSites() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getInboxAttributes
public InboxAttributes getInboxAttributes() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getImapFolderSizes
public long[] getImapFolderSizes(String[] folderNames) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getLinuxAccAddresses
public List<InboxAddress> getLinuxAccAddresses() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getHome
public PosixPath getHome()
-
getLinuxAccount_username_id
public User.Name getLinuxAccount_username_id()
-
getLinuxAccount
public User getLinuxAccount() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getPredisablePassword
public String getPredisablePassword()
-
getCreated
public UnmodifiableTimestamp 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
public SpamAssassinMode getEmailSpamAssassinIntegrationMode() throws SQLException, IOException
- 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
public String getSudo()
Gets thesudosetting for this user ornullwhen nosudoallowed.
-
getPrimaryLinuxServerGroup
public GroupServer getPrimaryLinuxServerGroup() throws SQLException, IOException
Gets the primaryLinuxServerGroupfor thisLinuxServerAccount- 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
public Server getServer() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<Integer,UserServer>
-
getUid
public LinuxId getUid()
-
init
public void init(ResultSet result) throws SQLException
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
public int isProcmailManual() throws IOException, SQLException- Throws:
IOExceptionSQLException
-
arePasswordsSet
public int arePasswordsSet() throws IOException, SQLException- Specified by:
arePasswordsSetin interfacePasswordProtected- 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<Integer,UserServer>- Throws:
IOException
-
getEmailLists
public List<List> getEmailLists() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
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
-
setCronTable
public void setCronTable(String cronTable) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
setPassword
public void setPassword(String password) throws IOException, SQLException
- Specified by:
setPasswordin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
setAutoresponder
public void setAutoresponder(InboxAddress from, String subject, String content, boolean enabled) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
setTrashEmailRetention
public void setTrashEmailRetention(int days) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
setJunkEmailRetention
public void setJunkEmailRetention(int days) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
setEmailSpamAssassinIntegrationMode
public void setEmailSpamAssassinIntegrationMode(SpamAssassinMode mode) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
setSpamAssassinRequiredScore
public void setSpamAssassinRequiredScore(float required_score) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
setSpamAssassinDiscardScore
public void setSpamAssassinDiscardScore(int discard_score) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
setUseInbox
public void setUseInbox(boolean useInbox) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
setPredisablePassword
public void setPredisablePassword(String password) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
toStringImpl
public String toStringImpl() throws SQLException, IOException
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
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<Integer,UserServer>- Throws:
IOException
-
canSetPassword
public boolean canSetPassword() throws IOException, SQLException- Specified by:
canSetPasswordin interfacePasswordProtected- Throws:
IOExceptionSQLException
-
passwordMatches
public boolean passwordMatches(String password) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
addEmailAddress
public int addEmailAddress(Address address) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
-