public class EmailConnector extends BaseNotificationConnector
| Modifier and Type | Class and Description |
|---|---|
protected static class |
EmailConnector.CheckConnectionThread
Class to check the connection.
|
protected static class |
EmailConnector.CloseSessionThread
Class to close the session.
|
protected static class |
EmailConnector.ConnectThread
Class to set up connection.
|
protected static class |
EmailConnector.SendThread
Class to send email.
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
password |
protected String |
portString |
protected Properties |
properties |
protected String |
protocol |
protected String |
server |
protected EmailSession |
session |
protected static long |
SESSION_EXPIRATION_MILLISECONDS |
protected long |
sessionExpiration |
protected String |
username |
_rcsidcurrentContext, params| Constructor and Description |
|---|
EmailConnector() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addFindParameterNode(ConfigParams parameters,
String findParameterName,
String findParameterValue) |
protected static void |
addNodeValue(SpecificationNode ds,
String nodeType,
String value) |
protected static void |
addRecord(Map<String,Object> paramMap,
String nodeType,
String toValue,
String fromValue,
String subjectValue,
String bodyValue) |
String |
check()
Test the connection.
|
protected void |
checkConnection() |
void |
connect(ConfigParams configParameters)
Connect.
|
void |
disconnect()
Close the connection.
|
protected static void |
fillInMessageTab(Map<String,Object> paramMap,
Specification ds)
Fill in Velocity context for Metadata tab.
|
protected void |
finalizeConnection() |
protected static void |
gatherRecord(Specification ds,
String seqPrefix,
IPostParameters variableContext,
String nodeType) |
protected void |
getSession() |
protected static void |
handleMessagingException(javax.mail.MessagingException e,
String context)
Handle Messaging exceptions in a consistent global manner
|
void |
notifyOfJobEnd(Specification spec)
Notify of job end.
|
void |
notifyOfJobStopErrorAbort(Specification spec)
Notify of job stop due to error abort.
|
void |
notifyOfJobStopManualAbort(Specification spec)
Notify of job stop due to manual abort.
|
void |
notifyOfJobStopManualPause(Specification spec)
Notify of job stop due to manual pause.
|
void |
notifyOfJobStopRestart(Specification spec)
Notify of job stop due to restart.
|
void |
notifyOfJobStopSchedulePause(Specification spec)
Notify of job stop due to schedule pause.
|
void |
outputConfigurationBody(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
String tabName) |
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
List<String> tabsArray)
Output the configuration header section.
|
protected void |
outputMessageTab(IHTTPOutput out,
Locale locale,
Specification ds,
String tabName,
int connectionSequenceNumber,
int actualSequenceNumber)
Take care of "Message" tab.
|
void |
outputSpecificationBody(IHTTPOutput out,
Locale locale,
Specification ds,
int connectionSequenceNumber,
int actualSequenceNumber,
String tabName)
Output the specification body section.
|
void |
outputSpecificationHeader(IHTTPOutput out,
Locale locale,
Specification ds,
int connectionSequenceNumber,
List<String> tabsArray)
Output the specification header section.
|
void |
poll()
This method is periodically called for all connectors that are connected but not
in active use.
|
String |
processConfigurationPost(IThreadContext threadContext,
IPostParameters variableContext,
ConfigParams parameters)
Process a configuration post.
|
protected String |
processMessageTab(IPostParameters variableContext,
Specification ds,
int connectionSequenceNumber) |
String |
processSpecificationPost(IPostParameters variableContext,
Locale locale,
Specification ds,
int connectionSequenceNumber)
Process a specification post.
|
protected static void |
removeNodes(ConfigParams parameters,
String nodeTypeName) |
protected static void |
removeNodes(Specification ds,
String nodeTypeName) |
protected void |
sendMail(Specification spec,
String nodeType) |
void |
viewConfiguration(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters)
View configuration.
|
void |
viewSpecification(IHTTPOutput out,
Locale locale,
Specification ds,
int connectionSequenceNumber)
View specification.
|
getFormCheckJavascriptMethodName, getFormPresaveCheckJavascriptMethodName, notifyOfJobStop, requestInfoclearThreadContext, deinstall, getConfiguration, install, isConnected, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, processConfigurationPost, setThreadContext, unpack, unpackFixedList, unpackList, viewConfigurationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearThreadContext, deinstall, getConfiguration, install, isConnected, processConfigurationPost, setThreadContextprotected static final long SESSION_EXPIRATION_MILLISECONDS
protected long sessionExpiration
protected String server
protected String portString
protected String username
protected String password
protected String protocol
protected Properties properties
protected EmailSession session
public void connect(ConfigParams configParameters)
connect in interface IConnectorconnect in class BaseConnectorconfigParameters - is the set of configuration parameters, which
in this case describe the root directory.public void disconnect()
throws ManifoldCFException
disconnect in interface IConnectordisconnect in class BaseConnectorManifoldCFExceptionpublic void poll()
throws ManifoldCFException
poll in interface IConnectorpoll in class BaseConnectorManifoldCFExceptionpublic String check() throws ManifoldCFException
check in interface IConnectorcheck in class BaseConnectorManifoldCFExceptionprotected void checkConnection()
throws ManifoldCFException,
ServiceInterruption
protected void getSession()
throws ManifoldCFException,
ServiceInterruption
protected void finalizeConnection()
public void notifyOfJobStopErrorAbort(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobStopErrorAbort in interface INotificationConnectornotifyOfJobStopErrorAbort in class BaseNotificationConnectorspec - is the notification specification.ManifoldCFExceptionServiceInterruptionpublic void notifyOfJobStopManualAbort(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobStopManualAbort in interface INotificationConnectornotifyOfJobStopManualAbort in class BaseNotificationConnectorspec - is the notification specification.ManifoldCFExceptionServiceInterruptionpublic void notifyOfJobStopManualPause(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobStopManualPause in interface INotificationConnectornotifyOfJobStopManualPause in class BaseNotificationConnectorspec - is the notification specification.ManifoldCFExceptionServiceInterruptionpublic void notifyOfJobStopSchedulePause(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobStopSchedulePause in interface INotificationConnectornotifyOfJobStopSchedulePause in class BaseNotificationConnectorspec - is the notification specification.ManifoldCFExceptionServiceInterruptionpublic void notifyOfJobStopRestart(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobStopRestart in interface INotificationConnectornotifyOfJobStopRestart in class BaseNotificationConnectorspec - is the notification specification.ManifoldCFExceptionServiceInterruptionpublic void notifyOfJobEnd(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobEnd in interface INotificationConnectornotifyOfJobEnd in class BaseNotificationConnectorspec - is the notification specification.ManifoldCFExceptionServiceInterruptionprotected void sendMail(Specification spec, String nodeType) throws ManifoldCFException, ServiceInterruption
public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, List<String> tabsArray) throws ManifoldCFException, IOException
outputConfigurationHeader in interface IConnectoroutputConfigurationHeader in class BaseConnectorthreadContext - is the local thread context.out - is the output to which any HTML should be sent.locale - is the desired locale.parameters - are the configuration parameters, as they currently exist, for this connection being configured.tabsArray - is an array of tab names. Add to this array any tab names that are specific to the connector.ManifoldCFExceptionIOExceptionpublic void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName) throws ManifoldCFException, IOException
outputConfigurationBody in interface IConnectoroutputConfigurationBody in class BaseConnectorManifoldCFExceptionIOExceptionpublic String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, ConfigParams parameters) throws ManifoldCFException
processConfigurationPost in class BaseConnectorthreadContext - is the local thread context.variableContext - is the set of variables available from the post, including binary file post information.parameters - are the configuration parameters, as they currently exist, for this connection being configured.ManifoldCFExceptionpublic void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException
viewConfiguration in interface IConnectorviewConfiguration in class BaseConnectorthreadContext - is the local thread context.out - is the output to which any HTML should be sent.parameters - are the configuration parameters, as they currently exist, for
this connection being configured.ManifoldCFExceptionIOExceptionpublic void outputSpecificationHeader(IHTTPOutput out, Locale locale, Specification ds, int connectionSequenceNumber, List<String> tabsArray) throws ManifoldCFException, IOException
outputSpecificationHeader in interface INotificationConnectoroutputSpecificationHeader in class BaseNotificationConnectorout - is the output to which any HTML should be sent.locale - is the locale the output is preferred to be in.ds - is the current document specification for this job.connectionSequenceNumber - is the unique number of this connection within the job.tabsArray - is an array of tab names. Add to this array any tab names that are specific to the connector.ManifoldCFExceptionIOExceptionpublic void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification ds, int connectionSequenceNumber, int actualSequenceNumber, String tabName) throws ManifoldCFException, IOException
outputSpecificationBody in interface INotificationConnectoroutputSpecificationBody in class BaseNotificationConnectorout - is the output to which any HTML should be sent.locale - is the locale the output is preferred to be in.ds - is the current document specification for this job.connectionSequenceNumber - is the unique number of this connection within the job.actualSequenceNumber - is the connection within the job that has currently been selected.tabName - is the current tab name. (actualSequenceNumber, tabName) form a unique tuple within
the job.ManifoldCFExceptionIOExceptionprotected void outputMessageTab(IHTTPOutput out, Locale locale, Specification ds, String tabName, int connectionSequenceNumber, int actualSequenceNumber) throws ManifoldCFException, IOException
ManifoldCFExceptionIOExceptionprotected static void fillInMessageTab(Map<String,Object> paramMap, Specification ds)
protected static void addRecord(Map<String,Object> paramMap, String nodeType, String toValue, String fromValue, String subjectValue, String bodyValue)
public String processSpecificationPost(IPostParameters variableContext, Locale locale, Specification ds, int connectionSequenceNumber) throws ManifoldCFException
processSpecificationPost in interface INotificationConnectorprocessSpecificationPost in class BaseNotificationConnectorvariableContext - contains the post data, including binary file-upload information.locale - is the locale the output is preferred to be in.ds - is the current document specification for this job.connectionSequenceNumber - is the unique number of this connection within the job.ManifoldCFExceptionprotected String processMessageTab(IPostParameters variableContext, Specification ds, int connectionSequenceNumber) throws ManifoldCFException
ManifoldCFExceptionprotected static void gatherRecord(Specification ds, String seqPrefix, IPostParameters variableContext, String nodeType)
public void viewSpecification(IHTTPOutput out, Locale locale, Specification ds, int connectionSequenceNumber) throws ManifoldCFException, IOException
viewSpecification in interface INotificationConnectorviewSpecification in class BaseNotificationConnectorout - is the output to which any HTML should be sent.locale - is the locale the output is preferred to be in.ds - is the current document specification for this job.connectionSequenceNumber - is the unique number of this connection within the job.ManifoldCFExceptionIOExceptionprotected static void addFindParameterNode(ConfigParams parameters, String findParameterName, String findParameterValue)
protected static void removeNodes(ConfigParams parameters, String nodeTypeName)
protected static void removeNodes(Specification ds, String nodeTypeName)
protected static void addNodeValue(SpecificationNode ds, String nodeType, String value)
protected static void handleMessagingException(javax.mail.MessagingException e,
String context)
throws ManifoldCFException,
ServiceInterruption