org.peabody.emailprocessor
Class EmailProcessorConfig

java.lang.Object
  extended by org.peabody.emailprocessor.EmailProcessorConfig

public class EmailProcessorConfig
extends java.lang.Object


Nested Class Summary
protected  class EmailProcessorConfig.EmailProcessorConfigContentHandler
          Handles the SAX2 events to parse the XML config file and configure the outer instance appropriately.
 
Field Summary
protected  java.util.Map<java.lang.String,MessageAction> messageActionMap
          This is a mapping of IDs to message actions, by which they are referred to in the XML config file(s).
protected  java.util.Map<MessageHook,java.util.List<MessageAction>> messageHookActionMap
          The mapping of which hook invokes which action(s)
protected  java.util.List<MessageHook> messageHookList
          This a list of the hooks against which messages will be processed, in sequence.
protected  MessageSource messageSource
          This is the source of where the messages will be gotten from.
 
Constructor Summary
EmailProcessorConfig()
          Makes a new instance.
 
Method Summary
 void addHookAction(MessageAction aMessageAction, MessageHook aMessageHook)
           
 void addHookAction(MessageAction aMessageAction, java.lang.String aMessageHookCategory)
           
 void addMessageAction(MessageAction aMessageAction)
           
 void addMessageHook(MessageHook aMessageHook)
           
 MessageAction getMessageAction(java.lang.String aMessageActionId)
           
 java.util.List<MessageAction> getMessageActionsForHook(MessageHook aMessageHook)
           
 java.util.List<MessageHook> getMessageHooks()
           
 MessageSource getMessageSource()
          Gets the message source
 void loadFromXML(java.io.File aFile)
          Loads a config from an XML file
 void loadFromXML(java.io.InputStream aInputStream)
          Loads a config from an XML file
 void loadFromXML(java.lang.String aFileString)
          Loads a config from an XML file
 void setMessageSource(MessageSource aMessageSource)
          Assigns the message source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messageSource

protected MessageSource messageSource
This is the source of where the messages will be gotten from. Only one allowed.


messageHookList

protected java.util.List<MessageHook> messageHookList
This a list of the hooks against which messages will be processed, in sequence.


messageHookActionMap

protected java.util.Map<MessageHook,java.util.List<MessageAction>> messageHookActionMap
The mapping of which hook invokes which action(s)


messageActionMap

protected java.util.Map<java.lang.String,MessageAction> messageActionMap
This is a mapping of IDs to message actions, by which they are referred to in the XML config file(s).

Constructor Detail

EmailProcessorConfig

public EmailProcessorConfig()
Makes a new instance. You then need to call the appropriate method to load in the configuration from a file or do it programmatically by calling the methods to configure it individually.

Method Detail

loadFromXML

public void loadFromXML(java.lang.String aFileString)
                 throws java.io.IOException
Loads a config from an XML file

Throws:
java.io.IOException

loadFromXML

public void loadFromXML(java.io.File aFile)
                 throws java.io.IOException
Loads a config from an XML file

Throws:
java.io.IOException

loadFromXML

public void loadFromXML(java.io.InputStream aInputStream)
                 throws java.io.IOException
Loads a config from an XML file

Throws:
java.io.IOException

setMessageSource

public void setMessageSource(MessageSource aMessageSource)
Assigns the message source


getMessageSource

public MessageSource getMessageSource()
Gets the message source


addMessageHook

public void addMessageHook(MessageHook aMessageHook)

addMessageAction

public void addMessageAction(MessageAction aMessageAction)

getMessageAction

public MessageAction getMessageAction(java.lang.String aMessageActionId)

addHookAction

public void addHookAction(MessageAction aMessageAction,
                          java.lang.String aMessageHookCategory)

addHookAction

public void addHookAction(MessageAction aMessageAction,
                          MessageHook aMessageHook)

getMessageHooks

public java.util.List<MessageHook> getMessageHooks()

getMessageActionsForHook

public java.util.List<MessageAction> getMessageActionsForHook(MessageHook aMessageHook)