net.sf.jguard.authentication
Interface AuthenticationInterface

All Known Implementing Classes:
XmlAuthentication

public interface AuthenticationInterface

this interface provide the ability to operate on the system which stores user profiles. it can be a database, or an ldap server, or anything else.... it concerns administrators guys.

Author:
Charles Gay

Method Summary
 void addRoleToUser(javax.security.auth.Subject user, java.lang.String roleName)
          add role to user.
 void createRole(JGuardPrincipal role)
          add roles in the list to the persistance storage.
 void createUser(javax.security.auth.Subject user)
          add user in the list to the persistance storage.
 JGuardPrincipal getRole(java.lang.String name)
          retrieve role.
 java.util.List getRoles()
           
 javax.security.auth.Subject getUser(java.lang.String userName)
          retrieve user.
 void initAuthenticationDAO(java.util.Map map)
           
 boolean register(javax.security.auth.Subject user)
          register in datasource the user.
 void removeUser(javax.security.auth.Subject userinterface)
          remove user.
 java.util.Set retrieveUserRoles(long Id)
           
 boolean roleAlreadyExists(JGuardPrincipal adminRole)
           
 void updateUser(javax.security.auth.Subject userinterface)
          update user's informations.
 boolean userAlreadyExists(javax.security.auth.Subject user)
          checks if a user with the same username already exists.
 

Method Detail

createUser

public void createUser(javax.security.auth.Subject user)
                throws AuthenticationException
add user in the list to the persistance storage.

Parameters:
user -
Throws:
AuthenticationException

addRoleToUser

public void addRoleToUser(javax.security.auth.Subject user,
                          java.lang.String roleName)
                   throws AuthenticationException
add role to user.

Parameters:
user -
roleName -
Throws:
AuthenticationException

createRole

public void createRole(JGuardPrincipal role)
                throws AuthenticationException
add roles in the list to the persistance storage.

Parameters:
role -
Throws:
AuthenticationException

getRole

public JGuardPrincipal getRole(java.lang.String name)
                        throws AuthenticationException
retrieve role.

Parameters:
name -
Returns:
roleInterface
Throws:
AuthenticationException

getRoles

public java.util.List getRoles()
                        throws AuthenticationException
Returns:
role's list.
Throws:
AuthenticationException

getUser

public javax.security.auth.Subject getUser(java.lang.String userName)
                                    throws AuthenticationException
retrieve user.

Parameters:
userName -
Returns:
userinterface
Throws:
AuthenticationException

retrieveUserRoles

public java.util.Set retrieveUserRoles(long Id)
                                throws AuthenticationException
Parameters:
Id -
Returns:
roles set
Throws:
AuthenticationException

userAlreadyExists

public boolean userAlreadyExists(javax.security.auth.Subject user)
                          throws AuthenticationException
checks if a user with the same username already exists.

Parameters:
user -
Returns:
result. true if a user with the same name exists, false otherwise.
Throws:
AuthenticationException

register

public boolean register(javax.security.auth.Subject user)
                 throws AuthenticationException
register in datasource the user.

Parameters:
user -
Returns:
boolean
Throws:
AuthenticationException

initAuthenticationDAO

public void initAuthenticationDAO(java.util.Map map)
                           throws AuthenticationException
Throws:
AuthenticationException

roleAlreadyExists

public boolean roleAlreadyExists(JGuardPrincipal adminRole)
                          throws AuthenticationException
Parameters:
adminRole -
Returns:
indicates if role exists
Throws:
AuthenticationException

updateUser

public void updateUser(javax.security.auth.Subject userinterface)
                throws AuthenticationException
update user's informations.

Parameters:
userinterface -
Throws:
AuthenticationException

removeUser

public void removeUser(javax.security.auth.Subject userinterface)
                throws AuthenticationException
remove user.

Parameters:
userinterface -
Throws:
AuthenticationException