public class JavamailInputNode extends Node
Node
used to fetch data from a JavaMail compatible message store. With the JavaMail RI
store implementations this enables access to IMAP and POP3 message stores. Third-party providers
may allow access to other messaging systems using the same API.
As this node is a data source it must not have a predecessor.
Node.Cardinality
Modifier and Type | Field and Description |
---|---|
static String |
ALL_PARTS
Path selector to select everything.
|
Constructor and Description |
---|
JavamailInputNode() |
Modifier and Type | Method and Description |
---|---|
String |
getFolderName() |
String |
getHostName() |
long |
getImapMessageUID() |
Node.Cardinality |
getInputCardinality()
Return the input cardinality of this node, i.e.
|
javax.mail.search.SearchTerm |
getMessageFilter()
Get the message filter.
|
String |
getPassword() |
String |
getPathSelector() |
int |
getPort()
Get the port number to use.
|
Properties |
getSessionProperties()
Get the session properties.
|
String |
getStoreProtocol() |
String |
getUsername() |
String |
getWorkerClassName()
Return the node's associated
NodeWorker full qualified class's
name. |
boolean |
isAllowOnlyOneMessage()
Get whether to allow just one message to match the filter.
|
boolean |
isIgnoreOriginalMimeTypes() |
boolean |
isUnpackMultipart() |
void |
setAllowOnlyOneMessage(boolean allowOnlyOneMessage)
Set whether to allow just one message to match the filter.
|
void |
setFolderName(String folderName)
Set the folder name from which to retrieve the message.
|
void |
setHostName(String hostName)
Set host name of the server hosting the message store.
|
void |
setIgnoreOriginalMimeTypes(boolean ignoreOriginalMimeTypes)
Set whether the original MIME-type information should be ignored.
|
void |
setImapMessageUID(long imapMessageUID)
Set the UID of an IMAP message to select.
|
void |
setMessageFilter(javax.mail.search.SearchTerm messageFilter)
Set the message filter.
|
void |
setPassword(String password)
Set the password corresponding to the user account
|
void |
setPathSelector(String pathSelector)
Set path selector of the message parts to include.
|
void |
setPort(int port)
Set the port number to use.
|
void |
setSessionProperties(Properties sessionProperties)
Set the JavaMail session properties.
|
void |
setStoreProtocol(String storeProtocol)
Set the store protocol to use.
|
void |
setUnpackMultipart(boolean unpackMultipart)
Set this flag to indicate whether multipart/* parts of a message are decomposed into
individual streams (
true ) or forwarded as a whole(false ). |
void |
setUsername(String username)
Set the user name used for authentication with the message store..
|
addTransportReceiver, appendSuccessor, apply, equals, getJob, getOutputCardinality, getPredecessors, getSubsidiaryNodes, getSuccessors, getTransportSender, getUUID, hashCode, initialize, prependPredecessor, remove, validateConfiguration
public static final String ALL_PARTS
public String getWorkerClassName()
Node
Return the node's associated
NodeWorker
full qualified class's
name. By default, the worker class name is
This behavior can be overridden in concrete subclasses.
getWorkerClassName
in class Node
public Node.Cardinality getInputCardinality()
Node
getInputCardinality
in class Node
Node.Cardinality#NONE
as this node accepts no input bundlespublic Properties getSessionProperties()
public void setSessionProperties(Properties sessionProperties)
sessionProperties
- properties of the session when retrieving messagesSession
public String getFolderName()
public void setFolderName(String folderName)
Set the folder name from which to retrieve the message.
Default value: INBOX
folderName
- a folder namepublic String getStoreProtocol()
IMAP
, POP3
, …).public void setStoreProtocol(String storeProtocol)
imap
(default value) and pop3
.storeProtocol
- the protocol to access the message store.public String getHostName()
public void setHostName(String hostName)
hostName
- a host namepublic String getPassword()
public void setPassword(String password)
password
- the user passwordsetUsername(String)
public int getPort()
public void setPort(int port)
Set the port number to use.
Default value: -1
, that means to use the standard port for the given protocol
port
- a port numbersetStoreProtocol(String)
public String getUsername()
public void setUsername(String username)
username
- a user namepublic javax.mail.search.SearchTerm getMessageFilter()
null
)public void setMessageFilter(javax.mail.search.SearchTerm messageFilter)
Set the message filter. This message filter used to identify the message(s) to be retrieved.
Implementation note: This filter must not be used in combination with an
IMAP message UID
Default value: null
messageFilter
- filter for messages to be retrievedSearchTerm
,
Folder.search(SearchTerm)
public boolean isAllowOnlyOneMessage()
true
iff at most one message must match the filter.public void setAllowOnlyOneMessage(boolean allowOnlyOneMessage)
Set whether to allow just one message to match the filter.
Make sure that exactly one message is matched by the search filter. As there is no portable
(across store implementations) unique message identifier, a combination of message headers must
be used, to uniquely identify a message. Setting this flag to true
ensures that
exactly one message is matched. If more than one message matches the
message filter
, the job is aborted.
Default value: false
allowOnlyOneMessage
- flag if exactly one message is allowed to match the filterpublic String getPathSelector()
public void setPathSelector(String pathSelector)
Set path selector of the message parts to include.
Message parts are structured in a virtual path of the form
i0/i1/i2/…
with in
denoting the zero-based index of the part within the message structure.
i0
denotes the message number, i.e. the index within the list of
matched messages, itself. Please note that this path structure is purely artificial.
The path numbering is not, in any way, reflected in the MIME stream.
Shell-like wildcards may be used to select more than one part, however, this implementation is limited to just one path selector.
Examples:
0/2
0/*
*
(or set the path selector to null
)Default value: select all messages.
pathSelector
- selector of message parts to includepublic long getImapMessageUID()
public void setImapMessageUID(long imapMessageUID)
imap
.imapMessageUID
- the UID of an IMAP messagepublic boolean isIgnoreOriginalMimeTypes()
public void setIgnoreOriginalMimeTypes(boolean ignoreOriginalMimeTypes)
Set whether the original MIME-type information should be ignored.
This flag indicates whether the original MIME-type information from any MIME-encoded messages
should be mistrusted. If set to true
, all MIME types are set to
StreamDescriptor.UNKNOWN_MIME_TYPE
("unknown") and the original MIME type information
is propagated using the property "PURPORTED_MIME_TYPE". This option can be used to let the
StreamAnalysisNode
determine the actual MIME types in
cases when the purported information is unreliable.
An exception from the mistrust are the multipart/*, text/* and message/* types—for those types the information must be trusted.
Default value:true
as the original information is usually rather unreliable.ignoreOriginalMimeTypes
- flag if or if not to ignore the original MIME typpublic boolean isUnpackMultipart()
public void setUnpackMultipart(boolean unpackMultipart)
Set this flag to indicate whether multipart/* parts of a message are decomposed into
individual streams (true
) or forwarded as a whole(false
).
Default value: false
unpackMultipart
- flag if or if not to unpack multipart/* partsCopyright © 2017 levigo holding gmbh. All rights reserved.