Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.gateway
Class JavaMailImporter

java.lang.Object
  extended by com.jivesoftware.forum.gateway.JavaMailImporter
All Implemented Interfaces:
GatewayImporter
Direct Known Subclasses:
NewsgroupImporter.NNTPImporter

public abstract class JavaMailImporter
extends java.lang.Object
implements GatewayImporter

This class is an abstract JavaMail implementation of the Gateway interface. This class provides all the needed methods to import messages from whatever JavaMail providers are supported.

If a provider such as a NNTP provider needs to do something special when connecting or retrieving messages all it needs to do is re-implement the method in question in a subclass.


Nested Class Summary
protected  class JavaMailImporter.InsertCacheItem
          Small class to cache insert's so that we can do them all at once and not incur penalties for continuously invalidating the message & thread caches because of constant inserts.
 
Nested classes/interfaces inherited from interface com.jivesoftware.forum.gateway.GatewayImporter
GatewayImporter.Stats
 
Field Summary
protected  java.lang.String emptySubject
          Dummy subject string for inbound messages with no subject
protected  ForumFactory factory
           
protected  java.util.List failedMessageIDs
          Used to store a list of message id's that failed to be imported
protected  long forumID
          The forumID is used instead of an actual forum object since Jive's cache system will orphan the forum object after 6 hours.
protected  java.lang.String gatewayMessageId
          Used to flag messages in the forum with a message id.
protected  java.lang.String gatewayParentId
          Used to flag messages in the forum with a parent id.
static java.lang.String MESSAGE_DATE_HEADER
          Used to store a messages original date if the date had to be changed such as in the case of a parent with an older child
protected  java.util.Hashtable parentMessageIDs
          Used to store the parent message id's indexed by message id
protected  boolean stopFlag
          Flag used to stop an already running import or export.
static java.lang.String SUBJECT_EXTENDED_PROPERTY
          Used for storing a hash of a subject as an extended property needed for parent message comparison
protected  boolean subjectParentageCheckEnabled
          Whether or not to attempt to determine parentage via subject line matching
protected  java.lang.String temporaryParentBody
          Dummy message string for messages autocreated by this gateway
 
Constructor Summary
JavaMailImporter(ForumFactory factory, Forum forum, GatewaySettings settings)
           
 
Method Summary
protected  void addAttachments(ForumMessage forumMessage, javax.mail.Part part)
          Adds attachments from a JavaMail Part object to a forum message object.
protected  void addUUencodedAttachments(ForumMessage forumMessage, java.io.BufferedReader reader)
          Search for uuencoded attachments from a reader and attach them to a message.
protected  void cleanup()
          Called after all imports are done just prior to the folder and the store being closed.
protected  void correctMessageDates(java.util.List messages)
          Corrects the dates on the provided list of messages.
 long getAverageTime()
           
protected  boolean getBody(java.lang.StringBuffer buf, javax.mail.Part part)
          Retrieve the textual body of the message.
protected  java.util.Date getDate(javax.mail.Message message)
          Returns the date a message was created or received, or the current date if date parsing fails.
 java.lang.String getDefaultCharacterSet()
          Returns the character set that will be used to decode inbound messages that have no explicit character set defined.
 java.lang.String getEmptySubject()
          Returns the string to be used in place of an empty subject.
 long getFailedMessageCount()
           
protected  javax.mail.Folder getFolder(javax.mail.Store store)
          Retrieve the JavaMail folder from the provided store object.
 java.lang.String getHost()
          Get the server host.
 java.util.Date getLastImport()
          Not implemented throws UnsupportedOperation exception
 java.lang.String getMailbox()
          Returns the name of the mailbox.
protected  java.lang.String getMessageID(javax.mail.Message message)
          Retrieve the messageID using the JavaMail provided method.
 long getMessagesAdded()
           
protected  java.lang.String[] getParentMessageID(javax.mail.Message message)
          Returns the the parent message id's of a message.
protected  java.lang.String[] getParentMessageID(javax.mail.Message message, java.lang.String header)
          Returns the parent ID's of a message as a String [] or null if there are no parents.
 java.lang.String getPassword()
          Returns the password.
 int getPort()
          Get the server port.
abstract  java.lang.String getProtocol()
          Get the protocol.
 java.lang.String getReplyPrefixes()
          Returns a comma seperated of prefixes that will be stripped from messages when attempting to find a parent message via subject line matching.
 GatewayImporter.Stats getStats()
           
protected  javax.mail.Store getStore(java.util.Date afterDate)
          Retrieve the JavaMail store.
protected  java.lang.String getSubject(javax.mail.Message message)
          Returns the subject of a JavaMail message.
 java.lang.String getTemporaryParentBody()
          Returns the body that will be used when creating temporary parent messages.
protected  java.io.BufferedReader getTextReader(javax.mail.Part part)
          Get a reader object for a Part with the character set properly chosen.
 int getTimesRan()
           
 long getTotalMessages()
           
protected  long getTotalTime()
           
 java.lang.String getUsername()
          Returns the username.
static void handleAttachmentException(AttachmentException e, ForumMessage forumMessage)
           
 void importData(java.util.Date afterDate)
          Import data from the data source into the specified forum.
protected  void importMessages(java.util.List messages)
          Import the List of messages into the forum specified.
 boolean isAttachmentsEnabled()
          True if attachments are enabled, false otherwise.
 boolean isDebugEnabled()
          True if debug is enabled, false otherwise.
 boolean isDeleteEnabled()
          Returns true if data will be deleted from the store after being read.
 boolean isEmailToUserMappingEnabled()
          True if email address -> user mapping is enabled, false otherwise.
 boolean isImportHtmlEnabled()
          True if if the importation of html email is enabled, false otherwise.
 boolean isImporting()
          Not implemented throws UnsupportedOperation exception
protected  JavaMailImporter.InsertCacheItem isMessageinInsertCache(java.util.List cache, java.lang.String messageID)
           
protected  boolean isMessageWithAttachments(javax.mail.Message message)
          Utility method to check to see if a Message object contains attachments or not.
 boolean isSubjectParentageCheckEnabled()
          Returns whether parentage checks will be done using subject line matching or not.
protected  DbForumMessage lookupMessageByID(Forum forum, java.lang.String messageID, boolean checkDummy)
          Utility method to determine if a message exists in the forum already.
protected  ForumMessage parseMessage(javax.mail.Message message, java.util.Date afterDate)
          Parse the JavaMail message object and return a ForumMessage object.
protected  void processMessagesAndImport(java.util.List messages)
          Resolves parentage, corrects dates, sorts, imports, then clears messages.
protected  void removeUUencodedAttachments(java.lang.StringBuffer sb, java.io.BufferedReader reader)
          Search for uuencoded attachments from a reader and remove them appending the remaining lines into the provided stringbuffer
protected  void resolveParentage(java.util.List messages)
          Resolve parentage of messages.
protected  void retrieveMessages(javax.mail.Store store, javax.mail.Folder folder, java.util.Date afterDate)
          Retrieve messages from a JavaMail folder and calls methods to import them into a forum.
 void setAttachmentsEnabled(boolean attachmentsEnabled)
          Set whether attachments are enabled or not.
 void setDebugEnabled(boolean debugEnabled)
          Set whether debug is enabled or not.
 void setDefaultCharacterSet(java.lang.String defaultCharacterSet)
          Sets the character set that will be used to decode inbound messages that have no explicit character set defined.
 void setDeleteEnabled(boolean deleteEnabled)
          Sets whether data will be deleted from the store after being read.
 void setEmailToUserMappingEnabled(boolean emailToUserMappingEnabled)
          Sets whether email address -> user mapping is enabled, false otherwise.
 void setEmptySubject(java.lang.String emptySubject)
          Sets the string to be used in place of an empty subject.
 void setFailedMessageCount(long failedMessages)
           
 void setHost(java.lang.String host)
          Set the server host.
 void setImportHtmlEnabled(boolean importHtmlEnabled)
          Sets whether the importation of html email is enabled.
 void setImporting(boolean importing)
          Not implemented throws UnsupportedOperation exception
 void setMailbox(java.lang.String mailbox)
          Sets the name of the mailbox.
 void setMessagesAdded(long totalAddedMessages)
           
 void setPassword(java.lang.String password)
          Set the password.
 void setPort(int port)
          Set the server port.
 void setReplyPrefixes(java.lang.String replyPrefixes)
          Sets the possible prefixes that will be stripped from messages when attempting to find a parent message via subject line matching.
 void setSubjectParentageCheckEnabled(boolean subjectParentageCheckEnabled)
          Sets whether parentage checks will be done using subject line matching or not.
 void setTemporaryParentBody(java.lang.String temporaryParentBody)
          Sets the body that will be used when creating temporary parent messages.
protected  void setTimesRan(int timesRan)
           
 void setTotalMessages(long totalMessages)
           
protected  void setTotalTime(long totalTime)
           
 void setUsername(java.lang.String username)
          Set the username.
protected  void shortTermQueryCacheHack(ResultFilter filter)
          Like the name says, it's a hack.
 void stop()
          Stop a already running import or export.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stopFlag

protected boolean stopFlag
Flag used to stop an already running import or export.


gatewayMessageId

protected java.lang.String gatewayMessageId
Used to flag messages in the forum with a message id.


gatewayParentId

protected java.lang.String gatewayParentId
Used to flag messages in the forum with a parent id.


subjectParentageCheckEnabled

protected boolean subjectParentageCheckEnabled
Whether or not to attempt to determine parentage via subject line matching


temporaryParentBody

protected java.lang.String temporaryParentBody
Dummy message string for messages autocreated by this gateway


emptySubject

protected java.lang.String emptySubject
Dummy subject string for inbound messages with no subject


parentMessageIDs

protected java.util.Hashtable parentMessageIDs
Used to store the parent message id's indexed by message id


failedMessageIDs

protected java.util.List failedMessageIDs
Used to store a list of message id's that failed to be imported


MESSAGE_DATE_HEADER

public static final java.lang.String MESSAGE_DATE_HEADER
Used to store a messages original date if the date had to be changed such as in the case of a parent with an older child

See Also:
Constant Field Values

SUBJECT_EXTENDED_PROPERTY

public static final java.lang.String SUBJECT_EXTENDED_PROPERTY
Used for storing a hash of a subject as an extended property needed for parent message comparison

See Also:
Constant Field Values

forumID

protected long forumID
The forumID is used instead of an actual forum object since Jive's cache system will orphan the forum object after 6 hours. Since gateways are usually created once and not destroyed after every use, we mustn't hang onto a forum object for too long.


factory

protected ForumFactory factory
Constructor Detail

JavaMailImporter

public JavaMailImporter(ForumFactory factory,
                        Forum forum,
                        GatewaySettings settings)
Method Detail

importData

public void importData(java.util.Date afterDate)
                throws GatewayException
Description copied from interface: GatewayImporter
Import data from the data source into the specified forum. For example, a concrete implementation of this interface might poll a newsgroup and add new messages to the forum.

Specified by:
importData in interface GatewayImporter
Parameters:
afterDate - the oldest cutoff date for data to import.
Throws:
GatewayException

getStore

protected javax.mail.Store getStore(java.util.Date afterDate)
                             throws javax.mail.MessagingException
Retrieve the JavaMail store.

Parameters:
afterDate - the date after which messages will be imported.
Returns:
a connected store object.
Throws:
javax.mail.MessagingException - if an error occurred establishing the connection.

getFolder

protected javax.mail.Folder getFolder(javax.mail.Store store)
                               throws javax.mail.MessagingException
Retrieve the JavaMail folder from the provided store object.

Parameters:
store - the JavaMail store.
Returns:
a connected folder object.
Throws:
javax.mail.MessagingException - if an error occurred establishing the connection.

retrieveMessages

protected void retrieveMessages(javax.mail.Store store,
                                javax.mail.Folder folder,
                                java.util.Date afterDate)
                         throws javax.mail.MessagingException,
                                GatewayException
Retrieve messages from a JavaMail folder and calls methods to import them into a forum.

Parameters:
folder - a connected JavaMail folder object.
afterDate - the date after which we'll import message.
Throws:
javax.mail.MessagingException - if a protocol error occurs retrieving a message.
GatewayException

processMessagesAndImport

protected void processMessagesAndImport(java.util.List messages)
                                 throws ForumNotFoundException,
                                        UnauthorizedException
