|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.gateway.NewsgroupImporter
public class NewsgroupImporter
A gateway for the import of messages from a newsgroup.
Nested Class Summary | |
---|---|
protected class |
NewsgroupImporter.NNTPImporter
An extension of the JavaMailGateway class |
Nested classes/interfaces inherited from interface com.jivesoftware.forum.gateway.GatewayImporter |
---|
GatewayImporter.Stats |
Field Summary | |
---|---|
protected static java.util.Map |
forumLock
|
protected NewsgroupImporter.NNTPImporter |
gateway
|
static java.lang.String |
GATEWAY_MESSAGE_ID
Used to flag messages in the forum with a message id specific to this gateway. |
static java.lang.String |
GATEWAY_PARENT_ID
Used to flag messages in the forum with a parent id specific to this gateway. |
protected static java.util.Map |
serverSemaphores
|
Constructor Summary | |
---|---|
NewsgroupImporter(ForumFactory factory,
Forum forum,
GatewaySettings gatewaySettings)
Create an instance |
Method Summary | |
---|---|
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. |
java.lang.String |
getHost()
Returns the NNTP host (eg news.example.com). |
java.util.Date |
getLastImport()
Returns the Last date this importer completed |
int |
getLastMessageNumberSeen()
Used by the gateway to keep track of the last message seen. |
java.lang.String |
getNewsgroup()
Retrieves the newsgroup that the gateway is going to use. |
java.lang.String |
getPassword()
Retrieves the password to be used in connecting to the NNTP server. |
int |
getPort()
Returns the port number that will be used when connecting to the NNTP server. |
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()
|
java.lang.String |
getTemporaryParentBody()
Returns the body that will be used when creating temporary parent messages. |
java.lang.String |
getUsername()
Retrieves the username set for this gateway. |
void |
importData(java.util.Date afterDate)
Import data from the data source into the specified forum. |
boolean |
isAttachmentsEnabled()
By default attachments are allowed by this gateway. |
boolean |
isDebugEnabled()
Returns true if debugging is turned on for the NNTP 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 attachmentsEnabled)
Sets whether this gateway allows the import of attachments or not. |
void |
setDebugEnabled(boolean debugEnabled)
Toggles NNTP 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 |
setEmptySubject(java.lang.String emptySubject)
Sets the string to be used in place of an empty subject. |
void |
setHost(java.lang.String host)
Sets the NNTP host (eg news.example.com). |
void |
setImportHtmlEnabled(boolean importHtmlEnabled)
Sets whether the importation of html email is enabled. |
void |
setImporting(boolean importing)
|
void |
setLastMessageNumberSeen(int messageNumber)
Used by the gateway to keep track of the last message seen. |
void |
setNewsgroup(java.lang.String newsgroup)
Sets the newsgroup that this gateway is going to use. |
void |
setPassword(java.lang.String password)
Sets the password to be used in connecting to the NNTP server. |
void |
setPort(int port)
Set the port to use when connecting to the NNTP server. |
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. |
void |
setUsername(java.lang.String username)
Sets the username to be used in connecting to the NNTP server. |
void |
stop()
Stop a running import. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected NewsgroupImporter.NNTPImporter gateway
public static final java.lang.String GATEWAY_MESSAGE_ID
public static final java.lang.String GATEWAY_PARENT_ID
protected static java.util.Map forumLock
protected static java.util.Map serverSemaphores
Constructor Detail |
---|
public NewsgroupImporter(ForumFactory factory, Forum forum, GatewaySettings gatewaySettings) throws java.lang.IllegalStateException
java.lang.IllegalStateException
Method Detail |
---|
public void importData(java.util.Date afterDate) throws GatewayException
GatewayImporter
importData
in interface GatewayImporter
afterDate
- the oldest cutoff date for data to import.
GatewayException
public void stop() throws GatewayException
GatewayImporter
stop
in interface GatewayImporter
GatewayException
public GatewayImporter.Stats getStats()
getStats
in interface GatewayImporter
public java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- the username to be used in connecting to the NNTP server.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- the password to use be used in connecting to the
NNTP server.public int getPort()
public void setPort(int port)
port
- the port to use when connecting to the NNTP server. The
default is port 119.public java.lang.String getHost()
public void setHost(java.lang.String host)
host
- the NNTP host (eg news.example.com) to use.public java.lang.String getNewsgroup()
public void setNewsgroup(java.lang.String newsgroup)
newsgroup
- the newsgroup the gateway is going to use.public java.lang.String getTemporaryParentBody()
On subsequent imports when a real parent message is found, the fake data will be replaced with the correct subject and body.
public void setTemporaryParentBody(java.lang.String temporaryParentBody)
On subsequent imports when a real parent message is found, the fake data will be replaced with the correct subject and body.
temporaryParentBody
- the message body that will be used for
temporary fake parent messages.public boolean isDebugEnabled()
public void setDebugEnabled(boolean debugEnabled)
debugEnabled
- true if NNTP debugging should be enabled, false otherwise.public void setLastMessageNumberSeen(int messageNumber)
It is *highly* recommended not to set this yourself.
messageNumber
- the last message number seen by this gateway.public int getLastMessageNumberSeen()
It is *highly* recommended not to set this but rather let the gateway handle it itself.
public boolean isAttachmentsEnabled()
public void setAttachmentsEnabled(boolean attachmentsEnabled)
attachmentsEnabled
- true is attachments are allowed,
false otherwise.public boolean isEmailToUserMappingEnabled()
public void setEmailToUserMappingEnabled(boolean emailToUserMappingEnabled)
emailToUserMappingEnabled
- True if email address -> user mapping is enabled,
false otherwise.public boolean isImportHtmlEnabled()
public void setImportHtmlEnabled(boolean importHtmlEnabled)
importHtmlEnabled
- True if the importation of html email is enabled,
false otherwise.public java.lang.String getDefaultCharacterSet()
public void setDefaultCharacterSet(java.lang.String defaultCharacterSet)
defaultCharacterSet
- the character set that will be used to decode inbound messages
that have no explicit character set defined.public java.lang.String getReplyPrefixes()
public void setReplyPrefixes(java.lang.String replyPrefixes)
replyPrefixes
- an comma seperated string of lowercase prefixespublic boolean isSubjectParentageCheckEnabled()
public void setSubjectParentageCheckEnabled(boolean subjectParentageCheckEnabled)
subjectParentageCheckEnabled
- true if parentage checks will be done using
subject line matching, false otherwise.public java.lang.String getEmptySubject()
public void setEmptySubject(java.lang.String emptySubject)
emptySubject
- the string to be used in place of an empty subject.public java.util.Date getLastImport()
GatewayImporter
getLastImport
in interface GatewayImporter
public boolean isImporting()
isImporting
in interface GatewayImporter
public void setImporting(boolean importing)
setImporting
in interface GatewayImporter
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |