Email Answering System
Version 1.0

com.ninecode.email.connector
Class EmailConfigurationData

java.lang.Object
  |
  +--com.ninecode.email.connector.EmailConnectionData
        |
        +--com.ninecode.email.connector.EmailConfigurationData
All Implemented Interfaces:
Cloneable, ConnectionRequestInfo, ConnectionSpec, Serializable
Direct Known Subclasses:
EmailManagedConnectionFactory

public class EmailConfigurationData
extends EmailConnectionData

A bean containing all email configuration data. Configuration data is not the same as connection data. Configuration data is the necessary information required to be able to connect while connection data is only the user data needed to connect. Since this class subclasses the EmailConnectionData class, it contains connection data such as user name and password, but adds such items as servers and ports, which are details the user need not be concerned with.

Author:
Derrick Oswald
See Also:
Serialized Form

Field Summary
protected  boolean mBackgroundThread
          Controls the state of the background thread.
protected  int mBackgroundThreadInitialDelay
          Initial thread startup delay in milliseconds.
protected  int mBackgroundThreadPollDelay
          Holds value of property backgroundThreadPollDelay.
protected  int mBackgroundThreadReconnectDelay
          Reconnection delay in milliseconds.
protected  String mQueueConnectionFactoryResourceReference
          Holds value of property queueConnectionFactoryResourceReference.
protected  String mQueueConnectionReference
          Holds value of property queueConnectionReference.
protected  String mStoreFile
          Holds value of property storeFile.
protected  String mStoreHost
          Holds value of property storeHost.
protected  int mStorePort
          Holds value of property storePort.
protected  String mStoreProtocol
          Holds value of property storeProtocol.
protected  String mTransportFile
          Holds value of property transportFile.
protected  String mTransportHost
          Holds value of property transportHost.
protected  int mTransportPort
          Holds value of property transportPort.
protected  String mTransportProtocol
          Holds value of property transportProtocol.
 
Fields inherited from class com.ninecode.email.connector.EmailConnectionData
mMailProperties, mPropertySupport, mStorePassword, mStoreUserName, mTransportPassword, mTransportUserName
 
Constructor Summary
EmailConfigurationData()
          Creates a new instance of EmailConfigurationData.
EmailConfigurationData(EmailConfigurationData data)
          Creates a new instance of EmailConfigurationData from an existing one.
 
Method Summary
 boolean equals(Object other)
          Returns true if the other object is equal to this one.
 boolean getBackgroundThread()
          Getter for property backgroundThread.
 int getBackgroundThreadInitialDelay()
          Getter for property backgroundThreadInitialDelay.
 int getBackgroundThreadPollDelay()
          Getter for property backgroundThreadPollDelay.
 int getBackgroundThreadReconnectDelay()
          Getter for property backgroundThreadReconnectDelay.
 String getQueueConnectionFactoryResourceReference()
          Getter for property queueConnectionFactoryResourceReference.
 String getQueueConnectionReference()
          Getter for property queueConnectionReference.
 String getStoreFile()
          Getter for property storeFile.
 String getStoreHost()
          Getter for property storeHost.
 int getStorePort()
          Getter for property storePort.
 String getStoreProtocol()
          Getter for property storeProtocol.
 String getTransportFile()
          Getter for property transportFile.
 String getTransportHost()
          Getter for property transportHost.
 int getTransportPort()
          Getter for property transportPort.
 String getTransportProtocol()
          Getter for property transportProtocol.
 int hashCode()
          Returns a hash code for this object.
 void setBackgroundThread(boolean state)
          Setter for property backgroundThread.
 void setBackgroundThread(Boolean state)
          Setter for property backgroundThread.
 void setBackgroundThreadInitialDelay(int delay)
          Setter for property backgroundThreadInitialDelay.
 void setBackgroundThreadInitialDelay(Integer delay)
          Setter for property backgroundThreadInitialDelay.
 void setBackgroundThreadPollDelay(int delay)
          Setter for property backgroundThreadPollDelay.
 void setBackgroundThreadPollDelay(Integer delay)
          Setter for property backgroundThreadPollDelay.
 void setBackgroundThreadReconnectDelay(int delay)
          Setter for property backgroundThreadReconnectDelay.
 void setBackgroundThreadReconnectDelay(Integer delay)
          Setter for property backgroundThreadReconnectDelay.
 void setQueueConnectionFactoryResourceReference(String reference)
          Setter for property queueConnectionFactoryResourceReference.
 void setQueueConnectionReference(String reference)
          Setter for property queueConnectionReference.
 void setStoreFile(String file)
          Setter for property storeFile.
 void setStoreHost(String host)
          Setter for property storeHost.
 void setStorePort(int port)
          Setter for property storePort.
 void setStorePort(Integer port)
          Setter for property storePort.
 void setStoreProtocol(String protocol)
          Setter for property storeProtocol.
 void setTransportFile(String file)
          Setter for property transportFile.
 void setTransportHost(String host)
          Setter for property transportHost.
 void setTransportPort(int port)
          Setter for property transportPort.
 void setTransportPort(Integer port)
          Setter for property storePort.
 void setTransportProtocol(String protocol)
          Setter for property transportProtocol.
 boolean storeEquals(Object other)
          Returns true if the other object has a Store configuration equal to this one.
 String toString()
          Converts this data object into a printable string.
 
Methods inherited from class com.ninecode.email.connector.EmailConnectionData
addPropertyChangeListener, clone, dup, getMailProperties, getPassword, getStorePassword, getStoreUserName, getTransportPassword, getTransportUserName, getUserName, override, removePropertyChangeListener, setMailProperties, setPassword, setStorePassword, setStoreUserName, setTransportPassword, setTransportUserName, setUserName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mTransportProtocol

protected String mTransportProtocol
Holds value of property transportProtocol.


mTransportHost

protected String mTransportHost
Holds value of property transportHost.


mTransportPort

protected int mTransportPort
Holds value of property transportPort.


mTransportFile

protected String mTransportFile
Holds value of property transportFile.


mStoreProtocol

protected String mStoreProtocol
Holds value of property storeProtocol.


mStoreHost

protected String mStoreHost
Holds value of property storeHost.


mStorePort

protected int mStorePort
Holds value of property storePort.


mStoreFile

protected String mStoreFile
Holds value of property storeFile.


mBackgroundThreadPollDelay

protected int mBackgroundThreadPollDelay
Holds value of property backgroundThreadPollDelay.


mBackgroundThread

protected boolean mBackgroundThread
Controls the state of the background thread.


mBackgroundThreadInitialDelay

protected int mBackgroundThreadInitialDelay
Initial thread startup delay in milliseconds.


mBackgroundThreadReconnectDelay

protected int mBackgroundThreadReconnectDelay
Reconnection delay in milliseconds.


mQueueConnectionFactoryResourceReference

protected String mQueueConnectionFactoryResourceReference
Holds value of property queueConnectionFactoryResourceReference.


mQueueConnectionReference

protected String mQueueConnectionReference
Holds value of property queueConnectionReference.

Constructor Detail

EmailConfigurationData

public EmailConfigurationData()
Creates a new instance of EmailConfigurationData. Default values of all properties are provided:
Property Default
transportProtocol smtp
transportHost localhost
transportPort -1
transportFile  
storeProtocol pop3
storeHost localhost
storePort -1
storeFile  
backgroundThreadPollDelay 30000
backgroundThreadInitialDelay 15000
backgroundThreadReconnectDelay 300000
queueConnectionFactoryResourceReference jms/QueueConnectionFactory
queueConnectionReference jms/Inbox
backgroundThread false

The backgroundThread property is set last because it could cause a new Thread to be started, and that will need a fully constructed object.


EmailConfigurationData

public EmailConfigurationData(EmailConfigurationData data)
Creates a new instance of EmailConfigurationData from an existing one. The backgroundThread property is set last because it could cause a new Thread to be started, and that will need a fully constructed object.

Parameters:
data - The configuration data to copy.
Method Detail

equals

public boolean equals(Object other)
Returns true if the other object is equal to this one.

Specified by:
equals in interface ConnectionRequestInfo
Overrides:
equals in class EmailConnectionData
Returns:
true if the other object is equal to this one.

storeEquals

public boolean storeEquals(Object other)
Returns true if the other object has a Store configuration equal to this one. The Transport, background threading, and target queue are not considered in the comparison.

Overrides:
storeEquals in class EmailConnectionData
Returns:
true if the other object has a Store configuration the same as this one.

hashCode

public int hashCode()
Returns a hash code for this object. The hashCode method is required to be implemented by the ConnectionSpec and ConnectionRequestInfo contracts.

Specified by:
hashCode in interface ConnectionRequestInfo
Overrides:
hashCode in class EmailConnectionData
Returns:
The hash code for this object. This will depend on all the properties for this bean.

getTransportProtocol

public String getTransportProtocol()
Getter for property transportProtocol.

Returns:
Value of property transportProtocol.

setTransportProtocol

public void setTransportProtocol(String protocol)
Setter for property transportProtocol. Issues a propertyChange event to registered propertyChangeListeners with a property name of "TransportProtocol".

