Tidying up class.

This commit is contained in:
Luke Taylor 2007-09-12 19:55:52 +00:00
parent c0f5230667
commit ae40919d13
1 changed files with 13 additions and 19 deletions

View File

@ -102,8 +102,7 @@ import org.springframework.web.bind.RequestUtils;
* benalex $ * benalex $
*/ */
public class TokenBasedRememberMeServices implements RememberMeServices, InitializingBean, LogoutHandler { public class TokenBasedRememberMeServices implements RememberMeServices, InitializingBean, LogoutHandler {
// ~ Static fields/initializers //~ Static fields/initializers =====================================================================================
// =====================================================================================
public static final String ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY = "ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE"; public static final String ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY = "ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE";
@ -111,8 +110,7 @@ public class TokenBasedRememberMeServices implements RememberMeServices, Initial
protected static final Log logger = LogFactory.getLog(TokenBasedRememberMeServices.class); protected static final Log logger = LogFactory.getLog(TokenBasedRememberMeServices.class);
// ~ Instance fields //~ Instance fields ================================================================================================
// ================================================================================================
protected AuthenticationDetailsSource authenticationDetailsSource = new AuthenticationDetailsSourceImpl(); protected AuthenticationDetailsSource authenticationDetailsSource = new AuthenticationDetailsSourceImpl();
@ -126,12 +124,9 @@ public class TokenBasedRememberMeServices implements RememberMeServices, Initial
private boolean alwaysRemember = false; private boolean alwaysRemember = false;
private static final int DEFAULT_ORDER = Integer.MAX_VALUE; // ~ default
private String cookieName = ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY; private String cookieName = ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY;
// ~ Methods //~ Methods ========================================================================================================
// ========================================================================================================
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
Assert.hasLength(key); Assert.hasLength(key);
@ -155,7 +150,7 @@ public class TokenBasedRememberMeServices implements RememberMeServices, Initial
if (map.size() > 1) { if (map.size() > 1) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"More than one UserDetailsService beans detected please refer to the one using " "More than one UserDetailsService beans detected please refer to the one using "
+ " [ principalRepositoryBeanRef ] " + "attribute"); + " [ principalRepositoryBeanRef ] attribute");
} }
else if (map.size() == 1) { else if (map.size() == 1) {
setUserDetailsService((UserDetailsService) map.values().iterator().next()); setUserDetailsService((UserDetailsService) map.values().iterator().next());
@ -397,9 +392,8 @@ public class TokenBasedRememberMeServices implements RememberMeServices, Initial
response.addCookie(makeValidCookie(tokenValueBase64, request, tokenValiditySeconds)); response.addCookie(makeValidCookie(tokenValueBase64, request, tokenValiditySeconds));
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger logger.debug("Added remember-me cookie for user '"
.debug("Added remember-me cookie for user '" + username + "', expiry: '" + new Date(expiryTime) + username + "', expiry: '" + new Date(expiryTime) + "'");
+ "'");
} }
} }