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 |
_rcsid
currentContext, 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, requestInfo
clearThreadContext, deinstall, getConfiguration, install, isConnected, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, processConfigurationPost, setThreadContext, unpack, unpackFixedList, unpackList, viewConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearThreadContext, deinstall, getConfiguration, install, isConnected, processConfigurationPost, setThreadContext
protected 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 IConnector
connect
in class BaseConnector
configParameters
- is the set of configuration parameters, which
in this case describe the root directory.public void disconnect() throws ManifoldCFException
disconnect
in interface IConnector
disconnect
in class BaseConnector
ManifoldCFException
public void poll() throws ManifoldCFException
poll
in interface IConnector
poll
in class BaseConnector
ManifoldCFException
public String check() throws ManifoldCFException
check
in interface IConnector
check
in class BaseConnector
ManifoldCFException
protected 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 INotificationConnector
notifyOfJobStopErrorAbort
in class BaseNotificationConnector
spec
- is the notification specification.ManifoldCFException
ServiceInterruption
public void notifyOfJobStopManualAbort(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobStopManualAbort
in interface INotificationConnector
notifyOfJobStopManualAbort
in class BaseNotificationConnector
spec
- is the notification specification.ManifoldCFException
ServiceInterruption
public void notifyOfJobStopManualPause(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobStopManualPause
in interface INotificationConnector
notifyOfJobStopManualPause
in class BaseNotificationConnector
spec
- is the notification specification.ManifoldCFException
ServiceInterruption
public void notifyOfJobStopSchedulePause(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobStopSchedulePause
in interface INotificationConnector
notifyOfJobStopSchedulePause
in class BaseNotificationConnector
spec
- is the notification specification.ManifoldCFException
ServiceInterruption
public void notifyOfJobStopRestart(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobStopRestart
in interface INotificationConnector
notifyOfJobStopRestart
in class BaseNotificationConnector
spec
- is the notification specification.ManifoldCFException
ServiceInterruption
public void notifyOfJobEnd(Specification spec) throws ManifoldCFException, ServiceInterruption
notifyOfJobEnd
in interface INotificationConnector
notifyOfJobEnd
in class BaseNotificationConnector
spec
- is the notification specification.ManifoldCFException
ServiceInterruption
protected 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 IConnector
outputConfigurationHeader
in class BaseConnector
threadContext
- 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.ManifoldCFException
IOException
public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName) throws ManifoldCFException, IOException
outputConfigurationBody
in interface IConnector
outputConfigurationBody
in class BaseConnector
ManifoldCFException
IOException
public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, ConfigParams parameters) throws ManifoldCFException
processConfigurationPost
in class BaseConnector
threadContext
- 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.ManifoldCFException
public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException
viewConfiguration
in interface IConnector
viewConfiguration
in class BaseConnector
threadContext
- 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.ManifoldCFException
IOException
public void outputSpecificationHeader(IHTTPOutput out, Locale locale, Specification ds, int connectionSequenceNumber, List<String> tabsArray) throws ManifoldCFException, IOException
outputSpecificationHeader
in interface INotificationConnector
outputSpecificationHeader
in class BaseNotificationConnector
out
- 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.ManifoldCFException
IOException
public void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification ds, int connectionSequenceNumber, int actualSequenceNumber, String tabName) throws ManifoldCFException, IOException
outputSpecificationBody
in interface INotificationConnector
outputSpecificationBody
in class BaseNotificationConnector
out
- 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.ManifoldCFException
IOException
protected void outputMessageTab(IHTTPOutput out, Locale locale, Specification ds, String tabName, int connectionSequenceNumber, int actualSequenceNumber) throws ManifoldCFException, IOException
ManifoldCFException
IOException
protected 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 INotificationConnector
processSpecificationPost
in class BaseNotificationConnector
variableContext
- 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.ManifoldCFException
protected String processMessageTab(IPostParameters variableContext, Specification ds, int connectionSequenceNumber) throws ManifoldCFException
ManifoldCFException
protected 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 INotificationConnector
viewSpecification
in class BaseNotificationConnector
out
- 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.ManifoldCFException
IOException
protected 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