com.admc.jamama
Interface Router

All Superinterfaces:
Configurable
All Known Subinterfaces:
Director
All Known Implementing Classes:
JamamaDirector, SmtpRouter

public interface Router
extends Configurable

A Configurable Jamama object that can filter/forward/consume a Mit.

See Also:
Mit

Field Summary
static int STATUS_CONTINUE
          Continue-default-routing return status for the router() method
static int STATUS_DEFER
          Defer-this-message return status for the router() method.
static int STATUS_DROP
          Drop-this-message return status for the router() method.
static int STATUS_EXPLICITROUTE
          Continue-specific-routing return status for the router() method
static int STATUS_FREEZE
          Freeze-this-message return status for the router() method.
static int STATUS_SUCCESS
          Success return status for the router() method
 
Method Summary
 RepositoryDependency[] getNeedRepositories()
          Returns names of the repositories needed.
 java.lang.String[] getNeedRouters()
          Returns names of all Routers that this Router may forward to.
 int route(Mit mit, boolean ping, Repository[] repositoryList)
          Processes a Mit, with a goal of approaching or achieving Mit consumption or rejection.
 
Methods inherited from interface com.admc.jamama.Configurable
configure, getConfig, getName
 

Field Detail

STATUS_SUCCESS

public static final int STATUS_SUCCESS
Success return status for the router() method

See Also:
Constant Field Values

STATUS_CONTINUE

public static final int STATUS_CONTINUE
Continue-default-routing return status for the router() method

See Also:
Constant Field Values

STATUS_EXPLICITROUTE

public static final int STATUS_EXPLICITROUTE
Continue-specific-routing return status for the router() method

See Also:
Constant Field Values

STATUS_DROP

public static final int STATUS_DROP
Drop-this-message return status for the router() method.

See Also:
Constant Field Values

STATUS_FREEZE

public static final int STATUS_FREEZE
Freeze-this-message return status for the router() method.

See Also:
Constant Field Values

STATUS_DEFER

public static final int STATUS_DEFER
Defer-this-message return status for the router() method.

See Also:
Constant Field Values
Method Detail

getNeedRouters

public java.lang.String[] getNeedRouters()
Returns names of all Routers that this Router may forward to.

Returns:
Set of names of routers which could possibly be forward to by this router with this configuration

getNeedRepositories

public RepositoryDependency[] getNeedRepositories()
Returns names of the repositories needed. The list gets updated every time that the configuration runs, so that users can change repositories at runtime.

Returns:
list of names of repositories which could possibly be required by this router with current configuration.

route

public int route(Mit mit,
                 boolean ping,
                 Repository[] repositoryList)
Processes a Mit, with a goal of approaching or achieving Mit consumption or rejection. N.b. this method uses return values to indicate any expected routing failures, it does not throw Exceptions for that purpose. If a router returns STATUS_DROP or STATUS_FREEZE, then this router should send a bounce message if appropriate. This is because the caller of route() may not know whether a bounce is appropriate. Successful consumption is achieved by returning STATUS_SUCCESS. Unsuccessful consumption is achieved by returning STATUS_DROP. Pure filtering (i.e. filtering without consuming) is achieved by conditionally returning STATUS_DROP, STATUS_CONTINUE, STATUS_EXPLICITROUTE, etc. If a router() method has one resolution for some recipient(s) and some other resolution for any other recipient(s), then it must proceed with one (group) and just clone and persist the Mit for the other recipient(s). The Director will pick up the new Mit instance and route it when it can.

Returns:
An indication of how the Mit should be processed next.