|
Email Answering System Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ninecode.email.connector.EmailSource
Encapsulation of all the unique things for a specific Source Configuration.
This currently contains the background thread that performs background
polling and provides synchronized access to the Store, if the store cannot
be opened (for read/write) by two agents at the same time
(which is the case with my pop3 provider).
These objects should only be created for unique 'Store' configurations.
There is also a reference to a EmailConfigurationData object that is
storeEquals()
to any other configuration that shares this
EmailSource
, and this is used in the equals()
method to determine if this Source is equal (storeEquals()
)
to any other.
Field Summary | |
protected EmailConfigurationData |
mConfigurationData
Holds value of property configurationData. |
protected static Message[] |
mEmpty
Value to be returned when there are no messages. |
protected PrintWriter |
mPrintWriter
The logging output stream. |
protected Session |
mSession
The session object for this source. |
protected Store |
mStore
Holds value of property store. |
protected Thread |
mThread
Holds value of property thread. |
Constructor Summary | |
EmailSource(EmailConfigurationData data)
Creates a new instance of EmailSource |
Method Summary | |
protected Store |
connectStore()
Connect to the store. |
protected void |
disconnectStore()
Disconnect the Store. |
boolean |
equals(Object other)
Returns true if the other object is equal to this one. |
EmailConfigurationData |
getConfigurationData()
Getter for property configurationData. |
Message[] |
getMessages()
|
protected Session |
getSession()
Get the session associated with this connection. |
Store |
getStore()
Get the email store. |
Thread |
getThread()
Getter for property thread. |
int |
hashCode()
Returns a hash code for this object. |
protected Message[] |
pickleMessages(Message[] messages)
|
void |
setConfigurationData(EmailConfigurationData configurationData)
Setter for property configurationData. |
protected void |
setSession(Session session)
Set the session associated with this connection. |
void |
setStore(Store store)
Setter for property store. |
void |
setThread(Thread thread)
Setter for property thread. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EmailConfigurationData mConfigurationData
protected Thread mThread
protected Session mSession
protected Store mStore
protected PrintWriter mPrintWriter
protected static Message[] mEmpty
Constructor Detail |
public EmailSource(EmailConfigurationData data)
Method Detail |
public EmailConfigurationData getConfigurationData()
public void setConfigurationData(EmailConfigurationData configurationData)
configurationData
- New value of property configurationData.public Thread getThread()
public void setThread(Thread thread)
thread
- New value of property thread.protected Session getSession()
protected void setSession(Session session)
session
- The new session object.protected Store connectStore() throws ResourceException
ResourceException
- If a problem occurs, examples are:
getStoreProtocol()
protected void disconnectStore() throws ResourceException
ResourceException
- If the close fails.public Store getStore() throws ResourceException
ResourceException
- if any underlying adapter error occurs.public void setStore(Store store)
store
- New value of property store.protected Message[] pickleMessages(Message[] messages) throws MessagingException
MessagingException
public Message[] getMessages() throws MessagingException, ResourceException
MessagingException
ResourceException
public boolean equals(Object other)
true
if the other object is equal to this one.
The equals method is required to hash multiple threads correctly
based on configuration data. Only the storeEquals()
method is considered.
equals
in class Object
true
if the other object is equal to this one.public int hashCode()
hashCode
in class Object
|
Email Answering System Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |