|
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.EmailInteraction
A Common Client Interface interaction to an underlying email system.
Field Summary | |
protected EmailConnection |
mConnection
The connection that created this interacation. |
protected Integer |
mPollDelay
Cached poll delay. |
protected ResourceWarning |
mWarning
The first warning in the chain. |
Constructor Summary | |
EmailInteraction()
Create a new instance of an EmailInteraction. |
Method Summary | |
protected void |
chainWarning(ResourceWarning warning)
Add a warning onto the chain. |
protected void |
checkConnection()
Check the connection associated with this interaction. |
protected void |
checkForMe(Session session,
Address[] recipients)
Test to eliminate sending to our own self. |
void |
clearWarnings()
Clears all the warning reported by this Interaction instance. |
void |
close()
Closes the current Interaction and release all the resources held for this instance by the resource adapter. |
Record |
execute(InteractionSpec ispec,
Record record)
Executes an interaction represented by the InteractionSpec. |
boolean |
execute(InteractionSpec ispec,
Record input,
Record output)
Executes an interaction represented by the InteractionSpec. |
Connection |
getConnection()
Gets the Connection associated with the Interaction. |
protected MimeMessage |
getMessage(Record record)
|
ResourceWarning |
getWarnings()
Gets the first ResourceWarning from the chain of warnings associated with this Interaction instance. |
protected void |
setConnection(EmailConnection connection)
Sets the connection associated with this interaction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EmailConnection mConnection
protected ResourceWarning mWarning
protected Integer mPollDelay
Constructor Detail |
public EmailInteraction()
Method Detail |
protected MimeMessage getMessage(Record record) throws ResourceException
ResourceException
protected void chainWarning(ResourceWarning warning)
protected void checkForMe(Session session, Address[] recipients) throws ResourceException
session
- The mail session.recipients
- The list of recipients to check.
ResourceException
- if there is a match between the local
address and any recipient.protected void setConnection(EmailConnection connection)
connection
- The connection to associate with this Interaction.protected void checkConnection() throws ResourceException
ResourceException
- If this is a closed interaction.public void clearWarnings() throws ResourceException
clearWarnings
in interface Interaction
ResourceException
- Failed to clear ResourceWarnings associated
with Interaction.public void close() throws ResourceException
close
in interface Interaction
ResourceException
- Failed to close the Interaction instance.
Invoking close on an already closed Interaction should also throw
this exception.public Record execute(InteractionSpec ispec, Record record) throws ResourceException
execute
in interface Interaction
ispec
- - InteractionSpec representing a target EIS data/function
module.
ResourceException
- Exception if execute operation fails.
Examples of error cases are:
Resource adapter internal, EIS-specific or communication error.
Invalid specification of an InteractionSpec or input record structure.
Errors in use of input Record or creation of an output Record.
Invalid connection associated with this Interaction
NotSupportedException
- Operation not supported.public boolean execute(InteractionSpec ispec, Record input, Record output) throws ResourceException
execute
in interface Interaction
ispec
- - InteractionSpec representing a target EIS data/function
module.input
- Input Record.output
- Output Record.
true
if execution of the EIS function has been
successful and output Record has been updated;
false
otherwise
ResourceException
- Exception if execute operation fails.
Examples of error cases are:
Resource adapter internal, EIS-specific or communication error.
Invalid specification of an InteractionSpec, input or output record structure.
Errors in use of input or output Record.
Invalid connection associated with this Interaction.
NotSupportedException
- Operation not supported.public Connection getConnection()
getConnection
in interface Interaction
Note: This will be null
if the interaction has been
closed, although this is not mentioned in the API. The other alternative
would be to throw a ResourceException
since that is the
defined behaviour for other operations on a closed interaction.
public ResourceWarning getWarnings() throws ResourceException
getWarnings
in interface Interaction
ResourceException
- Failed to get ResourceWarnings associated
with Interaction.
|
Email Answering System Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |