Class JdbcTokenRepositoryImpl
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.jdbc.core.support.JdbcDaoSupport
org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean,- PersistentTokenRepository
public class JdbcTokenRepositoryImpl
extends org.springframework.jdbc.core.support.JdbcDaoSupport
implements PersistentTokenRepository
JDBC based persistent login token repository implementation.
- Since:
- 2.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringDefault SQL for creating the database table to store the tokensstatic final StringThe default SQL used by createNewTokenstatic final StringThe default SQL used by removeUserTokensstatic final StringThe default SQL used by the getTokenBySeries querystatic final StringThe default SQL used by updateTokenFields inherited from class org.springframework.dao.support.DaoSupportlogger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidgetTokenForSeries(String seriesId) Loads the token data for the supplied series identifier.protected voidinitDao()voidremoveUserTokens(String username) voidsetCreateTableOnStartup(boolean createTableOnStartup) Intended for convenience in debugging.voidupdateToken(String series, String tokenValue, Date lastUsed) Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupportcheckDaoConfig, createJdbcTemplate, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, initTemplateConfig, releaseConnection, setDataSource, setJdbcTemplateMethods inherited from class org.springframework.dao.support.DaoSupportafterPropertiesSet
- 
Field Details- 
CREATE_TABLE_SQLDefault SQL for creating the database table to store the tokens- See Also:
 
- 
DEF_TOKEN_BY_SERIES_SQLThe default SQL used by the getTokenBySeries query- See Also:
 
- 
DEF_INSERT_TOKEN_SQLThe default SQL used by createNewToken- See Also:
 
- 
DEF_UPDATE_TOKEN_SQLThe default SQL used by updateToken- See Also:
 
- 
DEF_REMOVE_USER_TOKENS_SQLThe default SQL used by removeUserTokens- See Also:
 
 
- 
- 
Constructor Details- 
JdbcTokenRepositoryImplpublic JdbcTokenRepositoryImpl()
 
- 
- 
Method Details- 
initDaoprotected void initDao()- Overrides:
- initDaoin class- org.springframework.dao.support.DaoSupport
 
- 
createNewToken- Specified by:
- createNewTokenin interface- PersistentTokenRepository
 
- 
updateToken- Specified by:
- updateTokenin interface- PersistentTokenRepository
 
- 
getTokenForSeriesLoads the token data for the supplied series identifier. If an error occurs, it will be reported and null will be returned (since the result should just be a failed persistent login).- Specified by:
- getTokenForSeriesin interface- PersistentTokenRepository
- Parameters:
- seriesId-
- Returns:
- the token matching the series, or null if no match found or an exception occurred.
 
- 
removeUserTokens- Specified by:
- removeUserTokensin interface- PersistentTokenRepository
 
- 
setCreateTableOnStartuppublic void setCreateTableOnStartup(boolean createTableOnStartup) Intended for convenience in debugging. Will create the persistent_tokens database table when the class is initialized during the initDao method.- Parameters:
- createTableOnStartup- set to true to execute the
 
 
-