Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.mail.spi
Class EmailIntegrationProvider

java.lang.Object
  extended by com.jivesoftware.forum.mail.spi.EmailIntegrationProvider
Direct Known Subclasses:
DefaultIntegrationProvider

public abstract class EmailIntegrationProvider
extends java.lang.Object

Interface to allow some degree of pluggability in the email integration features. Implementors of this interface can determine which messages will be used or ignored by the system, how the message contents are parsed, which actions can occur, and how message tokens are evaluated. A default implementation exists (DefaultIntegrationProvider), and it is probably better to subclass it than to implement this interface directly if you only want to add functionality rather than override it.


Constructor Summary
EmailIntegrationProvider()
           
 
Method Summary
abstract  boolean canProcessMessage(javax.mail.Message message)
          Returns true if the supplied Message is one which the system can do something useful with.
protected abstract  EmailActionBuilder getActionBuilder()
          Returns an EmailActionBuilder which can build EmailAction instances for any email message where calls to canProcessMessage(javax.mail.Message) return true.
 EmailAction getActionForMessage(InboundMessage message)
          Creates and returns an EmailAction which represents the response to the supplied InboundMessage.
protected abstract  EmailParser getParser(InboundMessage message)
          Returns an EmailParser initilized with the supplied InboundMessage.
abstract  EmailTokenManager getTokenManager()
          Returns an EmailTokenManager instance for reading and creating message tokens.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailIntegrationProvider

public EmailIntegrationProvider()
Method Detail

canProcessMessage

public abstract boolean canProcessMessage(javax.mail.Message message)
                                   throws javax.mail.MessagingException,
                                          java.io.IOException
Returns true if the supplied Message is one which the system can do something useful with. In general, the contents of the subject and any other headers are examined for patterns which indicate it is really intended for forums to deal with and not junk mail.

Parameters:
message - the message to examine.
Returns:
true if the supplied Message is one which the system can do something useful with.
Throws:
javax.mail.MessagingException - if accessing the message data fails.
java.io.IOException - if accessing the messge data fails.

getTokenManager

public abstract EmailTokenManager getTokenManager()
Returns an EmailTokenManager instance for reading and creating message tokens.

Returns:
an EmailTokenManager instance for reading and creating message tokens.

getActionBuilder

protected abstract EmailActionBuilder getActionBuilder()
Returns an EmailActionBuilder which can build EmailAction instances for any email message where calls to canProcessMessage(javax.mail.Message) return true.

Returns:
an EmailActionBuilder which can build EmailAction instances for any email message where calls to canProcessMessage(javax.mail.Message) return true.

getParser

protected abstract EmailParser getParser(InboundMessage message)
                                  throws EmailMonitorException
Returns an EmailParser initilized with the supplied InboundMessage. Calling EmailParser.parse(com.jivesoftware.forum.mail.InboundMessage) will parse the message and make its relevant contents available through accessor properties of the parser instance.

Parameters:
message - the message to parse.
Returns:
an EmailParser initilized with the supplied InboundMessage.
Throws:
EmailMonitorException - if no parser can be determined, or if any access of the message contents fails.

getActionForMessage

public EmailAction getActionForMessage(InboundMessage message)
                                throws EmailMonitorException
Creates and returns an EmailAction which represents the response to the supplied InboundMessage.

Parameters:
message - the message to read, parse, and create a corresponding action for.
Returns:
an EmailAction in response to the suppliec InboundMessage.
Throws:
EmailMonitorException - if an error occurs while reading or parsing the message, or if no appropriate response action can be determined.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.