org.apache.jackrabbit.core.security.user
Class UserManagerImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.SecurityItemModifier
      extended by org.apache.jackrabbit.core.security.user.UserManagerImpl
All Implemented Interfaces:
UserManager

public class UserManagerImpl
extends SecurityItemModifier
implements UserManager

UserManagerImpl


Field Summary
static String AUTHORIZABLES_PATH
           
static String GROUP_ADMIN_GROUP_NAME
          Configuration key and default value for the the name of the 'GroupAdmin' group-principal
static String GROUPS_PATH
           
static NameFactory NF
           
static Name NT_REP_AUTHORIZABLE
           
static Name NT_REP_AUTHORIZABLE_FOLDER
           
static Name NT_REP_GROUP
           
static Name NT_REP_USER
           
static Name P_GROUPS
           
static Name P_IMPERSONATORS
          Name of the user property containing the principal names of those allowed to impersonate.
static Name P_PASSWORD
           
static Name P_PRINCIPAL_NAME
           
static Name P_REFEREES
           
static Name P_USERID
           
static String SECURITY_ROOT_PATH
          root-path to security related content e.g. principals
static String USER_ADMIN_GROUP_NAME
          Configuration key and default value for the the name of the 'UserAdmin' group-principal.
static String USERS_PATH
           
 
Fields inherited from interface org.apache.jackrabbit.api.security.user.UserManager
SEARCH_TYPE_AUTHORIZABLE, SEARCH_TYPE_GROUP, SEARCH_TYPE_USER
 
Constructor Summary
UserManagerImpl(SessionImpl session, String adminId)
           
 
Method Summary
 Group createGroup(Principal principal)
          Create a new Group with the given groupName.
 Group createGroup(Principal principal, String intermediatePath)
          Creates a new Group that is based on the given principal and the specified itermediatePath hint.
 User createUser(String userID, String password)
          Creates a new Node on the repository with the specified userName.
 User createUser(String userID, String password, Principal principal, String intermediatePath)
          Creates an User for the given userID that authenitcates with the given Credentials and returns the specified Principal upon Authorizable.getPrincipal().
 Iterator findAuthorizables(String propertyName, String value)
          Returns all Authorizables that have property with the given name and that Property equals the given value.
 Iterator findAuthorizables(String propertyName, String value, int searchType)
          Returns all Authorizables that have property with the given name and that Property equals the given value.
 Authorizable getAuthorizable(Principal principal)
          Get the Authorizable by its main Principal.
 Authorizable getAuthorizable(String id)
          Get the Authorizable by its id.
 
Methods inherited from class org.apache.jackrabbit.core.SecurityItemModifier
addSecurityNode, removeSecurityItem, setSecurityProperty, setSecurityProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NF

public static final NameFactory NF

SECURITY_ROOT_PATH

public static final String SECURITY_ROOT_PATH
root-path to security related content e.g. principals

See Also:
Constant Field Values

AUTHORIZABLES_PATH

public static final String AUTHORIZABLES_PATH
See Also:
Constant Field Values

USERS_PATH

public static final String USERS_PATH
See Also:
Constant Field Values

GROUPS_PATH

public static final String GROUPS_PATH
See Also:
Constant Field Values

USER_ADMIN_GROUP_NAME

public static final String USER_ADMIN_GROUP_NAME
Configuration key and default value for the the name of the 'UserAdmin' group-principal.

See Also:
Constant Field Values

GROUP_ADMIN_GROUP_NAME

public static final String GROUP_ADMIN_GROUP_NAME
Configuration key and default value for the the name of the 'GroupAdmin' group-principal

See Also:
Constant Field Values

P_REFEREES

public static final Name P_REFEREES

P_PRINCIPAL_NAME

public static final Name P_PRINCIPAL_NAME

P_USERID

public static final Name P_USERID

P_PASSWORD

public static final Name P_PASSWORD

P_GROUPS

public static final Name P_GROUPS

P_IMPERSONATORS

public static final Name P_IMPERSONATORS
Name of the user property containing the principal names of those allowed to impersonate.


NT_REP_AUTHORIZABLE

public static final Name NT_REP_AUTHORIZABLE

NT_REP_AUTHORIZABLE_FOLDER

