From 4660a906866d211e22395656c5d800709d1d15c2 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 26 Aug 2013 18:27:03 +0200 Subject: [PATCH] Improve name variable. --- .../devinsy/kiss4web/SimpleSecurityAgent.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/fr/devinsy/kiss4web/SimpleSecurityAgent.java b/src/fr/devinsy/kiss4web/SimpleSecurityAgent.java index 21921d1..05108dc 100644 --- a/src/fr/devinsy/kiss4web/SimpleSecurityAgent.java +++ b/src/fr/devinsy/kiss4web/SimpleSecurityAgent.java @@ -22,8 +22,8 @@ public class SimpleSecurityAgent private String accountIdLabel; private String authLabel; private String secretKey; - private static final int DEFAULT_DURATION = 60 * 60; // One hour. - private int duration; + private static final int DEFAULT_AUTHENTICATION_DURATION = 60 * 60; + private int authenticationDuration; /** * @@ -34,7 +34,7 @@ public class SimpleSecurityAgent this.accountIdLabel = prefix + "." + ACCOUNTID_LABEL; this.authLabel = prefix + "." + AUTH_LABEL; this.secretKey = secretKey; - this.duration = DEFAULT_DURATION; + this.authenticationDuration = DEFAULT_AUTHENTICATION_DURATION; } /** @@ -96,9 +96,9 @@ public class SimpleSecurityAgent * * @return */ - public int getDuration() + public int getAuthenticationDuration() { - return duration; + return authenticationDuration; } /** @@ -174,9 +174,9 @@ public class SimpleSecurityAgent // Refresh cookie. String auth = computeAuth(String.valueOf(accountId), userId, request.getRemoteAddr()); - response.addCookie(CookieHelper.buildCookie(this.authLabel, auth, this.duration)); - response.addCookie(CookieHelper.buildCookie(this.accountIdLabel, accountId, this.duration)); - response.addCookie(CookieHelper.buildCookie(this.userIdLabel, userId, this.duration)); + response.addCookie(CookieHelper.buildCookie(this.authLabel, auth, this.authenticationDuration)); + response.addCookie(CookieHelper.buildCookie(this.accountIdLabel, accountId, this.authenticationDuration)); + response.addCookie(CookieHelper.buildCookie(this.userIdLabel, userId, this.authenticationDuration)); logger.info("set [" + auth + "," + accountId + "," + userId + "," + request.getRemoteAddr() + ")"); } @@ -185,9 +185,9 @@ public class SimpleSecurityAgent * * @param duration */ - public void setDuration(final int duration) + public void setAuthenticationDuration(final int duration) { - this.duration = duration; + this.authenticationDuration = duration; } /**