Resolves parentage, corrects dates, sorts, imports, then clears messages.

Parameters:
messages - a list of ForumMessage objects to import
Throws:
ForumNotFoundException
UnauthorizedException

resolveParentage

protected void resolveParentage(java.util.List messages)
                         throws ForumNotFoundException,
                                UnauthorizedException
Resolve parentage of messages.

We need to go through all the messages and determine parentage from subject if the parent id property isn't already set, which is almost certain in the case of POP3 and sometimes the case with other providers.

Parameters:
messages - a List of ForumMessage objects.
Throws:
ForumNotFoundException
UnauthorizedException

correctMessageDates

protected void correctMessageDates(java.util.List messages)
                            throws ForumNotFoundException,
                                   UnauthorizedException
Corrects the dates on the provided list of messages.

We need to check dates on all the messages to verify that we don't have a child the same age or older than a parent, which Jive was explicitly designed not to handle. Our solution to this problem is to change the child messages' creation date to 1 millisecond later the parent's and store the original date in an extended property. In the case where we are inserting a message that was already created as a dummy parent message, we check to verify that the message is also older than any children it has. If it isn't we correct the current messages' date to be 1 millisecond older than it's oldest child.

Parameters:
messages - a List of ForumMessage objects.
Throws:
ForumNotFoundException
UnauthorizedException

parseMessage

protected ForumMessage parseMessage(javax.mail.Message message,
                                    java.util.Date afterDate)
Parse the JavaMail message object and return a ForumMessage object. If parsing fails the message won't be marked for deletion if message deletion is enabled.

Parameters:
message - the JavaMail Message object.
afterDate - the date we use to check to see if we should import this message or not.
Returns:
a ForumMessage object.

importMessages

protected void importMessages(java.util.List messages)
                       throws ForumNotFoundException,
                              UnauthorizedException
Import the List of messages into the forum specified.

One of the things we need to do in this method is check to see if this message or it's parent already exist (or doesn't exist) in this forum.

If a parent doesn't exist, we create a dummy message in its place. If a parent does exist, we attach the message to the parent's thread.

If a message already exists in the forum, we first check to see if it's one of the dummy messages we previously created. If so, we modify it. Otherwise, we don't insert the message.

If a message doesn't already exist in the forum and it has no parent(s), we create a new thread with this message as the root message

Parameters:
messages - a list of messages to import into the forum.
Throws:
ForumNotFoundException
UnauthorizedException

isMessageinInsertCache

protected JavaMailImporter.InsertCacheItem isMessageinInsertCache(java.util.List cache,
                                                                  java.lang.String messageID)

lookupMessageByID

protected DbForumMessage lookupMessageByID(Forum forum,
                                           java.lang.String messageID,
                                           boolean checkDummy)
Utility method to determine if a message exists in the forum already.

Parameters:
forum - [required]
messageID - Message-ID mail header value. Checked against null and empty.
checkDummy - whether to mandate that it is a "dummy" or not.
Returns:
the forumMessage if a match is found, null otherwise.

shortTermQueryCacheHack

protected void shortTermQueryCacheHack(ResultFilter filter)
Like the name says, it's a hack. Ask Bruce if you need an explanation.

Parameters:
filter - the filter to apply the hack to.

isMessageWithAttachments

protected boolean isMessageWithAttachments(javax.mail.Message message)
                                    throws javax.mail.MessagingException
Utility method to check to see if a Message object contains attachments or not.

Returns:
True if the message has attachments, false otherwise.
Throws:
javax.mail.MessagingException - If the error occurs parsing the message object.

addAttachments

protected void addAttachments(ForumMessage forumMessage,
                              javax.mail.Part part)
                       throws javax.mail.MessagingException,
                              UnauthorizedException
Adds attachments from a JavaMail Part object to a forum message object.

This implementation doesn't attempt to figure out beforehand if an attachment should be added by checking with an attachment manager, rather it just catches any AttachmentException thrown and reports it.

Throws:
javax.mail.MessagingException - if the error occurs getting an attachment out of the message.
UnauthorizedException - if the error occurs adding an attachment to the forumMessage.

handleAttachmentException

public static void handleAttachmentException(AttachmentException e,
                                             ForumMessage forumMessage)
                                      throws UnauthorizedException
Throws:
UnauthorizedException

addUUencodedAttachments

protected void addUUencodedAttachments(ForumMessage forumMessage,
                                       java.io.BufferedReader reader)
                                throws java.io.IOException,
                                       java.lang.IllegalStateException,
                                       AttachmentException,
                                       UnauthorizedException
Search for uuencoded attachments from a reader and attach them to a message.

Parameters:
forumMessage - the message to attach the uuencoded attachments to.
reader - the reader to search for uuencoded attachments in.
Throws:
java.io.IOException
java.lang.IllegalStateException
AttachmentException
UnauthorizedException

removeUUencodedAttachments

protected void removeUUencodedAttachments(java.lang.StringBuffer sb,
                                          java.io.BufferedReader reader)
                                   throws java.io.IOException
Search for uuencoded attachments from a reader and remove them appending the remaining lines into the provided stringbuffer

Parameters:
sb - the StringBuffer to append text lines to.
reader - the reader to search for uuencoded attachments in.
Throws:
java.io.IOException

getSubject

protected java.lang.String getSubject(javax.mail.Message message)
Returns the subject of a JavaMail message.

Parameters:
message - the JavaMail message.
Returns:
String the subject of the message, or null if one could not be found

getDate

protected java.util.Date getDate(javax.mail.Message message)
                          throws javax.mail.MessagingException
Returns the date a message was created or received, or the current date if date parsing fails. POP3 is notorious for improperly formatted date fields and doesn't provide a separate received date field. In many cases JavaMail fails to parse these dates, so we attempt to use our own parsers as backup.

If the parsed date is in the future, we return the current date.

Parameters:
message - a JavaMail message.
Returns:
Date the sent (or received) date of the message.
Throws:
javax.mail.MessagingException - if an error occurred trying to retrieve the date.

getMessageID

protected java.lang.String getMessageID(javax.mail.Message message)
                                 throws javax.mail.MessagingException
Retrieve the messageID using the JavaMail provided method.

Parameters:
message - the JavaMail message.
Returns:
String the messageID.
Throws:
javax.mail.MessagingException - if an error occurred trying to retrieve the messageID.

getParentMessageID

protected java.lang.String[] getParentMessageID(javax.mail.Message message)
                                         throws javax.mail.MessagingException
Returns the the parent message id's of a message. Currently, two headers are given for threading purposes, In-Reply-To: and References: In-Reply-To contains the msg id's of all the messages for which this message is a reply (And for which is almost universally only one), References is used to identify a thread of conversation.

See RFC 822/2822 for a full explanation. Note that this implementation doesn't handle CFWS, particularly the Comment part. Shoot me. (RFC 2822 Section 3.6.4)

Parameters:
message - the JavaMail message.
Returns:
String the parent message id (empty if not found).
Throws:
javax.mail.MessagingException - if something goes wrong.

getParentMessageID

protected java.lang.String[] getParentMessageID(javax.mail.Message message,
                                                java.lang.String header)
                                         throws javax.mail.MessagingException
Returns the parent ID's of a message as a String [] or null if there are no parents.

Parameters:
message - the JavaMail message.
header - the header to use to lookup the parent message id.
Returns:
String the parent message id (null if not found).
Throws:
javax.mail.MessagingException - if something goes wrong.

getBody

protected boolean getBody(java.lang.StringBuffer buf,
                          javax.mail.Part part)
                   throws javax.mail.MessagingException,
                          java.io.IOException
Retrieve the textual body of the message.

Parameters:
buf - the StringBuffer to append text lines to.
part - the JavaMail message.
Returns:
true if the content is html
Throws:
javax.mail.MessagingException - if JavaMail throws an exception.
java.io.IOException - if JavaMail throws an exception handling mime content.

getTextReader

protected java.io.BufferedReader getTextReader(javax.mail.Part part)
                                        throws javax.mail.MessagingException
Get a reader object for a Part with the character set properly chosen. Note that the reader object returned should be closed after use.

Parameters:
part - a javax.mail.part object.
Returns:
a BufferedReader object.
Throws:
javax.mail.MessagingException - if error occurs reading the part object.