public static final Name NT_REP_AUTHORIZABLE_FOLDER

NT_REP_USER

public static final Name NT_REP_USER

NT_REP_GROUP

public static final Name NT_REP_GROUP
Constructor Detail

UserManagerImpl

public UserManagerImpl(SessionImpl session,
                       String adminId)
                throws RepositoryException
Throws:
RepositoryException
Method Detail

getAuthorizable

public Authorizable getAuthorizable(String id)
                             throws RepositoryException
Description copied from interface: UserManager
Get the Authorizable by its id.

Specified by:
getAuthorizable in interface UserManager
Returns:
Authorizable or null, if not present.
Throws:
RepositoryException
See Also:
UserManager.getAuthorizable(String)

getAuthorizable

public Authorizable getAuthorizable(Principal principal)
                             throws RepositoryException
Description copied from interface: UserManager
Get the Authorizable by its main Principal.

Specified by:
getAuthorizable in interface UserManager
Returns:
Authorizable or null, if not present.
Throws:
RepositoryException
See Also:
UserManager.getAuthorizable(Principal)

findAuthorizables

public Iterator findAuthorizables(String propertyName,
                                  String value)
                           throws RepositoryException
Description copied from interface: UserManager
Returns all Authorizables that have property with the given name and that Property equals the given value.

Specified by:
findAuthorizables in interface UserManager
Returns:
All Authorizables that have a property with the given name exactly matching the given value.
Throws:
RepositoryException
See Also:
UserManager.findAuthorizables(String,String)

findAuthorizables

public Iterator findAuthorizables(String propertyName,
                                  String value,
                                  int searchType)
                           throws RepositoryException
Description copied from interface: UserManager
Returns all Authorizables that have property with the given name and that Property equals the given value. In contrast to UserManager.findAuthorizables(String, String) the type of authorizable is respected while executing the search.

Specified by:
findAuthorizables in interface UserManager
searchType - Any of the following constants:
Returns:
Throws:
RepositoryException
See Also:
UserManager.findAuthorizables(String,String, int)

createUser

public User createUser(String userID,
                       String password)
                throws RepositoryException
Creates a new Node on the repository with the specified userName.
The User will be created relative to path of the User who represents the Session this UserManager has been created for.
If the Credentials are of type SimpleCredentials they will be crypted.

Specified by:
createUser in interface UserManager
Parameters:
userID -
password -
Returns:
The new User.
Throws:
AuthorizableExistsException - in case the given userID is already in use or another Authorizable with the same principal name exists.
RepositoryException - If another error occurs.
See Also:
UserManager.createUser(String,String)

createUser

public User createUser(String userID,
                       String password,
                       Principal principal,
                       String intermediatePath)
                throws AuthorizableExistsException,
                       RepositoryException
Description copied from interface: UserManager
Creates an User for the given userID that authenitcates with the given Credentials and returns the specified Principal upon Authorizable.getPrincipal(). If the implementation is not able to deal with the itermediatePath that parameter should be ignored. Except for the itermediatePath, neither of the specified parameters can be null.

Specified by:
createUser in interface UserManager
Parameters:
userID -
password -
principal -
intermediatePath -
Returns:
Throws:
AuthorizableExistsException
RepositoryException

createGroup

public Group createGroup(Principal principal)
                  throws RepositoryException
Create a new Group with the given groupName. It will be created below the this UserManager's root Path.
If non-existant elements of the Path will be created as Nodes of type rep:AuthorizableFolder

Specified by:
createGroup in interface UserManager
Parameters:
principal -
Returns:
The new Group.
Throws:
AuthorizableExistsException - in case the given groupID is already in use or another Authorizable with the same principal name exists.
RepositoryException - If another error occurs.
See Also:
UserManager.createGroup(Principal);

createGroup

public Group createGroup(Principal principal,
                         String intermediatePath)
                  throws AuthorizableExistsException,
                         RepositoryException
Description copied from interface: UserManager
Creates a new Group that is based on the given principal and the specified itermediatePath hint. If the implementation is not able to deal with the itermediatePath that parameter should be ignored.

Specified by:
createGroup in interface UserManager
Parameters:
principal -
intermediatePath -
Returns:
Throws:
AuthorizableExistsException
RepositoryException


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.