public class EmailConnector
extends org.apache.manifoldcf.crawler.notifications.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 java.lang.String |
password |
protected java.lang.String |
portString |
protected java.util.Properties |
properties |
protected java.lang.String |
server |
protected EmailSession |
session |
protected static long |
SESSION_EXPIRATION_MILLISECONDS |
protected long |
sessionExpiration |
protected java.lang.String |
username |
| Constructor and Description |
|---|
EmailConnector() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addFindParameterNode(org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
java.lang.String findParameterName,
java.lang.String findParameterValue) |
protected static void |
addNodeValue(org.apache.manifoldcf.core.interfaces.SpecificationNode ds,
java.lang.String nodeType,
java.lang.String value) |
protected static void |
addRecord(java.util.Map<java.lang.String,java.lang.Object> paramMap,
java.lang.String nodeType,
java.lang.String toValue,
java.lang.String fromValue,
java.lang.String subjectValue,
java.lang.String bodyValue) |
java.lang.String |
check()
Test the connection.
|
protected void |
checkConnection() |
void |
connect(org.apache.manifoldcf.core.interfaces.ConfigParams configParameters)
Connect.
|
void |
disconnect()
Close the connection.
|
protected static void |
fillInMessageTab(java.util.Map<java.lang.String,java.lang.Object> paramMap,
org.apache.manifoldcf.core.interfaces.Specification ds)
Fill in Velocity context for Metadata tab.
|
protected void |
finalizeConnection() |
protected static void |
gatherRecord(org.apache.manifoldcf.core.interfaces.Specification ds,
java.lang.String seqPrefix,
org.apache.manifoldcf.core.interfaces.IPostParameters variableContext,
java.lang.String nodeType) |
protected void |
getSession() |
protected static void |
handleMessagingException(javax.mail.MessagingException e,
java.lang.String context)
Handle Messaging exceptions in a consistent global manner
|
void |
notifyOfJobEnd(org.apache.manifoldcf.core.interfaces.Specification spec)
Notify of job end.
|
void |
notifyOfJobStopErrorAbort(org.apache.manifoldcf.core.interfaces.Specification spec)
Notify of job stop due to error abort.
|
void |
notifyOfJobStopManualAbort(org.apache.manifoldcf.core.interfaces.Specification spec)
Notify of job stop due to manual abort.
|
void |
notifyOfJobStopManualPause(org.apache.manifoldcf.core.interfaces.Specification spec)
Notify of job stop due to manual pause.
|
void |
notifyOfJobStopRestart(org.apache.manifoldcf.core.interfaces.Specification spec)
Notify of job stop due to restart.
|
void |
notifyOfJobStopSchedulePause(org.apache.manifoldcf.core.interfaces.Specification spec)
Notify of job stop due to schedule pause.
|
void |
outputConfigurationBody(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
java.lang.String tabName) |
void |
outputConfigurationHeader(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
java.util.List<java.lang.String> tabsArray)
Output the configuration header section.
|
protected void |
outputMessageTab(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.Specification ds,
java.lang.String tabName,
int connectionSequenceNumber,
int actualSequenceNumber)
Take care of "Message" tab.
|
void |
outputSpecificationBody(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.Specification ds,
int connectionSequenceNumber,
int actualSequenceNumber,
java.lang.String tabName)
Output the specification body section.
|
void |
outputSpecificationHeader(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.Specification ds,
int connectionSequenceNumber,
java.util.List<java.lang.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.
|
java.lang.String |
processConfigurationPost(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
org.apache.manifoldcf.core.interfaces.IPostParameters variableContext,
org.apache.manifoldcf.core.interfaces.ConfigParams parameters)
Process a configuration post.
|
protected java.lang.String |
processMessageTab(org.apache.manifoldcf.core.interfaces.IPostParameters variableContext,
org.apache.manifoldcf.core.interfaces.Specification ds,
int connectionSequenceNumber) |
java.lang.String |
processSpecificationPost(org.apache.manifoldcf.core.interfaces.IPostParameters variableContext,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.Specification ds,
int connectionSequenceNumber)
Process a specification post.
|
protected static void |
removeNodes(org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
java.lang.String nodeTypeName) |
protected static void |
removeNodes(org.apache.manifoldcf.core.interfaces.Specification ds,
java.lang.String nodeTypeName) |
protected void |
sendMail(org.apache.manifoldcf.core.interfaces.Specification spec,
java.lang.String nodeType) |
void |
viewConfiguration(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.ConfigParams parameters)
View configuration.
|
void |
viewSpecification(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.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, viewConfigurationprotected static final long SESSION_EXPIRATION_MILLISECONDS
protected long sessionExpiration
protected java.lang.String server
protected java.lang.String portString
protected java.lang.String username
protected java.lang.String password
protected java.util.Properties properties
protected EmailSession session
public void connect(org.apache.manifoldcf.core.interfaces.ConfigParams configParameters)
connect in interface org.apache.manifoldcf.core.interfaces.IConnectorconnect in class org.apache.manifoldcf.core.connector.BaseConnectorconfigParameters - is the set of configuration parameters, which
in this case describe the root directory.public void disconnect()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
disconnect in interface org.apache.manifoldcf.core.interfaces.IConnectordisconnect in class org.apache.manifoldcf.core.connector.BaseConnectororg.apache.manifoldcf.core.interfaces.ManifoldCFExceptionpublic void poll()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
poll in interface org.apache.manifoldcf.core.interfaces.IConnectorpoll in class org.apache.manifoldcf.core.connector.BaseConnectororg.apache.manifoldcf.core.interfaces.ManifoldCFExceptionpublic java.lang.String check()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
check in interface org.apache.manifoldcf.core.interfaces.IConnectorcheck in class org.apache.manifoldcf.core.connector.BaseConnectororg.apache.manifoldcf.core.interfaces.ManifoldCFExceptionprotected void checkConnection()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionprotected void getSession()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionprotected void finalizeConnection()
public void notifyOfJobStopErrorAbort(org.apache.manifoldcf.core.interfaces.Specification spec)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
notifyOfJobStopErrorAbort in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectornotifyOfJobStopErrorAbort in class org.apache.manifoldcf.crawler.notifications.BaseNotificationConnectorspec - is the notification specification.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void notifyOfJobStopManualAbort(org.apache.manifoldcf.core.interfaces.Specification spec)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
notifyOfJobStopManualAbort in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectornotifyOfJobStopManualAbort in class org.apache.manifoldcf.crawler.notifications.BaseNotificationConnectorspec - is the notification specification.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void notifyOfJobStopManualPause(org.apache.manifoldcf.core.interfaces.Specification spec)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
notifyOfJobStopManualPause in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectornotifyOfJobStopManualPause in class org.apache.manifoldcf.crawler.notifications.BaseNotificationConnectorspec - is the notification specification.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void notifyOfJobStopSchedulePause(org.apache.manifoldcf.core.interfaces.Specification spec)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
notifyOfJobStopSchedulePause in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectornotifyOfJobStopSchedulePause in class org.apache.manifoldcf.crawler.notifications.BaseNotificationConnectorspec - is the notification specification.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void notifyOfJobStopRestart(org.apache.manifoldcf.core.interfaces.Specification spec)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
notifyOfJobStopRestart in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectornotifyOfJobStopRestart in class org.apache.manifoldcf.crawler.notifications.BaseNotificationConnectorspec - is the notification specification.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void notifyOfJobEnd(org.apache.manifoldcf.core.interfaces.Specification spec)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
notifyOfJobEnd in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectornotifyOfJobEnd in class org.apache.manifoldcf.crawler.notifications.BaseNotificationConnectorspec - is the notification specification.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionprotected void sendMail(org.apache.manifoldcf.core.interfaces.Specification spec,
java.lang.String nodeType)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void outputConfigurationHeader(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
java.util.List<java.lang.String> tabsArray)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
java.io.IOException
outputConfigurationHeader in interface org.apache.manifoldcf.core.interfaces.IConnectoroutputConfigurationHeader in class org.apache.manifoldcf.core.connector.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.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOExceptionpublic void outputConfigurationBody(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
java.lang.String tabName)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
java.io.IOException
outputConfigurationBody in interface org.apache.manifoldcf.core.interfaces.IConnectoroutputConfigurationBody in class org.apache.manifoldcf.core.connector.BaseConnectororg.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOExceptionpublic java.lang.String processConfigurationPost(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
org.apache.manifoldcf.core.interfaces.IPostParameters variableContext,
org.apache.manifoldcf.core.interfaces.ConfigParams parameters)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
processConfigurationPost in class org.apache.manifoldcf.core.connector.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.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionpublic void viewConfiguration(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.ConfigParams parameters)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
java.io.IOException
viewConfiguration in interface org.apache.manifoldcf.core.interfaces.IConnectorviewConfiguration in class org.apache.manifoldcf.core.connector.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.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOExceptionpublic void outputSpecificationHeader(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.Specification ds,
int connectionSequenceNumber,
java.util.List<java.lang.String> tabsArray)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
java.io.IOException
outputSpecificationHeader in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectoroutputSpecificationHeader in class org.apache.manifoldcf.crawler.notifications.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.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOExceptionpublic void outputSpecificationBody(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.Specification ds,
int connectionSequenceNumber,
int actualSequenceNumber,
java.lang.String tabName)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
java.io.IOException
outputSpecificationBody in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectoroutputSpecificationBody in class org.apache.manifoldcf.crawler.notifications.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.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOExceptionprotected void outputMessageTab(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.Specification ds,
java.lang.String tabName,
int connectionSequenceNumber,
int actualSequenceNumber)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
java.io.IOException
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOExceptionprotected static void fillInMessageTab(java.util.Map<java.lang.String,java.lang.Object> paramMap,
org.apache.manifoldcf.core.interfaces.Specification ds)
protected static void addRecord(java.util.Map<java.lang.String,java.lang.Object> paramMap,
java.lang.String nodeType,
java.lang.String toValue,
java.lang.String fromValue,
java.lang.String subjectValue,
java.lang.String bodyValue)
public java.lang.String processSpecificationPost(org.apache.manifoldcf.core.interfaces.IPostParameters variableContext,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.Specification ds,
int connectionSequenceNumber)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
processSpecificationPost in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectorprocessSpecificationPost in class org.apache.manifoldcf.crawler.notifications.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.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionprotected java.lang.String processMessageTab(org.apache.manifoldcf.core.interfaces.IPostParameters variableContext,
org.apache.manifoldcf.core.interfaces.Specification ds,
int connectionSequenceNumber)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionprotected static void gatherRecord(org.apache.manifoldcf.core.interfaces.Specification ds,
java.lang.String seqPrefix,
org.apache.manifoldcf.core.interfaces.IPostParameters variableContext,
java.lang.String nodeType)
public void viewSpecification(org.apache.manifoldcf.core.interfaces.IHTTPOutput out,
java.util.Locale locale,
org.apache.manifoldcf.core.interfaces.Specification ds,
int connectionSequenceNumber)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
java.io.IOException
viewSpecification in interface org.apache.manifoldcf.crawler.interfaces.INotificationConnectorviewSpecification in class org.apache.manifoldcf.crawler.notifications.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.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOExceptionprotected static void addFindParameterNode(org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
java.lang.String findParameterName,
java.lang.String findParameterValue)
protected static void removeNodes(org.apache.manifoldcf.core.interfaces.ConfigParams parameters,
java.lang.String nodeTypeName)
protected static void removeNodes(org.apache.manifoldcf.core.interfaces.Specification ds,
java.lang.String nodeTypeName)
protected static void addNodeValue(org.apache.manifoldcf.core.interfaces.SpecificationNode ds,
java.lang.String nodeType,
java.lang.String value)
protected static void handleMessagingException(javax.mail.MessagingException e,
java.lang.String context)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException,
org.apache.manifoldcf.agents.interfaces.ServiceInterruption
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption