Class JavamailInputNode


  • public class JavamailInputNode
    extends Node
    A 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.

    • Constructor Detail

      • JavamailInputNode

        public JavamailInputNode()
    • Method Detail

      • getWorkerClassName

        public String getWorkerClassName()
        Description copied from class: Node
        Return the node's associated com.levigo.jadice.server.core.NodeWorker full qualified class's name. By default, the worker class name is
        • The same as the node name with the trailing "Node" replaced by "Worker" if the node name ends in "Node"
        • The node class name with an appended "Worker" otherwise.
        The package name of the worker class is the name of the Node's package with an appended ".worker".

        This behavior can be overridden in concrete subclasses.

        Overrides:
        getWorkerClassName in class Node
        Returns:
        the full qualified class name of the worker of this node.
      • getInputCardinality

        public Node.Cardinality getInputCardinality()
        Description copied from class: Node
        Return the input cardinality of this node, i.e. how many bundles (not streams!) it expects to process. By default, nodes are "pipe-style", i.e. one input, one output.
        Overrides:
        getInputCardinality in class Node
        Returns:
        Node.Cardinality.NONE as this node accepts no input bundles
      • getSessionProperties

        public Properties getSessionProperties()
        Get the session properties.
        Returns:
        the session properties
      • setSessionProperties

        public void setSessionProperties​(Properties sessionProperties)
        Set the JavaMail session properties.
        Parameters:
        sessionProperties - properties of the session when retrieving messages
        See Also:
        Session
      • getFolderName

        public String getFolderName()
        Returns:
        the folder name
      • setFolderName

        public void setFolderName​(String folderName)
        Set the folder name from which to retrieve the message.

        Default value: INBOX

        Parameters:
        folderName - a folder name
      • getStoreProtocol

        public String getStoreProtocol()
        Returns:
        the message store protocol (e.g. IMAP, POP3, …).
      • setStoreProtocol

        public void setStoreProtocol​(String storeProtocol)
        Set the store protocol to use. With the reference implementation allowed values include imap (default value) and pop3.
        Parameters:
        storeProtocol - the protocol to access the message store.
      • getHostName

        public String getHostName()
        Returns:
        host name of the server hosting the message store
      • setHostName

        public void setHostName​(String hostName)
        Set host name of the server hosting the message store.
        Parameters:
        hostName - a host name
      • getPassword

        public String getPassword()
        Returns:
        the password that is used for authentication.
      • setPassword

        public void setPassword​(String password)
        Set the password corresponding to the user account
        Parameters:
        password - the user password
        See Also:
        setUsername(String)
      • getPort

        public int getPort()
        Get the port number to use.
        Returns:
        the port number
      • setPort

        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

        Parameters:
        port - a port number
        See Also:
        setStoreProtocol(String)
      • getUsername

        public String getUsername()
        Returns:
        the the user name used for authentication.
      • setUsername

        public void setUsername​(String username)
        Set the user name used for authentication with the message store..
        Parameters:
        username - a user name
      • getMessageFilter

        public javax.mail.search.SearchTerm getMessageFilter()
        Get the message filter.
        Returns:
        the message filter (or null)
      • setMessageFilter

        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

        Parameters:
        messageFilter - filter for messages to be retrieved
        See Also:
        SearchTerm, Folder.search(SearchTerm)
      • isAllowOnlyOneMessage

        public boolean isAllowOnlyOneMessage()
        Get whether to allow just one message to match the filter.
        Returns:
        true iff at most one message must match the filter.
      • setAllowOnlyOneMessage

        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

        Parameters:
        allowOnlyOneMessage - flag if exactly one message is allowed to match the filter
      • getPathSelector

        public String getPathSelector()
        Returns:
        path the path selector.
      • setPathSelector

        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:

        Select just the third part of the first message which must contain a multipart/* body:
        0/2
        Select all parts of the first message:
        0/*
        Select all messages:
        * (or set the path selector to null)

        Default value: select all messages.

        Parameters:
        pathSelector - selector of message parts to include
      • getImapMessageUID

        public long getImapMessageUID()
        Returns:
        the UID of an IMAP message to select.
      • setImapMessageUID

        public void setImapMessageUID​(long imapMessageUID)
        Set the UID of an IMAP message to select. This may only be set, if the message filter has not yet been set and the store protocol is imap.
        Parameters:
        imapMessageUID - the UID of an IMAP message
      • isIgnoreOriginalMimeTypes

        public boolean isIgnoreOriginalMimeTypes()
        Returns:
        whether the original MIME-type information should be ignored.
      • setIgnoreOriginalMimeTypes

        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 com.levigo.jadice.server.documentplatform.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.

        Parameters:
        ignoreOriginalMimeTypes - flag if or if not to ignore the original MIME typ
      • isUnpackMultipart

        public boolean isUnpackMultipart()
        Returns:
        whether decomposition of multipart/* parts is enabled.
      • setUnpackMultipart

        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

        Parameters:
        unpackMultipart - flag if or if not to unpack multipart/* parts