cleanup

protected void cleanup()
Called after all imports are done just prior to the folder and the store being closed. This allows gateways to retrieve specific information at the end of a session and allows gateways to copy the failedMessageIDs list to reattempt import of those failed messages in a background thread.


getProtocol

public abstract java.lang.String getProtocol()
Get the protocol.

Returns:
The current protocol.

getPort

public int getPort()
Get the server port.

Returns:
The current port setting.

setPort

public void setPort(int port)
Set the server port.

Parameters:
port - the new port setting.

getHost

public java.lang.String getHost()
Get the server host.

Returns:
The current host setting (IP or name).

setHost

public void setHost(java.lang.String host)
Set the server host.

Parameters:
host - the new host setting.

getUsername

public java.lang.String getUsername()
Returns the username.

Returns:
The current username.

setUsername

public void setUsername(java.lang.String username)
Set the username.

Parameters:
username - the username to use.

getPassword

public java.lang.String getPassword()
Returns the password.

Returns:
The current password.

setPassword

public void setPassword(java.lang.String password)
Set the password.

Parameters:
password - the password to use.

getMailbox

public java.lang.String getMailbox()
Returns the name of the mailbox.

Returns:
The current mailbox.

setMailbox

public void setMailbox(java.lang.String mailbox)
Sets the name of the mailbox.

Parameters:
mailbox - the mailbox to use.

getTemporaryParentBody

public java.lang.String getTemporaryParentBody()
Returns the body that will be used when creating temporary parent messages. It's possible with email accounts and mailing lists to get a response to a message before getting the original message. If this happens and only the child message is available at the time of the gateway import, Jive must still have a way to establish a correct parent/child relationship. Therefore, a temporary fake parent message is created using an extrapolated subject from the child, and a body with the value temporaryParentBody. By default, this value will be the empty String. However, you may wish to create a short message that explains the nature of the fake parent message to the user.

On subsequent imports when a real parent message is found, the fake data will be replaced with the correct subject and body.

Returns:
The message body that will be used for temporary fake parent messages.

setTemporaryParentBody

public void setTemporaryParentBody(java.lang.String temporaryParentBody)
Sets the body that will be used when creating temporary parent messages. It's possible with email accounts and mailing lists to get a response to a message before getting the original message. If this happens and only the child message is available at the time of the gateway import, Jive must still have a way to establish a correct parent/child relationship. Therefore, a temporary fake parent message is created using an extrapolated subject from the child, and a body with the value temporaryParentBody. By default, this value will be the empty String. However, you may wish to create a short message that explains the nature of the fake parent message to the user.

On subsequent imports when a real parent message is found, the fake data will be replaced with the correct subject and body.

Parameters:
temporaryParentBody - the message body that will be used for temporary fake parent messages.

isDeleteEnabled

public boolean isDeleteEnabled()
Returns true if data will be deleted from the store after being read. When false, no data will be deleted from the store.

Returns:
True if data will be deleted from the store after being read.

setDeleteEnabled

public void setDeleteEnabled(boolean deleteEnabled)
Sets whether data will be deleted from the store after being read. When false, no data will be deleted from the store.

Parameters:
deleteEnabled - true if data should be deleted from the store after being read.

isDebugEnabled

public boolean isDebugEnabled()
True if debug is enabled, false otherwise.

Returns:
True if debug is enabled, false otherwise.

setDebugEnabled

public void setDebugEnabled(boolean debugEnabled)
Set whether debug is enabled or not.

Parameters:
debugEnabled - true to debug, false otherwise.

isAttachmentsEnabled

public boolean isAttachmentsEnabled()
True if attachments are enabled, false otherwise.

Returns:
True if attachments are enabled, false otherwise.

setAttachmentsEnabled

public void setAttachmentsEnabled(boolean attachmentsEnabled)
Set whether attachments are enabled or not.

Parameters:
attachmentsEnabled - true if attachments are enabled, false otherwise.

isEmailToUserMappingEnabled

public boolean isEmailToUserMappingEnabled()
True if email address -> user mapping is enabled, false otherwise.

Returns:
True if email address -> user mapping is enabled, false otherwise.

setEmailToUserMappingEnabled

