Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community.mail
Interface EmailTokenManager


public interface EmailTokenManager

Manages email tokens. Email tokens are set in emails so that user authentication can be performed on reply emails. Implementors of this interface handle the token creation and encoding, parsing, and lookup of parsed user data.


Method Summary
 void deleteUserEmailTokens(User user)
          Called before a user is deleted.
 String getMessageToken(long userID, long messageID)
          Uses the supplied user id and message id to build a token string which can be used to identify and authenticate that user and message.
 Pattern getTokenPattern()
          Returns a Pattern which matches any email token generated by this EmailTokenManager instance.
 long[] getUserAndMessageID(String messageToken)
          Uses the supplied token string to lookup a user id and forums message id.
 long getUserID(String messageToken)
          Returns just the user id as found in the supplied token string.
 

Method Detail

getMessageToken

String getMessageToken(long userID,
                       long messageID)
                       throws com.jivesoftware.community.mail.EmailMonitorException
Uses the supplied user id and message id to build a token string which can be used to identify and authenticate that user and message.

Parameters:
userID - the user id to encode.
messageID - the message id to encode.
Returns:
the unique token identifying the message and user.
Throws:
EmailMonitorException - if an attempt to create a new token fails.

getUserAndMessageID

long[] getUserAndMessageID(String messageToken)
                           throws com.jivesoftware.community.mail.EmailMonitorException
Uses the supplied token string to lookup a user id and forums message id. Information in the supplied token will be used to authenticate the user.

Parameters:
messageToken - the token containing encoded data.
Returns:
a two element array consisting if user id and message id.
Throws:
EmailMonitorException - if an the token does not correspond to an existing user or message id or if the token has expirec.

getUserID

long getUserID(String messageToken)
Returns just the user id as found in the supplied token string.

Parameters:
messageToken - the token string to search for a user id.
Returns:
the user id as found in the supplied token string.

getTokenPattern

Pattern getTokenPattern()
Returns a Pattern which matches any email token generated by this EmailTokenManager instance.

Returns:
a Pattern which matches any email token generated by this EmailTokenManager instance.

deleteUserEmailTokens

void deleteUserEmailTokens(User user)
Called before a user is deleted. All tokens associated with the user are deleted from the cache and the database.

Parameters:
user - the owner of the tokens being deleted.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.