Parameters:
protocol - New value of property transportProtocol.
Throws:
IllegalArgumentException - if the protocol is null.

getTransportHost

public String getTransportHost()
Getter for property transportHost.

Returns:
Value of property transportHost.

setTransportHost

public void setTransportHost(String host)
Setter for property transportHost. Issues a propertyChange event to registered propertyChangeListeners with a property name of "TransportHost".

Parameters:
host - New value of property transportHost.
Throws:
IllegalArgumentException - if the host is null.

getTransportPort

public int getTransportPort()
Getter for property transportPort.

Returns:
Value of property transportPort.

setTransportPort

public void setTransportPort(Integer port)
Setter for property storePort. This bogus accessor is required for the j2ee reference container since it looks for this signature rather than the correct (primitive argument) one when the configuration property is of type "Integer". Idiots.

Parameters:
port - New value of property storePort.
Throws:
IllegalArgumentException - if the port is not in the range -1 <= port <= 65535.
See Also:
setTransportPort(int)

setTransportPort

public void setTransportPort(int port)
Setter for property transportPort. Issues a propertyChange event to registered propertyChangeListeners with a property name of "TransportPort".

Parameters:
port - New value of property transportPort.
Throws:
IllegalArgumentException - if the port is not in the range -1 <= port <= 65535.

getTransportFile

public String getTransportFile()
Getter for property transportFile.

Returns:
Value of property transportFile.

setTransportFile

public void setTransportFile(String file)
Setter for property transportFile. Issues a propertyChange event to registered propertyChangeListeners with a property name of "TransportFile".

Parameters:
file - New value of property transportFile.
Throws:
IllegalArgumentException - if the file is null.

getStoreProtocol

public String getStoreProtocol()
Getter for property storeProtocol.

Returns:
Value of property storeProtocol.

setStoreProtocol

public void setStoreProtocol(String protocol)
Setter for property storeProtocol. Issues a propertyChange event to registered propertyChangeListeners with a property name of "StoreProtocol".

Parameters:
protocol - New value of property storeProtocol.
Throws:
IllegalArgumentException - if the protocol is null.

getStoreHost

public String getStoreHost()
Getter for property storeHost.

Returns:
Value of property storeHost.

setStoreHost

public void setStoreHost(String host)
Setter for property storeHost. Issues a propertyChange event to registered propertyChangeListeners with a property name of "StoreHost".

Parameters:
host - New value of property storeHost.
Throws:
IllegalArgumentException - if the host is null.

getStorePort

public int getStorePort()
Getter for property storePort.

Returns:
Value of property storePort.

setStorePort

public void setStorePort(Integer port)
Setter for property storePort. This bogus accessor is required for the j2ee reference container since it looks for this signature rather than the correct (primitive argument) one when the configuration property is of type "Integer". Idiots.

Parameters:
port - New value of property storePort.
Throws:
IllegalArgumentException - if the port is not in the range -1 <= port <= 65535.
See Also:
setStorePort(int)

setStorePort

public void setStorePort(int port)
Setter for property storePort. Issues a propertyChange event to registered propertyChangeListeners with a property name of "StorePort".

Parameters:
port - New value of property storePort.
Throws:
IllegalArgumentException - if the port is not in the range -1 <= port <= 65535.

getStoreFile

public String getStoreFile()
Getter for property storeFile.

Returns:
Value of property storeFile.

setStoreFile

public void setStoreFile(String file)
Setter for property storeFile. Issues a propertyChange event to registered propertyChangeListeners with a property name of "StoreFile".

Parameters:
file - New value of property storeFile.
Throws:
IllegalArgumentException - if the file is null.

getBackgroundThreadPollDelay

public int getBackgroundThreadPollDelay()
Getter for property backgroundThreadPollDelay.

Returns:
Value of property backgroundThreadPollDelay.

setBackgroundThreadPollDelay

public void setBackgroundThreadPollDelay(Integer delay)
Setter for property backgroundThreadPollDelay. This bogus accessor is required for the j2ee reference container since it looks for this signature rather than the correct (primitive argument) one when the configuration property is of type "Integer". Idiots.

Parameters:
delay - New value of property backgroundThreadPollDelay.
Throws:
IllegalArgumentException - if the delay is negative.
See Also:
setBackgroundThreadPollDelay(int)

setBackgroundThreadPollDelay

public void setBackgroundThreadPollDelay(int delay)
Setter for property backgroundThreadPollDelay. Issues a propertyChange event to registered propertyChangeListeners with a property name of "BackgroundThreadPollDelay".

Parameters:
delay - New value of property backgroundThreadPollDelay.
Throws:
IllegalArgumentException - if the delay is negative.