public void setEmailToUserMappingEnabled(boolean emailToUserMappingEnabled)
Sets whether email address -> user mapping is enabled, false otherwise.

Parameters:
emailToUserMappingEnabled - True if email address -> user mapping is enabled, false otherwise.

isImportHtmlEnabled

public boolean isImportHtmlEnabled()
True if if the importation of html email is enabled, false otherwise.

Returns:
True if if the importation of html email is enabled, false otherwise.

setImportHtmlEnabled

public void setImportHtmlEnabled(boolean importHtmlEnabled)
Sets whether the importation of html email is enabled. If it is, html email will be imported as the message body, otherwise it will be imported as an attachment.

Parameters:
importHtmlEnabled - True if the importation of html email is enabled, false otherwise.

getDefaultCharacterSet

public java.lang.String getDefaultCharacterSet()
Returns the character set that will be used to decode inbound messages that have no explicit character set defined. Default is "ISO-8859-1".

Returns:
the character set that will be used to decode inbound messages that have no explicit character set defined.

setDefaultCharacterSet

public void setDefaultCharacterSet(java.lang.String defaultCharacterSet)
Sets the character set that will be used to decode inbound messages that have no explicit character set defined.

Parameters:
defaultCharacterSet - the character set that will be used to decode inbound messages that have no explicit character set defined.

getReplyPrefixes

public java.lang.String getReplyPrefixes()
Returns a comma seperated of prefixes that will be stripped from messages when attempting to find a parent message via subject line matching. Prefixes are lowercase and the default array contains 're:' and 'aw:'

Returns:
a comma seperated list of prefixes that will be stripped from messages when attempting to find a parent message via subject line matching

setReplyPrefixes

public void setReplyPrefixes(java.lang.String replyPrefixes)
Sets the possible prefixes that will be stripped from messages when attempting to find a parent message via subject line matching. Prefixes are lowercase and the default array contains 're:' and 'aw:'

Parameters:
replyPrefixes - an comma seperated string of lowercase prefixes

isSubjectParentageCheckEnabled

public boolean isSubjectParentageCheckEnabled()
Returns whether parentage checks will be done using subject line matching or not.

Returns:
whether parentage checks will be done using subject line matching or not.

setSubjectParentageCheckEnabled

public void setSubjectParentageCheckEnabled(boolean subjectParentageCheckEnabled)
Sets whether parentage checks will be done using subject line matching or not.

Parameters:
subjectParentageCheckEnabled - true if parentage checks will be done using subject line matching, false otherwise.

stop

public void stop()
Stop a already running import or export.

Specified by:
stop in interface GatewayImporter

getEmptySubject

public java.lang.String getEmptySubject()
Returns the string to be used in place of an empty subject. Default is [No Subject].

Returns:
the string to be used in place of an empty subject.

setEmptySubject

public void setEmptySubject(java.lang.String emptySubject)
Sets the string to be used in place of an empty subject. Default is [No Subject].

Parameters:
emptySubject - the string to be used in place of an empty subject.

getLastImport

public java.util.Date getLastImport()
Not implemented throws UnsupportedOperation exception

Specified by:
getLastImport in interface GatewayImporter
Returns:
the last date this importer completed

getTimesRan

public int getTimesRan()

setTimesRan

protected void setTimesRan(int timesRan)

getTotalTime

protected long getTotalTime()

setTotalTime

protected void setTotalTime(long totalTime)

getAverageTime

public long getAverageTime()

getTotalMessages

public long getTotalMessages()

setTotalMessages

public void setTotalMessages(long totalMessages)

getMessagesAdded

public long getMessagesAdded()

setMessagesAdded

public void setMessagesAdded(long totalAddedMessages)

setFailedMessageCount

public void setFailedMessageCount(long failedMessages)

getFailedMessageCount

public long getFailedMessageCount()

getStats

public GatewayImporter.Stats getStats()
Specified by:
getStats in interface GatewayImporter

isImporting

public boolean isImporting()
Not implemented throws UnsupportedOperation exception

Specified by:
isImporting in interface GatewayImporter

setImporting

public void setImporting(boolean importing)
Not implemented throws UnsupportedOperation exception

Specified by:
setImporting in interface GatewayImporter

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.