Package org.frankframework.filesystem
Class AbstractMailListener<M,A,S extends IMailFileSystem<M,A>>
java.lang.Object
org.frankframework.filesystem.AbstractFileSystemListener<M,S>
org.frankframework.filesystem.AbstractMailListener<M,A,S>
- All Implemented Interfaces:
FrankElement
,HasApplicationContext
,HasName
,HasPhysicalDestination
,IConfigurable
,IHasProcessState<M>
,IListener<M>
,IProvidesMessageBrowsers<M>
,IPullingListener<M>
,IScopeProvider
,NameAware
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
ImapListener
public abstract class AbstractMailListener<M,A,S extends IMailFileSystem<M,A>>
extends AbstractFileSystemListener<M,S>
Implementation of a
AbstractFileSystemListener
that enables a Receiver
to look in a folder
for received mails. When a mail is found, it is moved to an output folder (or
it's deleted), so that it isn't found more then once. A xml string with
information about the mail is passed to the pipeline.
example:
<email>
<recipients>
<recipient type="to">***@nn.nl</recipient>
<recipient type="cc">***@nn.nl</recipient>
</recipients>
<from>***@nn.nl</from>
<subject>this is the subject</subject>
<headers>
<header name="prop1">value of first header property</header>
<header name="prop2">value of second header property</header>
</headers>
<dateTimeSent>2015-11-18T11:40:19.000+0100</dateTimeSent>
<dateTimeReceived>2015-11-18T11:41:04.000+0100</dateTimeReceived>
</email>
- Author:
- Peter Leeuwenburgh, Gerrit van Brakel
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.frankframework.filesystem.AbstractFileSystemListener
AbstractFileSystemListener.IMessageType
-
Field Summary
Fields inherited from class org.frankframework.filesystem.AbstractFileSystemListener
FILENAME_KEY, FILEPATH_KEY, log, ORIGINAL_FILENAME_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractMessage
(RawMessageWrapper<M> rawMessage, Map<String, Object> context) Returns the filename, or the contentsvoid
setMessageType
(AbstractMailListener.MessageType messageType) Determines the contents of the message that is sent to the Pipeline. can be one of:EMAIL
, for an XML containing most relevant information, except the body and the attachmentsCONTENTS
, for the body of the messageMIME
, for the MIME contents of the messageNAME
orPATH
, for an internal handle of mail message, that can be used by a related MailFileSystemSenderHEADER
, for the value of the header matching the searchKey in the message contextvoid
setSimple
(boolean b) Deprecated, for removal: This API element is subject to removal in a future version.void
Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.frankframework.filesystem.AbstractFileSystemListener
afterMessageProcessed, changeProcessState, checkForExistenceOfFolder, closeThread, configure, createFileSystem, extractMessageProperties, getDomain, getMessageBrowser, getPhysicalDestinationName, getRawMessage, getStateFolder, knownProcessStates, openThread, setCharset, setCreateFolders, setDelete, setDisableMessageBrowsers, setErrorFolder, setExcludeWildcard, setFileTimeSensitive, setHoldFolder, setInProcessFolder, setInputFolder, setLogFolder, setMessageIdPropertyKey, setMessageType, setMinStableTime, setName, setNumberOfBackups, setOutputFormat, setOverwrite, setProcessedFolder, setStoreMetadataInSessionKey, setWildcard, start, stop, targetProcessStates
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoader
-
Constructor Details
-
AbstractMailListener
public AbstractMailListener()
-
-
Method Details
-
extractMessage
public Message extractMessage(@Nonnull RawMessageWrapper<M> rawMessage, @Nonnull Map<String, Object> context) throws ListenerExceptionDescription copied from class:AbstractFileSystemListener
Returns the filename, or the contents- Specified by:
extractMessage
in interfaceIListener<M>
- Overrides:
extractMessage
in classAbstractFileSystemListener<M,
S extends IMailFileSystem<M, A>> - Parameters:
rawMessage
- TheRawMessageWrapper
from which to extract theMessage
.context
- Context to populate. Either aPipeLineSession
or aMap
threadContext depending on caller.- Returns:
- input
Message
for adapter. - Throws:
ListenerException
-
setSimple
@Deprecated(since="7.7", forRemoval=true) @ConfigurationWarning("Please use <code>messageType</code> to control the message produced by the listener") public void setSimple(boolean b) Deprecated, for removal: This API element is subject to removal in a future version.when set totrue
, the xml string passed to the pipeline only contains the subject of the mail (to save memory)- Default value
- false
-
setStoreEmailAsStreamInSessionKey
@Deprecated(since="7.5", forRemoval=true) @ConfigurationWarning("Please use <code>messageType=mime</code> and sessionKey originalMessage") public void setStoreEmailAsStreamInSessionKey(String string) Deprecated, for removal: This API element is subject to removal in a future version. -
setMessageType
Determines the contents of the message that is sent to the Pipeline. can be one of:EMAIL
, for an XML containing most relevant information, except the body and the attachmentsCONTENTS
, for the body of the messageMIME
, for the MIME contents of the messageNAME
orPATH
, for an internal handle of mail message, that can be used by a related MailFileSystemSenderHEADER
, for the value of the header matching the searchKey in the message context
- Default value
-