Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.gateway
Interface GatewayManager

All Known Implementing Classes:
DefaultGatewayManager, GatewayManagerProxy

public interface GatewayManager

Manages all gateways in the system.

There are two kinds of gateways, persistent and nonpersitent. Persistent gateways are gateways that have been set into the manager using the create(Gateway) method, this gateways exporters and importers are ran all the time by background tasks. When the server goes done, these gateways will be recreated.

To create a persistent gateway:
Gateway gateway = gatewayManager.createGatewayInstance(forum, "TYPE"); ... configure ... gatewayManager.create(gateway);

Non-persistent gateways are created to perform a one time import or export.

To do a one time import:
Gateway gateway = gatewayManager.createGatewayInstance(forum, "TYPE"); ... configure ... gatewayManager.executeOnce(gateway, date);

See Also:
Gateway

Nested Class Summary
static class GatewayManager.Type
          Possbile values for gateways types.
 
Field Summary
static java.lang.String GATEWAY_EXPORT_RETRY
          Property placed on messages that should be rexported
 
Method Summary
 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 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.
 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 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
 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.
 

Field Detail

GATEWAY_EXPORT_RETRY

static final java.lang.String GATEWAY_EXPORT_RETRY
Property placed on messages that should be rexported

See Also:
Constant Field Values
Method Detail

create

void create(Gateway gateway)
            throws UnauthorizedException
Allows you to add a new gateway to the system

Parameters:
gateway - The gatway to add
Throws:
UnauthorizedException

update

void update(Gateway gateway)
            throws UnauthorizedException
This method must be called if gateway settings changes are to be persisted.

Parameters:
gateway - gateway who settings to persist
Throws:
UnauthorizedException

update

void update(GlobalGatewaySettings globalGatewaySettings)
Updates the global gateway setting.

Parameters:
globalGatewaySettings - globals settings to update

remove

void remove(Forum forum)
            throws UnauthorizedException
Deletes all gateways for this context by removing their properties and stopping them from running.

Throws:
UnauthorizedException

remove

void remove(Gateway gateway)
            throws UnauthorizedException
Delete a specific gateway

Throws:
UnauthorizedException

getGateways

java.util.Collection getGateways(Forum forum)
                                 throws UnauthorizedException
Returns all the gateways for a forum. You cannot add/ gateways using this mechanism, you must use the create/remove/update methods.

Parameters:
forum - forum to grab gateways for
Returns:
all the gateways for the forum or an empty collecion if there are none.
Throws:
UnauthorizedException

getGateways

java.util.Collection getGateways()
                                 throws UnauthorizedException
Returns all the gateways, this collection is unmodifiable. You cannot add/ gateways using this mechanism, you must use the create/remove/update methods.

Returns:
all the gateways or an empty collection if there are none.
Throws:
UnauthorizedException

getGateway

Gateway getGateway(long gatewayID)
                   throws UnauthorizedException
Returns a gateway by its id. If no gateway exists for this id null will be returned.

Parameters:
gatewayID - unique id of the gateway
Returns:
the gateway object that matches the id, if none then null.
Throws:
UnauthorizedException - Thrown if the user does not have access rights for acquiring a gateway object.

getGlobalGatewaySettings

GlobalGatewaySettings getGlobalGatewaySettings()
Returns the global settings for gateways.

Returns:
global settings for gateways.

createGatewayInstance

Gateway createGatewayInstance(Forum forum,
                              java.lang.String type)
                              throws UnauthorizedException
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. If you wish to do that you must call the create(Gateway) method

Parameters:
forum - forum to create this gateway for
type - type of gateway to create
Returns:
an instance of the gateway
Throws:
UnauthorizedException

executeOnce

void executeOnce(Gateway gateway,
                 java.util.Date afterDate)
                 throws UnauthorizedException
Used to execute a import/export on a gateway immediately, the gateway does not need to be a persistent gateway.

Usually the gateway passed in will have either have import enabled or export enabled, but probably not both.

Parameters:
gateway - gateway to execute
afterDate - acquire messages after this date
Throws:
UnauthorizedException

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.