org.apache.jackrabbit.api.security.user
Interface UserManager

All Known Implementing Classes:
UserManagerImpl

public interface UserManager

The UserManager provides access to and means to maintain authoriable objects i.e. users and groups. The UserManager is bound to a particular Session.


Field Summary
static int SEARCH_TYPE_AUTHORIZABLE
          Filter flag indicating that all Authorizables should be searched.
static int SEARCH_TYPE_GROUP
          Filter flag indicating that only Groups should be searched and returned.
static int SEARCH_TYPE_USER
          Filter flag indicating that only Users should be searched and returned.
 
Method Summary
 Group createGroup(Principal principal)
          Creates a new Group that is based on the given principal.
 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 an User for the given userID / password pair; neither of the specified parameters can be null.
 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.
 

Field Detail

SEARCH_TYPE_USER

static final int SEARCH_TYPE_USER
Filter flag indicating that only Users should be searched and returned.

See Also:
Constant Field Values

SEARCH_TYPE_GROUP

static final int SEARCH_TYPE_GROUP
Filter flag indicating that only Groups should be searched and returned.

See Also:
Constant Field Values

SEARCH_TYPE_AUTHORIZABLE

static final int SEARCH_TYPE_AUTHORIZABLE
Filter flag indicating that all Authorizables should be searched.

See Also:
Constant Field Values
Method Detail

getAuthorizable

Authorizable getAuthorizable(String id)
                             throws RepositoryException
Get the Authorizable by its id.

Parameters:
id -
Returns:
Authorizable or null, if not present.
Throws:
RepositoryException
See Also:
Authorizable.getID()

getAuthorizable

Authorizable getAuthorizable(Principal principal)
                             throws RepositoryException
Get the Authorizable by its main Principal.

Parameters:
principal -
Returns:
Authorizable or null, if not present.
Throws:
RepositoryException

findAuthorizables

Iterator findAuthorizables(String propertyName,
                           String value)
                           throws RepositoryException
Returns all Authorizables that have property with the given name and that Property equals the given value.

Parameters:
propertyName -
value -
Returns:
All Authorizables that have a property with the given name exactly matching the given value.
Throws:
RepositoryException
See Also:
Authorizable.getProperty(String)

findAuthorizables

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

Parameters:
propertyName -
value -
searchType - Any of the following constants:
Returns:
Throws:
RepositoryException

createUser

User createUser(String userID,
                String password)
                throws AuthorizableExistsException,
                       RepositoryException
Creates an User for the given userID / password pair; neither of the specified parameters can be null.
Same as createUser(String,String,Principal,String) where the specified userID is equal to the principal name and the intermediate path is null.

Parameters:
userID -
password - The initial password of this user.
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.

createUser

User createUser(String userID,
                String password,
                Principal principal,
                String intermediatePath)
                throws AuthorizableExistsException,
                       RepositoryException
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.

Parameters:
userID -
password -
principal -
intermediatePath -
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 the current Session is not allowed to create users or some another error occurs.

createGroup

Group createGroup(Principal principal)
                  throws AuthorizableExistsException,
                         RepositoryException
Creates a new Group that is based on the given principal.

Parameters:
principal - A non-null 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.

createGroup

Group createGroup(Principal principal,
                  String intermediatePath)
                  throws AuthorizableExistsException,
                         RepositoryException
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.

Parameters:
principal -
intermediatePath -
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.


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