1 19 20 package com.sslexplorer.security; 21 22 import java.util.List ; 23 import java.util.Map ; 24 25 import javax.servlet.http.HttpServletRequest ; 26 import javax.servlet.http.HttpServletResponse ; 27 import javax.servlet.http.HttpSession ; 28 29 import com.sslexplorer.boot.RequestHandlerRequest; 30 import com.sslexplorer.boot.RequestHandlerResponse; 31 import com.sslexplorer.properties.PropertyProfile; 32 33 36 public interface LogonController { 37 public final static int ACCOUNT_UNKNOWN = -1; 38 public final static int ACCOUNT_GRANTED = 0; 39 public final static int ACCOUNT_DISABLED = 1; 40 public final static int ACCOUNT_LOCKED = 2; 41 public final static int ACCOUNT_REVOKED = 3; 42 public final static int ACCOUNT_ACTIVE = 4; 43 public final static int NOT_LOGGED_ON = 0; 44 public final static int LOGGED_ON = 1; 45 public final static int INVALID_TICKET = 2; 46 47 53 public abstract void init(); 54 55 public abstract boolean isAdministrator(User principal); 56 57 public abstract int addSessionTimeoutBlock(HttpSession session, String reason); 58 59 public abstract void removeSessionTimeoutBlock(HttpSession session, int sessionTimeoutBlockId); 60 61 public abstract void logoffSession(HttpServletRequest request, HttpServletResponse response) throws SecurityErrorException; 62 63 public abstract List getSessionInfo(String username, int sessionType); 64 65 public abstract SessionInfo getSessionInfo(String logonTicket); 66 67 public abstract int getUserStatus(User user) throws Exception ; 68 69 74 75 public abstract void initialiseSession(HttpSession session, User user) throws UserDatabaseException; 76 77 public void resetSessionTimeout(User user, PropertyProfile profile, HttpSession session); 78 79 public abstract AccountLock checkForAccountLock(String username, String realmName) throws SecurityErrorException, AccountLockedException; 80 81 public abstract AccountLock logonFailed(String username, String realmName, AccountLock lock) throws SecurityErrorException, AccountLockedException; 82 83 84 85 public abstract void logoff(String ticket); 86 87 101 102 public abstract Map getActiveSessions(); 103 104 105 106 109 110 111 public abstract User getUser(HttpSession session, String logonTicket) throws SecurityErrorException; 112 113 public abstract User getUser(HttpServletRequest request) throws SecurityErrorException; 114 115 public abstract User getUser(HttpServletRequest request, String logonTicket) throws SecurityErrorException; 116 117 public abstract int hasClientLoggedOn(HttpServletRequest request, HttpServletResponse response) 118 throws SecurityErrorException; 119 120 126 127 public abstract void unlockUser(String username); 128 129 130 131 136 public abstract void logon(HttpServletRequest request, HttpServletResponse response, AuthenticationScheme authSession) 137 throws Exception ; 138 139 143 public abstract char[] getPasswordFromCredentials(AuthenticationScheme scheme); 144 145 149 150 151 155 public abstract SessionInfo getSessionInfo(HttpServletRequest request) ; 156 157 public abstract SessionInfo getSessionInfo(HttpSession session) ; 158 159 160 public abstract SessionInfo getSessionInfoBySessionId(String sessionId); 161 162 public void addCookies(RequestHandlerRequest request, 163 RequestHandlerResponse response, String logonTicket, SessionInfo session); 164 165 public void addSession(String logonTicket, SessionInfo info, HttpServletRequest request, HttpServletResponse response); 166 167 public abstract String checkLogonAllowed(User username); 168 169 public void attachSession(String sessionId, SessionInfo session); 170 171 public void registerAuthorizationTicket(String ticket, SessionInfo session); 172 173 public SessionInfo removeAuthorizationTicket(String ticket); 174 175 public SessionInfo getAuthorizationTicket(String ticket); 176 177 182 public void applyMenuItemChanges(HttpServletRequest request); 183 184 } 185 | Popular Tags |