com.atlassian.seraph.spi.rememberme
Interface RememberMeTokenDao


public interface RememberMeTokenDao

Each Seraph ready application needs to provide a spi Dao to hold and return remember me cookie information against a user.


Method Summary
 RememberMeToken findById(Long tokenId)
          Finds the token with the given id.
 List<RememberMeToken> findForUserName(String userName)
          This will return a list of the RememberMeToken that a user currently has.
 void remove(Long tokenId)
          Removes the specific token given the id

 void removeAll()
          Can be called to remove all tokens for all users.
 void removeAllForUser(String username)
          Called to remove ALL tokens that are stored for the specificed user

This method is not used by the Seraph code per se but its specified as part of the Atlassian RememberMe tech spec.

 RememberMeToken save(RememberMeToken token)
          This will be called to save the presented token to the database against the specified user.
 

Method Detail

findById

RememberMeToken findById(Long tokenId)
Finds the token with the given id. A caller must validate the token as it might be expired.

Parameters:
tokenId - the id of the token
Returns:
a RememberMeToken or null if one cant be found.

save

RememberMeToken save(RememberMeToken token)
This will be called to save the presented token to the database against the specified user. The id field will need to be filled out during this process.

Parameters:
token - the token in play
Returns:
a persisted token that has the correct database id filled out

findForUserName

List<RememberMeToken> findForUserName(String userName)
This will return a list of the RememberMeToken that a user currently has. A caller must validate the tokens as they might be expired.

This method is not used by the Seraph code per se but its specified as part of the Atlassian RememberMe tech spec.

Parameters:
userName - the username to look up tokens for
Returns:
a List or RememberMeTokens or an EMPTY list if there are none

remove

void remove(Long tokenId)
Removes the specific token given the id

Parameters:
tokenId - the id of the token to remove

removeAllForUser

void removeAllForUser(String username)
Called to remove ALL tokens that are stored for the specificed user

This method is not used by the Seraph code per se but its specified as part of the Atlassian RememberMe tech spec.

Parameters:
username - the username in question

removeAll

void removeAll()
Can be called to remove all tokens for all users.

This method is not used by the Seraph code per se but its specified as part of the Atlassian RememberMe tech spec.



Copyright © 2013 Atlassian. All Rights Reserved.