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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final int
The default number of days email messages will be kept in the "Junk" folder.static final int
The default SpamAssassin discard score.static final float
The default SpamAssassin required score.static final int
The default number of days email messages will be kept in the "Trash" folder.static final int
The 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
ConstructorDescriptionDeprecated.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptionint
addEmailAddress
(Address address) int
boolean
boolean
boolean
checkPassword
(String password) long
copyHomeDirectory
(Server toServer) void
copyPassword
(UserServer other) void
disable
(DisableLog dl) void
enable()
int
Lists the reasons an object may not be removed.protected Object
getColumnImpl
(int i) static PosixPath
getDefaultHomeDirectory
(User.Name username) Gets the default non-hashed home directory of/home/username
.static PosixPath
getHashedHomeDirectory
(User.Name username) Gets the optional hashed home directory of/home/u/username
.getHome()
long[]
getImapFolderSizes
(String[] folderNames) int
Gets the age of junk that will be auto-deleted, in days, or-1
to not auto-delete.Gets the primaryGroupUser
for thisUserServer
.int
Gets the minimum score where spam assassin should discard email or-1
if this feature is disabled.float
getSudo()
Gets thesudo
setting for this user ornull
when nosudo
allowed.int
Gets the age of trash that will be auto-deleted, in days, or-1
to not auto-delete.getUid()
void
Initializes this object from the raw database contents.boolean
boolean
Checks if this object is disabled.int
boolean
passwordMatches
(String password) void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
remove()
Removes this object, and all dependant objects, from the system.void
setAutoresponder
(InboxAddress from, String subject, String content, boolean enabled) void
setCronTable
(String cronTable) void
void
setJunkEmailRetention
(int days) void
setPassword
(String password) void
setPredisablePassword
(String password) void
setSpamAssassinDiscardScore
(int discardScore) void
setSpamAssassinRequiredScore
(float requiredScore) void
setTrashEmailRetention
(int days) void
setUseInbox
(boolean useInbox) AoservObject.toString()
implementation that is allowed to throw exceptions.boolean
useInbox()
void
write
(StreamableOutput out, AoservProtocol.Version protocolVersion) 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 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.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
canDisable
- Specified by:
canDisable
in interfaceDisablable
- 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
-
canEnable
- Specified by:
canEnable
in interfaceDisablable
- Throws:
SQLException
IOException
-
checkPassword
- Specified by:
checkPassword
in interfacePasswordProtected
- Throws:
SQLException
IOException
-
copyHomeDirectory
- Throws:
IOException
SQLException
-
copyPassword
- Throws:
IOException
SQLException
-
disable
- Specified by:
disable
in interfaceDisablable
- Throws:
IOException
SQLException
-
enable
- Specified by:
enable
in interfaceDisablable
- Throws:
IOException
SQLException
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<Integer,
UserServer>
-
getCvsRepositories
- Throws:
IOException
SQLException
-
getEmailAttachmentBlocks
- Throws:
IOException
SQLException
-
getAutoresponderContent
- Throws:
IOException
SQLException
-
getAutoresponderFrom
- Throws:
IOException
SQLException
-
getAutoresponderSubject
-
getAutoresponderPath
-
isAutoresponderEnabled
public boolean isAutoresponderEnabled() -
getCronTable
- Throws:
IOException
SQLException
-
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:
getDisableLog
in interfaceDisablable
- Throws:
SQLException
IOException
-
getEmailAddresses
- Throws:
SQLException
IOException
-
getHttpdSites
- Throws:
IOException
SQLException
-
getInboxAttributes
- Throws:
IOException
SQLException
-
getImapFolderSizes
- Throws:
IOException
SQLException
-
getLinuxAccAddresses
- Throws:
IOException
SQLException
-
getHome
-
getLinuxAccount_username_id
-
getLinuxAccount
- Throws:
SQLException
IOException
-
getPredisablePassword
-
getCreated
-
useInbox
public boolean useInbox() -
getTrashEmailRetention
public int getTrashEmailRetention()Gets the age of trash that will be auto-deleted, in days, or-1
to not auto-delete. -
getJunkEmailRetention
public int getJunkEmailRetention()Gets the age of junk that will be auto-deleted, in days, or-1
to not auto-delete. -
getEmailSpamAssassinIntegrationMode
- Throws:
SQLException
IOException
-
getSpamAssassinRequiredScore
public float getSpamAssassinRequiredScore() -
getSpamAssassinDiscardScore
public int getSpamAssassinDiscardScore()Gets the minimum score where spam assassin should discard email or-1
if this feature is disabled. -
getSudo
Gets thesudo
setting for this user ornull
when nosudo
allowed. -
getPrimaryLinuxServerGroup
Gets the primaryGroupUser
for 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:
SQLException
IOException
-
getTableId
- Specified by:
getTableId
in classAoservObject<Integer,
UserServer>
-
getUid
-
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<Integer,
UserServer> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
isProcmailManual
- Throws:
IOException
SQLException
-
arePasswordsSet
- Specified by:
arePasswordsSet
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<Integer,
UserServer> - Throws:
IOException
-
getEmailLists
- Throws:
IOException
SQLException
-
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
-
setCronTable
- Throws:
IOException
SQLException
-
setPassword
- Specified by:
setPassword
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
setAutoresponder
public void setAutoresponder(InboxAddress from, String subject, String content, boolean enabled) throws IOException, SQLException - Throws:
IOException
SQLException
-
setTrashEmailRetention
- Throws:
IOException
SQLException
-
setJunkEmailRetention
- Throws:
IOException
SQLException
-
setEmailSpamAssassinIntegrationMode
public void setEmailSpamAssassinIntegrationMode(SpamAssassinMode mode) throws IOException, SQLException - Throws:
IOException
SQLException
-
setSpamAssassinRequiredScore
- Throws:
IOException
SQLException
-
setSpamAssassinDiscardScore
- Throws:
IOException
SQLException
-
setUseInbox
- Throws:
IOException
SQLException
-
setPredisablePassword
- Throws:
IOException
SQLException
-
toStringImpl
Description copied from class:AoservObject
AoservObject.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:
toStringImpl
in classCachedObjectIntegerKey<UserServer>
- Throws:
SQLException
IOException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<Integer,
UserServer> - Throws:
IOException
-
canSetPassword
- Specified by:
canSetPassword
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
passwordMatches
- Throws:
IOException
SQLException
-
addEmailAddress
- Throws:
IOException
SQLException
-