- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<Integer,V>
-
- com.aoindustries.aoserv.client.CachedObjectIntegerKey<SmtpRelay>
-
- com.aoindustries.aoserv.client.email.SmtpRelay
-
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable,Disablable,Removable,SingleTableObject<Integer,SmtpRelay>
public final class SmtpRelay extends CachedObjectIntegerKey<SmtpRelay> implements Removable, Disablable
When a user successfully logs into either the POP3 or IMAP mail systems, access from their host is granted to the SMTP server via aEmailSmtpRelay.- Author:
- AO Industries, Inc.
-
-
Field Summary
Fields Modifier and Type Field Description static intHISTORY_DAYSKeep the SMTP relay history for three months (92 days).-
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 SmtpRelay()
-
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
-
HISTORY_DAYS
public static final int HISTORY_DAYS
Keep the SMTP relay history for three months (92 days).- See Also:
- Constant Field Values
-
-
Method Detail
-
addSpamEmailMessage
public int addSpamEmailMessage(String message) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
canDisable
public boolean canDisable()
- Specified by:
canDisablein interfaceDisablable
-
canEnable
public boolean canEnable() throws IOException, SQLException- Specified by:
canEnablein interfaceDisablable- 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,SmtpRelay>
-
getCreated
public UnmodifiableTimestamp getCreated()
-
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 IOException, SQLException
- Specified by:
getDisableLogin interfaceDisablable- Throws:
IOExceptionSQLException
-
getExpiration
public UnmodifiableTimestamp getExpiration()
-
getHost
public HostAddress getHost()
-
getType
public SmtpRelayType getType() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getLastRefreshed
public UnmodifiableTimestamp getLastRefreshed()
-
getPackage_name
public Account.Name getPackage_name()
-
getPackage
public Package getPackage() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getRefreshCount
public int getRefreshCount()
-
getLinuxServer_host_id
public Integer getLinuxServer_host_id()
-
getLinuxServer
public Server getLinuxServer() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getSpamEmailMessages
public List<SpamMessage> getSpamEmailMessages() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<Integer,SmtpRelay>
-
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,SmtpRelay>- Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
read
public void read(StreamableInput in, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
readin interfaceAOServReadable- Specified by:
readin interfaceAOServStreamable- Specified by:
readin classAOServObject<Integer,SmtpRelay>- Throws:
IOException
-
refresh
public void refresh(long minDuration) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
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
-
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<SmtpRelay>- 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,SmtpRelay>- Throws:
IOException
-
-