- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<Integer,V>
-
- com.aoindustries.aoserv.client.CachedObjectIntegerKey<List>
-
- com.aoindustries.aoserv.client.email.List
-
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable,Disablable,Removable,SingleTableObject<Integer,List>
public final class List extends CachedObjectIntegerKey<List> implements Removable, Disablable
Any incoming email addressed to aListis immediately forwarded on to all addresses contained in the list.- Author:
- AO Industries, Inc.
- See Also:
Address
-
-
Field Summary
Fields Modifier and Type Field Description static StringLIST_DIRECTORYThe directory that email lists are normally contained in.static intMAX_NAME_LENGTHThe maximum length of an email list name.-
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
-
-
Constructor Summary
Constructors Constructor Description List()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddEmailAddress(Address address)booleancanDisable()booleancanEnable()voiddisable(DisableLog dl)voidenable()StringgetAddressList()Gets the list of addresses that email will be sent to, one address per line.intgetAddressListCount()Gets the number of addresses in an address list.List<CannotRemoveReason<?>>getCannotRemoveReasons()Lists the reasons an object may not be removed.protected ObjectgetColumnImpl(int i)DisableLoggetDisableLog()List<Address>getEmailAddresses()List<ListAddress>getEmailListAddresses()UserServergetLinuxServerAccount()intgetLinuxServerAccount_pkey()GroupServergetLinuxServerGroup()intgetLinuxServerGroup_pkey()static PosixPathgetListPath(String name, int osv)Gets the full path that should be used for normal email lists.MajordomoListgetMajordomoList()PosixPathgetPath()Table.TableIDgetTableID()voidinit(ResultSet result)Initializes this object from the raw database contents.booleanisDisabled()Checks if this object is disabled.static booleanisValidRegularPath(PosixPath path, int osv)Checks the validity of a list name.voidread(StreamableInput in, AoservProtocol.Version protocolVersion)voidremove()Removes this object, and all dependant objects, from the system.voidsetAddressList(String addresses)voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion)-
Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, 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
-
-
-
-
Field Detail
-
LIST_DIRECTORY
public static final String LIST_DIRECTORY
The directory that email lists are normally contained in.- See Also:
- Constant Field Values
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTH
The maximum length of an email list name.- See Also:
- Constant Field Values
-
-
Method Detail
-
addEmailAddress
public int addEmailAddress(Address address) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
canDisable
public boolean canDisable()
- Specified by:
canDisablein interfaceDisablable
-
canEnable
public boolean canEnable() throws SQLException, IOException- Specified by:
canEnablein interfaceDisablable- Throws:
SQLExceptionIOException
-
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
-
getAddressList
public String getAddressList() throws IOException, SQLException
Gets the list of addresses that email will be sent to, one address per line. The list is obtained from a file on the server that hosts the list.- Throws:
IOExceptionSQLException
-
getAddressListCount
public int getAddressListCount() throws IOException, SQLExceptionGets the number of addresses in an address list. The number of addresses is equal to the number of non-blank lines.- Throws:
IOExceptionSQLException
-
getColumnImpl
protected Object getColumnImpl(int i)
- Specified by:
getColumnImplin classAOServObject<Integer,List>
-
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
public DisableLog getDisableLog() throws SQLException, IOException
- Specified by:
getDisableLogin interfaceDisablable- Throws:
SQLExceptionIOException
-
getEmailAddresses
public List<Address> getEmailAddresses() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getEmailListAddresses
public List<ListAddress> getEmailListAddresses() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getLinuxServerAccount_pkey
public int getLinuxServerAccount_pkey()
-
getLinuxServerAccount
public UserServer getLinuxServerAccount() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getLinuxServerGroup_pkey
public int getLinuxServerGroup_pkey()
-
getLinuxServerGroup
public GroupServer getLinuxServerGroup() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getListPath
public static PosixPath getListPath(String name, int osv) throws ValidationException
Gets the full path that should be used for normal email lists.- Throws:
ValidationException- See Also:
OperatingSystemVersion.getEmailListPath(java.lang.String)
-
getMajordomoList
public MajordomoList getMajordomoList() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getPath
public PosixPath getPath()
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<Integer,List>
-
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,List>- Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
isValidRegularPath
public static boolean isValidRegularPath(PosixPath path, int osv)
Checks the validity of a list name. TODO: Self-validating type
-
read
public void read(StreamableInput in, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
readin interfaceAOServReadable- Specified by:
readin interfaceAOServStreamable- Specified by:
readin classAOServObject<Integer,List>- Throws:
IOException
-
getCannotRemoveReasons
public List<CannotRemoveReason<?>> 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
-
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
-
setAddressList
public void setAddressList(String addresses) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
write
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<Integer,List>- Throws:
IOException
-
-