getBackgroundThread

public boolean getBackgroundThread()
Getter for property backgroundThread.

Returns:
Value of property backgroundThread.

setBackgroundThread

public void setBackgroundThread(Boolean state)
Setter for property backgroundThread. This bogus accessor is required for the j2ee reference container since it looks for this signature rather than the correct (primitive argument) one when the configuration property is of type "Boolean". Idiots.

Parameters:
state - New value of property backgroundThread.
See Also:
setBackgroundThread(boolean)

setBackgroundThread

public void setBackgroundThread(boolean state)
Setter for property backgroundThread. Issues a propertyChange event to registered propertyChangeListeners with a property name of "BackgroundThread".

Parameters:
state - New value of property backgroundThread.

getBackgroundThreadInitialDelay

public int getBackgroundThreadInitialDelay()
Getter for property backgroundThreadInitialDelay.

Returns:
Value of property backgroundThreadInitialDelay.

setBackgroundThreadInitialDelay

public void setBackgroundThreadInitialDelay(Integer delay)
Setter for property backgroundThreadInitialDelay. This bogus accessor is required for the j2ee reference container since it looks for this signature rather than the correct (primitive argument) one when the configuration property is of type "Integer". Idiots.

Parameters:
delay - New value of property backgroundThreadInitialDelay. Time is milliseconds between thread start and any interaction with the container or other components.
Throws:
IllegalArgumentException - if the delay is negative.
See Also:
setBackgroundThreadInitialDelay(int)

setBackgroundThreadInitialDelay

public void setBackgroundThreadInitialDelay(int delay)
Setter for property backgroundThreadInitialDelay. Issues a propertyChange event to registered propertyChangeListeners with a property name of "BackgroundThreadInitialDelay".

Parameters:
delay - New value of property backgroundThreadInitialDelay. Time is milliseconds between thread start and any interaction with the container or other components.
Throws:
IllegalArgumentException - if the delay is negative.

getBackgroundThreadReconnectDelay

public int getBackgroundThreadReconnectDelay()
Getter for property backgroundThreadReconnectDelay.

Returns:
Value of property backgroundThreadReconnectDelay.

setBackgroundThreadReconnectDelay

public void setBackgroundThreadReconnectDelay(Integer delay)
Setter for property backgroundThreadReconnectDelay. This bogus accessor is required for the j2ee reference container since it looks for this signature rather than the correct (primitive argument) one when the configuration property is of type "Integer". Idiots.

Parameters:
delay - New value of property backgroundThreadReconnectDelay. Time is milliseconds between reconnect attempts in the event of a series of failures that places the thread in a waiting state.
Throws:
IllegalArgumentException - if the delay is negative.
See Also:
setBackgroundThreadReconnectDelay(int)

setBackgroundThreadReconnectDelay

public void setBackgroundThreadReconnectDelay(int delay)
Setter for property backgroundThreadReconnectDelay. Issues a propertyChange event to registered propertyChangeListeners with a property name of "BackgroundThreadReconnectDelay".

Parameters:
delay - New value of property backgroundThreadReconnectDelay. Time is milliseconds between reconnect attempts in the event of a series of failures that places the thread in a waiting state.
Throws:
IllegalArgumentException - if the delay is negative.

getQueueConnectionFactoryResourceReference

public String getQueueConnectionFactoryResourceReference()
Getter for property queueConnectionFactoryResourceReference.

Returns:
Value of property queueConnectionFactoryResourceReference.

setQueueConnectionFactoryResourceReference

public void setQueueConnectionFactoryResourceReference(String reference)
Setter for property queueConnectionFactoryResourceReference. Issues a propertyChange event to registered propertyChangeListeners with a property name of "QueueConnectionFactoryResourceReference".

Parameters:
reference - New value of property queueConnectionFactoryResourceReference.
Throws:
IllegalArgumentException - if the reference is null.

getQueueConnectionReference

public String getQueueConnectionReference()
Getter for property queueConnectionReference.

Returns:
Value of property queueConnectionReference.

setQueueConnectionReference

public void setQueueConnectionReference(String reference)
Setter for property queueConnectionReference. Issues a propertyChange event to registered propertyChangeListeners with a property name of "QueueConnectionReference".

Parameters:
reference - New value of property queueConnectionReference.
Throws:
IllegalArgumentException - if the reference is null.

toString

public String toString()
Converts this data object into a printable string.

Overrides:
toString in class EmailConnectionData
Returns:
The contents of this object as a string.

Email Answering System
Version 1.0

Copyright © 2003 Derrick Oswald. All rights reserved.