Email Answering System
Version 1.0

com.ninecode.email.connector
Class EmailConnectionData

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

public class EmailConnectionData
extends Object
implements ConnectionSpec, ConnectionRequestInfo, Serializable, Cloneable

Java bean for holding connection info. This information is connection specific rather than configuration specific. We use this same class twice, at the client as a ConnectionSpec and at the server as a ConnectionRequestInfo.

Author:
Derrick Oswald
See Also:
Serialized Form

Field Summary
protected  String mMailProperties
          The current value of mail.XXXX properties.
protected  PropertyChangeSupport mPropertySupport
          Support for bound properties.
protected  String mStorePassword
          The current value of Store password.
protected  String mStoreUserName
          The current value of the Store user name.
protected  String mTransportPassword
          The current value of Transport password.
protected  String mTransportUserName
          The current value of Transport user name.
 
Constructor Summary
EmailConnectionData()
          Creates a new EmailConnectionData.
EmailConnectionData(EmailConnectionData data)
          Creates a new EmailConnectionData object that is a copy of another.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Bound property support.
protected  Object clone()
          Creates and returns a copy of this object.
 EmailConnectionData dup()
          Create a copy of this bean.
 boolean equals(Object other)
          Returns true if the other object is equal to this one.
 String getMailProperties()
          Getter for property MailProperties.
 String getPassword()
          Getter for property password.
 String getStorePassword()
          Getter for property storePassword.
 String getStoreUserName()
          Getter for property storeUserName.
 String getTransportPassword()
          Getter for property transportPassword.
 String getTransportUserName()
          Getter for property Transport username.
 String getUserName()
          Getter for property userName.
 int hashCode()
          Returns a hash code for this object.
 void override(EmailConnectionData data)
          Override this bean's empty properties with that bean's properties.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Bound property support.
 void setMailProperties(String properties)
          Setter for property mailProperties.
 void setPassword(String password)
          Setter for property password.
 void setStorePassword(String password)
          Setter for property storePassword.
 void setStoreUserName(String user)
          Setter for property storeUserName.
 void setTransportPassword(String password)
          Setter for property transportPassword.
 void setTransportUserName(String user)
          Setter for property Transport username.
 void setUserName(String user)
          Setter for property userName.
 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 java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mTransportUserName

protected String mTransportUserName
The current value of Transport user name.


mTransportPassword

protected String mTransportPassword
The current value of Transport password.


mStoreUserName

protected String mStoreUserName
The current value of the Store user name.


mStorePassword

protected String mStorePassword
The current value of Store password.


mMailProperties

protected String mMailProperties
The current value of mail.XXXX properties. The format is a delimiter character at the start and end with each of the property=value settings separated by delimiters, e.g. |mail.from=tobias@linkone.com|mail.smtp.auth=true|

See Also:
EmailProperties

mPropertySupport

protected PropertyChangeSupport mPropertySupport
Support for bound properties.

Constructor Detail

EmailConnectionData

public EmailConnectionData()
Creates a new EmailConnectionData.


EmailConnectionData

public EmailConnectionData(EmailConnectionData data)
Creates a new EmailConnectionData object that is a copy of another.

Method Detail

equals

public boolean equals(Object other)
Returns true if the other object is equal to this one. The equals method is required to be implemented by the ConnectionSpec and ConnectionRequestInfo contracts.

Specified by:
equals in interface ConnectionRequestInfo
Overrides:
equals in class Object
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 mail properties are not considered in the comparison.

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 Object
Returns:
The hash code for this object. This will depend on all the properties for this bean.

clone

protected Object clone()
                throws CloneNotSupportedException
Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:
 x.clone() != x
will be true, and that the expression:
 x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
 x.clone().equals(x)
will be true, this is not an absolute requirement. Copying an object will typically entail creating a new instance of its class, but it also may require copying of internal data structures as well. No constructors are called.

The method clone for class Object performs a specific cloning operation. First, if the class of this object does not implement the interface Cloneable, then a CloneNotSupportedException is thrown. Note that all arrays are considered to implement the interface Cloneable. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned. Thus, this method performs a "shallow copy" of this object, not a "deep copy" operation.

The class Object does not itself implement the interface Cloneable, so calling the clone method on an object whose class is Object will result in throwing an exception at run time. The clone method is implemented by the class Object as a convenient, general utility for subclasses that implement the interface Cloneable, possibly also overriding the clone method, in which case the overriding definition can refer to this utility definition by the call:

 super.clone()

Overrides:
clone in class Object
Returns:
a clone of this instance.
Throws:
CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
OutOfMemoryError - if there is not enough memory.
See Also:
Cloneable

dup

public EmailConnectionData dup()
                        throws ResourceException
Create a copy of this bean.

Returns:
A clone of this bean.
ResourceException

getTransportUserName

public String getTransportUserName()
Getter for property Transport username.

Returns:
Value of property transportUsername.

setTransportUserName

public void setTransportUserName(String user)
Setter for property Transport username.

Parameters:
user - New value of property transportUsername.

getTransportPassword

public String getTransportPassword()
Getter for property transportPassword.

Returns:
Value of property transportPassword.

setTransportPassword

public void setTransportPassword(String password)
Setter for property transportPassword.

Parameters:
password - New value of property transportPassword.

getStoreUserName

public String getStoreUserName()
Getter for property storeUserName.

Returns:
Value of property storeUserName.

setStoreUserName

public void setStoreUserName(String user)
Setter for property storeUserName.

Parameters:
user - New value of property storeUserName.

getStorePassword

public String getStorePassword()
Getter for property storePassword.

Returns:
Value of property storePassword.

setStorePassword

public void setStorePassword(String password)
Setter for property storePassword.

Parameters:
password - New value of property storePassword.

getMailProperties

public String getMailProperties()
Getter for property MailProperties.

Returns:
Value of property MailProperties.

setMailProperties

public void setMailProperties(String properties)
Setter for property mailProperties.


getPassword

public String getPassword()
Getter for property password. Synonym for getTransportPassword.

Returns:
Value of property transportPassword.

setPassword

public void setPassword(String password)
Setter for property password. Synonym for setTransportPassword.

Parameters:
password - New value of property transportPassword.

getUserName

public String getUserName()
Getter for property userName. Synonym for getTransportUserName.

Returns:
Value of property transportUserName.

setUserName

public void setUserName(String user)
Setter for property userName. Synonym for setTransportUserName.

Parameters:
user - New value of property transportUserName.

override

public void override(EmailConnectionData data)
Override this bean's empty properties with that bean's properties. Overriding only takes place if the property has no value.

Parameters:
data - The bean that has data to override this one's.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Bound property support.

Parameters:
listener - The listener to add to the list of PropertyChangeListeners.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Bound property support.

Parameters:
listener - The listener to remove from the list of PropertyChangeListeners.

toString

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

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

Email Answering System
Version 1.0

Copyright © 2003 Derrick Oswald. All rights reserved.