1 28 package net.sf.jguard.ext.authentication.manager; 29 30 31 32 import java.security.Principal ; 33 import java.util.Collection ; 34 import java.util.Map ; 35 import java.util.Set ; 36 37 import javax.security.auth.Subject ; 38 39 import net.sf.jguard.core.authentication.credentials.JGuardCredential; 40 import net.sf.jguard.ext.authentication.AuthenticationException; 41 import net.sf.jguard.ext.registration.RegistrationException; 42 import net.sf.jguard.ext.registration.SubjectTemplate; 43 44 54 public interface AuthenticationManager { 55 56 62 public void persistSubjectTemplate(SubjectTemplate template) throws AuthenticationException; 63 64 65 71 public Subject createUser(SubjectTemplate user) throws RegistrationException ; 72 73 74 82 public Subject createUser(SubjectTemplate user, SubjectTemplate template) throws RegistrationException ; 83 84 90 public void createUser(Subject user) throws AuthenticationException ; 91 92 98 public void addPrincipalToUser(Subject user, String roleName)throws AuthenticationException; 99 100 101 109 public void addPrincipalToUser(Subject user, String roleName,String applicationName) throws AuthenticationException; 110 111 117 public void createPrincipal(Principal role) throws AuthenticationException ; 118 119 125 public Principal getLocalPrincipal(String name)throws AuthenticationException; 126 127 128 133 public Set getAllPrincipalsSet() throws AuthenticationException; 134 135 140 public Set getLocalPrincipals(); 141 142 148 public Set findUsers(Collection credentials)throws AuthenticationException; 149 150 156 public boolean userAlreadyExists(Subject user) throws AuthenticationException; 157 158 159 163 public void init(Map map); 164 165 166 172 public boolean hasPrincipal(Principal role)throws AuthenticationException; 173 174 180 public boolean hasPrincipal(String role)throws AuthenticationException; 181 182 188 public void updateUser(JGuardCredential identityCred,Subject user)throws AuthenticationException; 189 190 195 public void deleteUser(Subject user)throws AuthenticationException; 196 197 202 public SubjectTemplate getDefaultSubjectTemplate() throws AuthenticationException; 203 204 210 public SubjectTemplate getSubjectTemplate(String name) throws AuthenticationException; 211 212 public Set getUsers() throws AuthenticationException; 213 214 public boolean isEmpty(); 215 216 222 public void updatePrincipal(String oldPrincipalName, Principal principal) throws AuthenticationException; 223 224 225 231 public boolean deletePrincipal(Principal principal)throws AuthenticationException ; 232 233 234 240 public Principal clonePrincipal(String roleName) throws AuthenticationException; 241 242 249 public Principal clonePrincipal(String roleName, String cloneName) throws AuthenticationException; 250 259 public void setActiveOnRolePrincipal(Subject subject,String roleName,String applicationName,boolean active) throws AuthenticationException; 260 261 public Subject findUser(String login); 262 263 public void updateRoleDefinition(Subject subject, String role,String applicationName,String definition) throws AuthenticationException; 264 265 266 public void importAuthenticationManager(AuthenticationManager authManager); 267 268 } 269 | Popular Tags |