|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.base.event.UserListenerAdapter
com.jivesoftware.forum.database.DbEmailTokenManager
public class DbEmailTokenManager
Implementation of EmailTokenManager
which associates random numbers with user ids
and stores them in the database. Generates tokens of the form [randomValue-userID-messageID]. Tokens have a time
to live in the system of 7 days. After that, a reaper task will delete them from the cache and database, and any emails
sent with those token values will be rejected.
Method Summary | |
---|---|
void |
destroy()
Called during application shutdown. |
static DbEmailTokenManager |
getInstance()
Returns the singleton instance. |
java.lang.String |
getMessageToken(long userID,
long messageID)
Returns a token of the form [randomValue-userID-messageID]. |
java.util.regex.Pattern |
getTokenPattern()
Returns the Pattern which matches tokens created by this token manager. |
long[] |
getUserAndMessageID(java.lang.String messageToken)
Returns the userID and messageID encoded in the token as a two element array. |
long |
getUserID(java.lang.String messageToken)
Returns just the user id as found in the supplied token string. |
void |
initialize()
Called during application startup. |
void |
userDeleted(UserEvent event)
Called when a user is deleted. |
Methods inherited from class com.jivesoftware.base.event.UserListenerAdapter |
---|
userCreated, userModified |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void initialize()
initialize
in interface JiveManager
public void destroy()
destroy
in interface JiveManager
public static DbEmailTokenManager getInstance()
public java.lang.String getMessageToken(long userID, long messageID) throws EmailMonitorException
getUserAndMessageID(java.lang.String)
to retrieve the userID and messageID. Tokens expire after 7 days. The random part
of the token is generated once per day per user.
getMessageToken
in interface EmailTokenManager
userID
- the userID to associate with and encode into the token.messageID
- the message id to encode into the token.
EmailMonitorException
- if an underlying exception is thrown during token creation.public long[] getUserAndMessageID(java.lang.String messageToken) throws EmailMonitorException
EmailMonitorException
is thrown.
getUserAndMessageID
in interface EmailTokenManager
messageToken
- the token to read.
EmailMonitorException
- if an underlying exception is thrown during token lookup and authentication, or if
the token has expired.public long getUserID(java.lang.String messageToken)
getUserID
in interface EmailTokenManager
messageToken
- the token string to search for a user id.
public java.util.regex.Pattern getTokenPattern()
Pattern
which matches tokens created by this token manager.
getTokenPattern
in interface EmailTokenManager
Pattern
which matches tokens created by this token manager.public void userDeleted(UserEvent event)
userDeleted
in interface UserListener
userDeleted
in class UserListenerAdapter
event
- the UserEvent containing the affected user.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |