com.admc.jamama.router
Class SmtpRouter

java.lang.Object
  extended byAbstractDynamicMBean
      extended bycom.admc.jamama.router.SmtpRouter
All Implemented Interfaces:
Configurable, Router

public class SmtpRouter
extends AbstractDynamicMBean
implements Router

A router that routes TO SMTP.

See Also:
Mit, Serialized Form

Field Summary
 
Fields inherited from interface com.admc.jamama.Router
STATUS_CONTINUE, STATUS_DEFER, STATUS_DROP, STATUS_EXPLICITROUTE, STATUS_FREEZE, STATUS_SUCCESS
 
Constructor Summary
SmtpRouter()
           
 
Method Summary
 void configure(java.lang.Object inCfg)
          Initialize the object's state with information in the given Jaxb object.
 java.lang.Object getConfig()
          Returns the Jaxb object used to configure this.
protected  java.lang.String getMBeanDescription()
           
 java.lang.String getName()
          Name which Jamama config file uses to identify this object instance.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmtpRouter

public SmtpRouter()
Method Detail

getMBeanDescription

protected java.lang.String getMBeanDescription()

getNeedRouters

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

Specified by:
getNeedRouters in interface Router
Returns:
Set of names of routers which could possibly be forward to by this router with this configuration
See Also:
Router

getNeedRepositories

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

Specified by:
getNeedRepositories in interface Router
Returns:
list of names of repositories which could possibly be required by this router with current configuration.
See Also:
Router

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.

Specified by:
route in interface Router
Returns:
An indication of how the Mit should be processed next.
See Also:
Router

configure

public void configure(java.lang.Object inCfg)
Description copied from interface: Configurable
Initialize the object's state with information in the given Jaxb object.

Specified by:
configure in interface Configurable
Parameters:
inCfg - A Jaxb object corresponding to a XML document branch.
See Also:
Configurable

getName

public java.lang.String getName()
Description copied from interface: Configurable
Name which Jamama config file uses to identify this object instance.

Specified by:
getName in interface Configurable
See Also:
Configurable

getConfig

public java.lang.Object getConfig()
Description copied from interface: Configurable
Returns the Jaxb object used to configure this.

Specified by:
getConfig in interface Configurable
See Also:
Configurable