Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.mail
Class EmailParserImpl

java.lang.Object
  extended by com.jivesoftware.forum.mail.EmailParserImpl
All Implemented Interfaces:
EmailParser

public class EmailParserImpl
extends java.lang.Object
implements EmailParser

Default implementation of EmailParser which relies on the presence of a special token in the email subject which contains data used for user authentication an message routing when reading replies to watch notification email replies.


Constructor Summary
EmailParserImpl(EmailTokenManager emailTokenManager)
          Sole constructor which takes an EmailTokenManager to read incoming mail tokens.
 
Method Summary
 java.lang.String getBody()
          Returns the body of the message
 long getObjectID()
          Returns the id of the object to act on.
 int getObjectType()
          Returns the object type (Forum, Message, etc) to act on.
 java.lang.String getSubject()
          Returns the subject of the message
 long getUserID()
          Returns the user id of the sender
 void parse(InboundMessage message)
          Parses the contents of the supplied Message and uses it to populate all the properties exposed by this object.
 boolean parseCompleted()
          Returns true if parse(com.jivesoftware.forum.mail.InboundMessage) has been called and successfully completed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailParserImpl

public EmailParserImpl(EmailTokenManager emailTokenManager)
Sole constructor which takes an EmailTokenManager to read incoming mail tokens.

Parameters:
emailTokenManager - an EmailTokenManager to read incoming mail tokens.
Method Detail

getUserID

public long getUserID()
Returns the user id of the sender

Specified by:
getUserID in interface EmailParser
Returns:
the user id of the sender

getObjectType

public int getObjectType()
Returns the object type (Forum, Message, etc) to act on.

Specified by:
getObjectType in interface EmailParser
Returns:
the object type (Forum, Message, etc) to act on.

getObjectID

public long getObjectID()
Returns the id of the object to act on.

Specified by:
getObjectID in interface EmailParser
Returns:
the id of the object to act on.

getSubject

public java.lang.String getSubject()
Returns the subject of the message

Specified by:
getSubject in interface EmailParser
Returns:
the subject of the message

getBody

public java.lang.String getBody()
Returns the body of the message

Specified by:
getBody in interface EmailParser
Returns:
the body of the message

parseCompleted

public boolean parseCompleted()
Returns true if parse(com.jivesoftware.forum.mail.InboundMessage) has been called and successfully completed.

Specified by:
parseCompleted in interface EmailParser
Returns:
true if parse(com.jivesoftware.forum.mail.InboundMessage) has been called and successfully completed.

parse

public void parse(InboundMessage message)
           throws EmailMonitorException
Parses the contents of the supplied Message and uses it to populate all the properties exposed by this object.

Specified by:
parse in interface EmailParser
Parameters:
message - the InboundMessage to parse.
Throws:
EmailMonitorException - if parsing fails for any reason.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.