|
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.DefaultGatewayManager
public class DefaultGatewayManager
Manages gateways for a forum, which synchronize the forum with external data sources such as an NNTP newsgroup or email account.
Notes: The default implementation also only knows how to instantiate Gateway implementations that have either a default constructor or one that accepts a ForumFactory and Forum as arguments. The importing tasks and exportings tasks will only run on the machine that is designated as the senior cluster member. If this machine is removed from the cluster, the tasks will run on the next machine that becomes sr. cluster member.
Gateway
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.jivesoftware.forum.gateway.GatewayManager |
---|
GatewayManager.Type |
Field Summary | |
---|---|
static java.lang.String |
IMPORT_INTERVAL_PROPERTY
|
static java.lang.String |
IMPORT_THREAD_POOL_SIZE_PROPERTY
|
Fields inherited from interface com.jivesoftware.forum.gateway.GatewayManager |
---|
GATEWAY_EXPORT_RETRY |
Constructor Summary | |
---|---|
DefaultGatewayManager(ForumFactory factory)
Creates a new GatewayManager. |
Method Summary | |
---|---|
protected void |
clusterReInitialize()
This method is called by a cluster task to reset private variables with values from the database |
void |
create(Gateway gateway)
Allows you to add a new gateway to the system |
Gateway |
createGatewayInstance(Forum forum,
java.lang.String type)
Used to create and return an instance of a gateway based off the gateway settings, this gateway won't be installed as a new persistent gateway. |
void |
destroy()
Attempts to shutdown all threads associated with this class |
void |
executeOnce(Gateway gateway,
java.util.Date afterDate)
Used to execute a import/export on a gateway immediately, the gateway does not need to be a persistent gateway. |
void |
exportData(ForumMessage message)
Exports an individual message through all gateways. |
void |
forumAdded(ForumEvent event)
Fired when a forum has been added to the system. |
void |
forumDeleted(ForumEvent event)
Fired when a forum is about to be deleted from the system. |
void |
forumMerged(ForumEvent event)
Fired when a forum is merged into another forum. |
void |
forumModified(ForumEvent event)
Fired when a forum is modified. |
void |
forumMoved(ForumEvent event)
Fired when a forum has been moved from one category to another. |
Gateway |
getGateway(long gatewayID)
Returns a gateway by its id. |
java.util.Collection |
getGateways()
Returns all the gateways, this collection is unmodifiable. |
java.util.Collection |
getGateways(Forum forum)
Returns all the gateways for a forum. |
GlobalGatewaySettings |
getGlobalGatewaySettings()
Returns the global settings for gateways. |
void |
initialize()
Initialize the manager. |
void |
jivePropertyAdded(JivePropertyEvent jivePropertyEvent)
If the import interval jive property is changed the import task timer is restarted with the new value |
void |
jivePropertyModified(JivePropertyEvent jivePropertyEvent)
Restart the import interval if the jive proeprty is changed |
void |
jivePropertyRemoved(JivePropertyEvent jivePropertyEvent)
If the import interval jive property is changed the import task timer is restarted with the new value |
void |
registerCustomGatewayType(java.lang.String type,
java.lang.Class clazz)
Used to register a custom gateway manager implementation. |
void |
remove(Forum forum)
Deletes all gateways for this context by removing their properties and stopping them from running. |
void |
remove(Gateway gateway)
Delete a specific gateway |
protected void |
startImportTask()
Start/restart the gateway import task |
void |
update(Gateway gateway)
This method must be called if gateway settings changes are to be persisted. |
void |
update(GlobalGatewaySettings globalGatewaySettings)
Updates the global gateway setting. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String IMPORT_INTERVAL_PROPERTY
public static final java.lang.String IMPORT_THREAD_POOL_SIZE_PROPERTY
Constructor Detail |
---|
public DefaultGatewayManager(ForumFactory factory)
Method Detail |
---|
public void create(Gateway gateway)
create
in interface GatewayManager
gateway
- The gatway to addpublic void update(Gateway gateway)
update
in interface GatewayManager
gateway
- gateway who settings to persistpublic void remove(Forum forum)
remove
in interface GatewayManager
public void remove(Gateway gateway) throws UnauthorizedException
GatewayManager
remove
in interface GatewayManager
UnauthorizedException
public java.util.Collection getGateways(Forum forum)
getGateways
in interface GatewayManager
forum
- forum to grab gateways for
public java.util.Collection getGateways()
getGateways
in interface GatewayManager
public void jivePropertyAdded(JivePropertyEvent jivePropertyEvent)
jivePropertyAdded
in interface JivePropertyListener
jivePropertyEvent
- eventpublic void jivePropertyRemoved(JivePropertyEvent jivePropertyEvent)
jivePropertyRemoved
in interface JivePropertyListener
jivePropertyEvent
- eventpublic void jivePropertyModified(JivePropertyEvent jivePropertyEvent)
jivePropertyModified
in interface JivePropertyListener
jivePropertyEvent
- eventpublic void exportData(ForumMessage message)
message
- the message to export.public void registerCustomGatewayType(java.lang.String type, java.lang.Class clazz)
type
- type of managerclazz
- class to usepublic Gateway createGatewayInstance(Forum forum, java.lang.String type) throws UnauthorizedException
createGatewayInstance
in interface GatewayManager
forum
- forum to create the gateway fortype
- type of gateway to create
UnauthorizedException
public Gateway getGateway(long gatewayID)
GatewayManager
getGateway
in interface GatewayManager
gatewayID
- unique id of the gateway
public void initialize()
JiveManager
This method is used internally by Jive during application startup and should not be called during normal usage of the class.
initialize
in interface JiveManager
protected void clusterReInitialize()
public void destroy()
destroy
in interface JiveManager
protected void startImportTask()
public void executeOnce(Gateway gateway, java.util.Date afterDate)
executeOnce
in interface GatewayManager
gateway
- gateway to executeafterDate
- acquire messages after this datepublic void update(GlobalGatewaySettings globalGatewaySettings)
GatewayManager
update
in interface GatewayManager
globalGatewaySettings
- globals settings to updatepublic GlobalGatewaySettings getGlobalGatewaySettings()
GatewayManager
getGlobalGatewaySettings
in interface GatewayManager
public void forumAdded(ForumEvent event)
ForumListener
forumAdded
in interface ForumListener
event
- the event object.public void forumDeleted(ForumEvent event)
ForumListener
forumDeleted
in interface ForumListener
event
- the event object.public void forumModified(ForumEvent event)
ForumListener
forumModified
in interface ForumListener
event
- the event object.public void forumMoved(ForumEvent event)
ForumListener
forumMoved
in interface ForumListener
event
- the event object.public void forumMerged(ForumEvent event)
ForumListener
forumMerged
in interface ForumListener
event
- the event object.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |