1 18 19 package cowsultants.itracker.ejb.authentication; 20 21 import java.rmi.*; 22 import java.rmi.server.*; 23 import java.util.*; 24 import javax.ejb.*; 25 26 import cowsultants.itracker.ejb.client.exceptions.*; 27 import cowsultants.itracker.ejb.client.interfaces.*; 28 import cowsultants.itracker.ejb.client.models.*; 29 import cowsultants.itracker.ejb.client.util.*; 30 31 36 public abstract class AbstractPluggableAuthenticator implements PluggableAuthenticator, AuthenticationConstants { 37 private UserHandler userHandler = null; 38 private SystemConfiguration systemConfiguration = null; 39 40 public AbstractPluggableAuthenticator() { 41 } 42 43 53 public abstract UserModel checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException; 54 55 64 public abstract PermissionModel[] getUserPermissions(UserModel user, int reqSource) throws AuthenticatorException; 65 66 78 public abstract UserModel[] getUsersWithProjectPermission(PermissionModel[] permissions, boolean requireAll, boolean activeOnly, int reqSource) throws AuthenticatorException; 79 80 89 public abstract boolean allowRegistration(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; 90 91 104 public abstract boolean allowProfileCreation(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; 105 106 119 public abstract boolean allowProfileUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; 120 121 134 public abstract boolean allowPasswordUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; 135 136 150 public abstract boolean allowPermissionUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; 151 152 165 public abstract boolean allowPreferenceUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; 166 167 181 public abstract boolean createProfile(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; 182 183 196 public abstract boolean updateProfile(UserModel user, int updateType, Object authentication, int authType, int reqSource) throws AuthenticatorException; 197 198 202 public void initialize(HashMap values) { 203 if(values != null) { 204 Object userHandler = values.get("userHandler"); 205 Object systemConfiguration = values.get("systemConfiguration"); 206 207 if(userHandler instanceof UserHandler) { 208 this.userHandler = (UserHandler) userHandler; 209 } 210 if(systemConfiguration instanceof SystemConfiguration) { 211 this.systemConfiguration = (SystemConfiguration) systemConfiguration; 212 } 213 } 214 } 215 216 220 public UserHandler getUserHandler() throws AuthenticatorException { 221 if(userHandler == null || ! (userHandler instanceof UserHandler)) { 222 throw new AuthenticatorException(AuthenticatorException.SYSTEM_ERROR); 223 } 224 225 return userHandler; 226 } 227 228 233 public SystemConfiguration getSystemConfiguration() throws AuthenticatorException { 234 if(systemConfiguration == null || ! (systemConfiguration instanceof SystemConfiguration)) { 235 throw new AuthenticatorException(AuthenticatorException.SYSTEM_ERROR); 236 } 237 238 return systemConfiguration; 239 } 240 } | Popular Tags |