Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.gateway
Class MboxImporter

java.lang.Object
  extended by com.jivesoftware.forum.gateway.MboxImporter
All Implemented Interfaces:
GatewayImporter

public class MboxImporter
extends java.lang.Object
implements GatewayImporter

A gateway for the import of messages from a Mbox file This gateway (and the provider underneath it) assumes that the Mbox is only being used by this gateway. Therefore, do not use an active mbox file.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jivesoftware.forum.gateway.GatewayImporter
GatewayImporter.Stats
 
Constructor Summary
MboxImporter(ForumFactory factory, Forum forum, GatewaySettings gatewaySettings)
          Create an instance
 
Method Summary
 int getCurrentMessageCount()
           
 java.lang.String getDefaultCharacterSet()
          Returns the character set that will be used to decode inbound messages that have no explicit character set defined.
 java.util.Date getLastImport()
          Returns the Last date this importer completed
 java.lang.String getMboxFile()
           
 int getPercentComplete()
           
 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()
           
 int getTotalMessageCount()
           
 void importData(java.util.Date afterDate)
          Import data from the data source into the specified forum.
 boolean isAttachmentsEnabled()
          Returns true if attachments are allowed.
 boolean isDebugEnabled()
          Returns true if debugging is turned on for the Mbox transport layer.
 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()
           
 boolean isSubjectParentageCheckEnabled()
          Returns whether parentage checks will be done using subject line matching or not.
 void setAttachmentsEnabled(boolean attachmentEnabled)
          Toggles attachments on or off.
 void setDebugEnabled(boolean debugEnabled)
          Toggles Mbox transport layer debugging on or off.
 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 setEmailToUserMappingEnabled(boolean emailToUserMappingEnabled)
          Sets whether email address -> user mapping is enabled, false otherwise.
 void setImportHtmlEnabled(boolean importHtmlEnabled)
          Sets whether the importation of html email is enabled.
 void setImporting(boolean importing)
           
 void setMboxFile(java.lang.String file)
           
 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 stop()
          Stop a running import.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MboxImporter

public MboxImporter(ForumFactory factory,
                    Forum forum,
                    GatewaySettings gatewaySettings)
             throws java.lang.IllegalStateException
Create an instance

Throws:
java.lang.IllegalStateException
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

stop

public void stop()
          throws GatewayException
Description copied from interface: GatewayImporter
Stop a running import.

Specified by:
stop in interface GatewayImporter
Throws:
GatewayException

getStats

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

getMboxFile

public java.lang.String getMboxFile()

setMboxFile

public void setMboxFile(java.lang.String file)

isDebugEnabled

public boolean isDebugEnabled()
Returns true if debugging is turned on for the Mbox transport layer. Debug information is written to System.out.

Returns:
true if debugging is turned on.

setDebugEnabled

public void setDebugEnabled(boolean debugEnabled)
Toggles Mbox transport layer debugging on or off. Debug information is written to System.out.

Parameters:
debugEnabled - true if debugging should be enabled.

isAttachmentsEnabled

public boolean isAttachmentsEnabled()
Returns true if attachments are allowed.

Returns:
true if attachments are allowed.

setAttachmentsEnabled

public void setAttachmentsEnabled(boolean attachmentEnabled)
Toggles attachments on or off.

Parameters:
attachmentEnabled - true if attachments should be enabled.

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.

isImporting

public boolean isImporting()
Specified by:
isImporting in interface GatewayImporter

setImporting

public void setImporting(boolean importing)
Specified by:
setImporting in interface GatewayImporter

getPercentComplete

public int getPercentComplete()

getTotalMessageCount

public int getTotalMessageCount()

getCurrentMessageCount

public int getCurrentMessageCount()

getLastImport

public java.util.Date getLastImport()
Description copied from interface: GatewayImporter
Returns the Last date this importer completed

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

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.