|
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.NewsgroupExporter
public class NewsgroupExporter
A gateway for the export of messages to a newsgroup.
Field Summary | |
---|---|
static java.lang.String |
GATEWAY_APPROVE
Used to flag forums that are read only and which should force NNTP messages through with the 'Approve' header. |
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 javax.mail.Session |
session
|
Constructor Summary | |
---|---|
NewsgroupExporter(ForumFactory factory,
Forum forum,
GatewaySettings gatewaySettings)
Create an instance. |
Method Summary | |
---|---|
void |
exportData(ForumMessage forumMessage)
Export a forum message to a newsgroup. |
void |
exportData(ForumMessage[] forumMessages)
Export an array of forum messages to a newsgroup. |
void |
exportMessage(ForumMessage forumMessage)
|
java.lang.String |
getDefaultFromAddress()
From email address to send mail from for export. |
java.lang.String |
getHost()
Returns the NNTP host (eg news.example.com). |
java.util.Date |
getLastExport()
Last date this exporter 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 |
getOrganization()
Retrieves the Organization header for outbound NNTP messages. |
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 |
getUsername()
Retrieves the username set for this gateway. |
boolean |
isAllowExportAgain()
Return whether this gateway will allow reexporting of messages or not. |
boolean |
isAttachmentsEnabled()
By default attachments are disallowed by this gateway. |
boolean |
isDebugEnabled()
Returns true if debugging is turned on for the NNTP transport layer. |
boolean |
isEmailPrefEnabled()
True if a user's privacy setting on their email address should be obeyed when doing an export. |
boolean |
isUpdateMessageIDOnExport()
Retrieve whether the gateway will update the messageID message property stored in Jive upon export of a message. |
void |
setAllowExportAgain(boolean allowExportAgain)
By default this gateway refuses to re-export a message which has previously been exported or imported or which was automatically created for threading purposes by an import gateway. |
void |
setAttachmentsEnabled(boolean attachmentsEnabled)
Sets whether this gateway allows the export of attachments or not. |
void |
setDebugEnabled(boolean debugEnabled)
Toggles NNTP transport layer debugging on or off. |
void |
setDefaultFromAddress(java.lang.String address)
Set the from email address for message export to be used in the case of anonymous users and users who hide their information. |
void |
setEmailPrefEnabled(boolean enabled)
Sets whether the user's privacy setting on their email address should be obeyed when doing an export. |
void |
setHost(java.lang.String host)
Sets the NNTP host (eg news.example.com). |
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 |
setOrganization(java.lang.String organization)
Sets the Organization header for outbound NNTP messages. |
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 |
setUpdateMessageIDOnExport(boolean updateMessageID)
Sets whether the gateway will update the messageID message property stored in Jive upon export of a message. |
void |
setUsername(java.lang.String username)
Sets the username to be used in connecting to the NNTP server. |
void |
stop()
Stop a running export. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.mail.Session session
public static final java.lang.String GATEWAY_MESSAGE_ID
public static final java.lang.String GATEWAY_PARENT_ID
public static final java.lang.String GATEWAY_APPROVE
Constructor Detail |
---|
public NewsgroupExporter(ForumFactory factory, Forum forum, GatewaySettings gatewaySettings) throws java.lang.IllegalStateException
java.lang.IllegalStateException
Method Detail |
---|
public void exportData(ForumMessage forumMessage) throws GatewayException
NOTE: It is imperative that parent messages get exported prior to children messages so that the proper message headers can be set. Failure to do this will result in messages that may not be threaded properly when viewed using a newsreader.
exportData
in interface GatewayExporter
forumMessage
- message to export.
GatewayException
- if a connection was unable to be established.public void exportData(ForumMessage[] forumMessages) throws GatewayException
NOTE: It is imperative that parent messages get exported prior to children messages so that the proper message headers can be set. Failure to do this will result in messages that may not be threaded properly when viewed using a newsreader. Therefore, parent messages should be first in the list.
exportData
in interface GatewayExporter
forumMessages
- array of messages to export, sorted parents first.
GatewayException
- if a connection was unable to be established.public void exportMessage(ForumMessage forumMessage) throws javax.mail.MessagingException, GatewayException, UnauthorizedException
javax.mail.MessagingException
GatewayException
UnauthorizedException
public void stop() throws GatewayException
GatewayExporter
stop
in interface GatewayExporter
GatewayException
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 boolean isDebugEnabled()
public void setDebugEnabled(boolean debugEnabled)
debugEnabled
- true if NNTP debugging should be enabled, false otherwise.public boolean isEmailPrefEnabled()
public void setEmailPrefEnabled(boolean enabled)
enabled
- true if a user's privacy setting on their email address
should be obeyed when doing an export.public java.lang.String getDefaultFromAddress()
public void setDefaultFromAddress(java.lang.String address)
address
- the from email address.public java.lang.String getOrganization()
public void setOrganization(java.lang.String organization)
organization
- the string to set the
organization header to.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 isUpdateMessageIDOnExport()
Note: This setting has no effect unless accompanied by setAllowExportAgain(true).
public void setUpdateMessageIDOnExport(boolean updateMessageID)
Note: This setting has no effect unless accompanied by setAllowExportAgain(true).
updateMessageID
- true if Jive should be updated with the messageID
of exported messages, false otherwise.public boolean isAllowExportAgain()
public void setAllowExportAgain(boolean allowExportAgain)
However this can be overridden so that messages can be re-exported again if absolutely needed. Definite care is needed if you set the property to true.
Please note however that dummy messages will *never* be exported.
allowExportAgain
- true if messages should be allowed to be
reexported, false otherwise.public boolean isAttachmentsEnabled()
public void setAttachmentsEnabled(boolean attachmentsEnabled)
attachmentsEnabled
- true is attachments are allowed,
false otherwise.public java.util.Date getLastExport()
GatewayExporter
getLastExport
in interface GatewayExporter
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |