egovframework.rfc3.iam.security.authentication.rememberme
Class JdbcTokenRepositoryImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.jdbc.core.support.JdbcDaoSupport
          extended by egovframework.rfc3.iam.security.authentication.rememberme.JdbcTokenRepositoryImpl
All Implemented Interfaces:
PersistentTokenRepository, org.springframework.beans.factory.InitializingBean

public class JdbcTokenRepositoryImpl
extends org.springframework.jdbc.core.support.JdbcDaoSupport
implements PersistentTokenRepository

JDBC based persistent login token repository implementation.

Since:
2.0
Author:
Luke Taylor

Field Summary
static java.lang.String CREATE_TABLE_SQL
          Default SQL for creating the database table to store the tokens
static java.lang.String DEF_INSERT_TOKEN_SQL
          The default SQL used by createNewToken
static java.lang.String DEF_REMOVE_CURRENT_TOKENS_SQL
          tokenValiditySeconds 보다 지난 인증키 삭제
static java.lang.String DEF_REMOVE_USER_TOKENS_SQL
          The default SQL used by removeUserTokens
static java.lang.String DEF_TOKEN_BY_SERIES_SQL
          The default SQL used by the getTokenBySeries query
static java.lang.String DEF_UPDATE_TOKEN_SQL
          The default SQL used by updateToken
 
Constructor Summary
JdbcTokenRepositoryImpl()
           
 
Method Summary
 void createNewToken(PersistentRememberMeToken token)
           
 PersistentRememberMeToken getTokenForSeries(java.lang.String seriesId)
          Loads the token data for the supplied series identifier.
 void removeCurTokens(java.util.Date date)
           
 void removeUserTokens(java.lang.String series)
           
 void setCreateTableOnStartup(boolean createTableOnStartup)
          Intended for convenience in debugging.
 void updateToken(java.lang.String series, java.lang.String tokenValue, java.util.Date lastUsed, java.lang.String userIp)
           
 
Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupport
getDataSource, getJdbcTemplate, setDataSource, setJdbcTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE_TABLE_SQL

public static final java.lang.String CREATE_TABLE_SQL
Default SQL for creating the database table to store the tokens

See Also:
Constant Field Values

DEF_TOKEN_BY_SERIES_SQL

public static final java.lang.String DEF_TOKEN_BY_SERIES_SQL
The default SQL used by the getTokenBySeries query

See Also:
Constant Field Values

DEF_INSERT_TOKEN_SQL

public static final java.lang.String DEF_INSERT_TOKEN_SQL
The default SQL used by createNewToken

See Also:
Constant Field Values

DEF_UPDATE_TOKEN_SQL

public static final java.lang.String DEF_UPDATE_TOKEN_SQL
The default SQL used by updateToken

See Also:
Constant Field Values

DEF_REMOVE_USER_TOKENS_SQL

public static final java.lang.String DEF_REMOVE_USER_TOKENS_SQL
The default SQL used by removeUserTokens

See Also:
Constant Field Values

DEF_REMOVE_CURRENT_TOKENS_SQL

public static final java.lang.String DEF_REMOVE_CURRENT_TOKENS_SQL
tokenValiditySeconds 보다 지난 인증키 삭제

See Also:
Constant Field Values
Constructor Detail

JdbcTokenRepositoryImpl

public JdbcTokenRepositoryImpl()
Method Detail

createNewToken

public void createNewToken(PersistentRememberMeToken token)
Specified by:
createNewToken in interface PersistentTokenRepository

updateToken

public void updateToken(java.lang.String series,
                        java.lang.String tokenValue,
                        java.util.Date lastUsed,
                        java.lang.String userIp)
Specified by:
updateToken in interface PersistentTokenRepository

getTokenForSeries

public PersistentRememberMeToken getTokenForSeries(java.lang.String seriesId)
Loads 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:
getTokenForSeries in interface PersistentTokenRepository
Parameters:
seriesId -
Returns:
the token matching the series, or null if no match found or an exception occurred.

removeUserTokens

public void removeUserTokens(java.lang.String series)
Specified by:
removeUserTokens in interface PersistentTokenRepository

removeCurTokens

public void removeCurTokens(java.util.Date date)
Specified by:
removeCurTokens in interface PersistentTokenRepository

setCreateTableOnStartup

public 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