1 19 20 package com.sslexplorer.security; 21 22 import javax.servlet.http.HttpServletRequest ; 23 24 import org.apache.commons.logging.Log; 25 import org.apache.commons.logging.LogFactory; 26 import org.apache.struts.Globals; 27 import org.apache.struts.action.ActionForward; 28 import org.apache.struts.action.ActionMapping; 29 import org.apache.struts.action.ActionMessage; 30 import org.apache.struts.action.ActionMessages; 31 32 import com.sslexplorer.core.CoreUtil; 33 import com.sslexplorer.core.RedirectWithMessages; 34 import com.sslexplorer.core.actions.AuthenticatedAction; 35 36 37 55 public class AccountLock { 56 57 final static Log log = LogFactory.getLog(AccountLock.class); 58 59 61 private String username; 62 private int attempts; 63 private long lockedTime; 64 private int locks; 65 66 71 public AccountLock(String username) { 72 this.username = username; 73 attempts = 0; 74 lockedTime = -1; 75 locks = 0; 76 } 77 78 84 public int getLocks() { 85 return locks; 86 } 87 88 94 protected void setLocks(int locks) { 95 this.locks = locks; 96 } 97 98 103 public boolean isLocked() { 104 return lockedTime != -1; 105 } 106 107 113 public int getAttempts() { 114 return attempts; 115 } 116 117 123 protected void setAttempts(int attempts) { 124 this.attempts = attempts; 125 } 126 127 132 public long getLockedTime() { 133 return lockedTime; 134 } 135 136 141 protected void setLockedTime(long lockedTime) { 142 this.lockedTime = lockedTime; 143 } 144 145 150 public String getUsername() { 151 return username; 152 } 153 } | Popular Tags |