Improve name variable.

This commit is contained in:
Christian P. MOMON 2013-08-26 18:27:03 +02:00
parent c714c57e4c
commit 4660a90686

View file

@ -22,8 +22,8 @@ public class SimpleSecurityAgent
private String accountIdLabel; private String accountIdLabel;
private String authLabel; private String authLabel;
private String secretKey; private String secretKey;
private static final int DEFAULT_DURATION = 60 * 60; // One hour. private static final int DEFAULT_AUTHENTICATION_DURATION = 60 * 60;
private int duration; private int authenticationDuration;
/** /**
* *
@ -34,7 +34,7 @@ public class SimpleSecurityAgent
this.accountIdLabel = prefix + "." + ACCOUNTID_LABEL; this.accountIdLabel = prefix + "." + ACCOUNTID_LABEL;
this.authLabel = prefix + "." + AUTH_LABEL; this.authLabel = prefix + "." + AUTH_LABEL;
this.secretKey = secretKey; this.secretKey = secretKey;
this.duration = DEFAULT_DURATION; this.authenticationDuration = DEFAULT_AUTHENTICATION_DURATION;
} }
/** /**
@ -96,9 +96,9 @@ public class SimpleSecurityAgent
* *
* @return * @return
*/ */
public int getDuration() public int getAuthenticationDuration()
{ {
return duration; return authenticationDuration;
} }
/** /**
@ -174,9 +174,9 @@ public class SimpleSecurityAgent
// Refresh cookie. // Refresh cookie.
String auth = computeAuth(String.valueOf(accountId), userId, request.getRemoteAddr()); String auth = computeAuth(String.valueOf(accountId), userId, request.getRemoteAddr());
response.addCookie(CookieHelper.buildCookie(this.authLabel, auth, this.duration)); response.addCookie(CookieHelper.buildCookie(this.authLabel, auth, this.authenticationDuration));
response.addCookie(CookieHelper.buildCookie(this.accountIdLabel, accountId, this.duration)); response.addCookie(CookieHelper.buildCookie(this.accountIdLabel, accountId, this.authenticationDuration));
response.addCookie(CookieHelper.buildCookie(this.userIdLabel, userId, this.duration)); response.addCookie(CookieHelper.buildCookie(this.userIdLabel, userId, this.authenticationDuration));
logger.info("set [" + auth + "," + accountId + "," + userId + "," + request.getRemoteAddr() + ")"); logger.info("set [" + auth + "," + accountId + "," + userId + "," + request.getRemoteAddr() + ")");
} }
@ -185,9 +185,9 @@ public class SimpleSecurityAgent
* *
* @param duration * @param duration
*/ */
public void setDuration(final int duration) public void setAuthenticationDuration(final int duration)
{ {
this.duration = duration; this.authenticationDuration = duration;
} }
/** /**