Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.gateway
Interface Gateway

All Known Implementing Classes:
BaseGateway, ImapGateway, MboxGateway, NewsgroupGateway, POP3Gateway

public interface Gateway

A Gateway synchronizes a forum and an external data source such as a NNTP newsgroup, or mailing list (through a POP3 account and SMTP). Each gateway must know how to import data from the external source as new messages that are added to an existing forum, and how to export individual messages to the source.

Configuring Gateways:
Gateways can be configured by one of two methods. The first involves setting the properties directly using the setProperty, setImportProperty, and setExportProperty. The second method involves casting the gateway/importer/exporter to its implementation and calling setXXX methods of the implementation (if implemented). To persist a gateway configuration you must call either the GatewayManager.create(Gateway) or GatewayManager.update(Gateway) depending on wether the gateway already exists and just wanting to update it or if you are creating a new gateway.

CAVEATS:
Calling set vaues on gateway or its imports/exports will not persist the values. You will need to call GatewayManager.update(com.jivesoftware.forum.gateway.Gateway) to persist these values. Changes to the values will however change the behavior of the gateway if it currently being ran in a background import/export task.

See Also:
GatewayManager

Method Summary
 GatewayExporter getExporter()
          Returns the the GatewayExporter object associated with this Gateway instance.
 java.lang.String getExportProperty(java.lang.String key)
          Returns an extended property associated with the exporter.
 java.util.Set getExportPropertyKeys()
          Returns all extended exporter property keys
 Forum getForum()
          Returns forum object that this gateway is exporting/importing messages to/from.
 long getID()
          The unique id of the gateway, this will only be a value greater than zero if the gateway is a persistent gateway.
 GatewayImporter getImporter()
          Returns the the GatewayImporter object associated with this Gateway instance.
 java.lang.String getImportProperty(java.lang.String key)
          Returns an extended property associated with the importer.
 java.util.Set getImportPropertyKeys()
          Returns all extended importer property keys
 java.lang.String getProperty(java.lang.String key)
          The value of a gateway extended property.
 java.util.Set getPropertyKeys()
          All extended property keys for this gateway
 java.lang.String getType()
          Returns the type of gateway (ie "POP").
 boolean isDisableCutOffDate()
           
 boolean isExportEnabled()
          Returns true if exporting is enabled in this gateway.
 boolean isImportEnabled()
          Returns true if importing is enabled in this gateway.
 void setDisableCutOffDate(boolean disableCutOffDate)
           
 void setExportEnabled(boolean enabled)
          Sets whether this gateway should be exporting message into a forum or not.
 void setExportProperty(java.lang.String key, java.lang.String value)
          Sets an extended property to be associated with the exporter.
 void setImportEnabled(boolean enabled)
          Sets whether this gateway should be importing message into a forum or not.
 void setImportProperty(java.lang.String key, java.lang.String value)
          Sets an extended property to be associated with the importer.
 void setProperty(java.lang.String key, java.lang.String value)
          Sets an extended property for this gateway.
 

Method Detail

getID

long getID()
The unique id of the gateway, this will only be a value greater than zero if the gateway is a persistent gateway. Gateways that are executed once will not have a value that is greater than zero.

Returns:
the unique id of this gateway.

getExporter

GatewayExporter getExporter()
Returns the the GatewayExporter object associated with this Gateway instance. If this gateway does not have an exporter object then null will be returned.

Returns:
the exporter for this gateway if one exists, else null.

getImporter

GatewayImporter getImporter()
Returns the the GatewayImporter object associated with this Gateway instance. If this gateway does not have an importer object then null will be returned.

Returns:
the importer for this gateway if one exists, else null.

getForum

Forum getForum()
Returns forum object that this gateway is exporting/importing messages to/from.

Returns:
the forum object associated with this gateway

getType

java.lang.String getType()
Returns the type of gateway (ie "POP"). A default list of types can be found in GatewayManager.Type.

Returns:
the type of gateway

setImportEnabled

void setImportEnabled(boolean enabled)
Sets whether this gateway should be importing message into a forum or not.

The default value for import enabled is true.

Parameters:
enabled - true if we should be importing

setExportEnabled

void setExportEnabled(boolean enabled)
Sets whether this gateway should be exporting message into a forum or not.

The default value for export enabled is true.

Parameters:
enabled - true if we should be exporting

setImportProperty

void setImportProperty(java.lang.String key,
                       java.lang.String value)
Sets an extended property to be associated with the importer.

Placing null for a value will delete the value for a key.

Parameters:
key - property key
value - property value

getImportProperty

java.lang.String getImportProperty(java.lang.String key)
Returns an extended property associated with the importer.

Parameters:
key - property key
Returns:
value of the property

getImportPropertyKeys

java.util.Set getImportPropertyKeys()
Returns all extended importer property keys

Returns:
extended importer property keys

setExportProperty

void setExportProperty(java.lang.String key,
                       java.lang.String value)
Sets an extended property to be associated with the exporter.

Placing null for a value will delete the value for a key.

Parameters:
key - property key
value - property value

getExportProperty

java.lang.String getExportProperty(java.lang.String key)
Returns an extended property associated with the exporter.

Parameters:
key - property key
Returns:
value of the property

getExportPropertyKeys

java.util.Set getExportPropertyKeys()
Returns all extended exporter property keys

Returns:
extended exporter property keys

setProperty

void setProperty(java.lang.String key,
                 java.lang.String value)
Sets an extended property for this gateway.

Placing null for a value will delete the value for a key.

Parameters:
key - property key
value - property value

getProperty

java.lang.String getProperty(java.lang.String key)
The value of a gateway extended property.

Parameters:
key - key for the property
Returns:
property value

getPropertyKeys

java.util.Set getPropertyKeys()
All extended property keys for this gateway

Returns:
extended property keys for this gateway

isExportEnabled

boolean isExportEnabled()
Returns true if exporting is enabled in this gateway.

Returns:
true if exporting is enabled in this gateway

isImportEnabled

boolean isImportEnabled()
Returns true if importing is enabled in this gateway.

Returns:
true if importing is enabled in this gateway

isDisableCutOffDate

boolean isDisableCutOffDate()

setDisableCutOffDate

void setDisableCutOffDate(boolean disableCutOffDate)

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.