jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anand <simer.anan...@gmail.com>
Subject Need Help implementing user manager
Date Fri, 06 Nov 2009 11:32:48 GMT

Hello Users,

                As i was told inorder to implement the UserManager I need to
customize the SecurityMananger and need to use the UserManager class then i
looked into it i found this CreateUser method which returns the new user. I
looked up this method in
org.apache.jackrabbit.core.security.user.UserManagerImpl class. 

    public User createUser(String userID, String password,
                           Principal principal, String intermediatePath)
            throws AuthorizableExistsException, RepositoryException {
        if (userID == null || password == null || principal == null) {
            throw new IllegalArgumentException("Not possible to create user
with null parameters");}
            if (getAuthorizable(userID) != null) {
            throw new AuthorizableExistsException("User for '" + userID + "'
already exists");}        }
        if (hasAuthorizableOrReferee(principal)) {
            throw new AuthorizableExistsException("Authorizable for '" +
principal.getName() + "' already exists"); }
        NodeImpl parent = null;
        try {
            String parentPath = getParentPath(intermediatePath,
            parent = createParentNode(parentPath);
            Name nodeName =
            NodeImpl userNode = addSecurityNode(parent, nodeName,
            setSecurityProperty(userNode, P_USERID, getValue(userID));
            setSecurityProperty(userNode, P_PASSWORD,
            setSecurityProperty(userNode, P_PRINCIPAL_NAME,
            log.info("User created: " + userID + "; " + userNode.getPath());
            return createUser(userNode);

1.  In this try block i don't know what these first three  lines are meant
for so please any one here who has any idea  please let me know how i can
implement this if i want to use CreateUser(String Id, String Password)
method .

2.  and from where does this CreateUser() method will be called in order to
create new user
3. This method returns new user, will it be stored in Repository so that we
can again use that user account.

3.  If we customize this class then how we will implement it in
repository.xml file since there is no Entry for UserManager like
<UserManager class= "  ">

Reply Needed.

Please Have a look at it.
View this message in context: http://n4.nabble.com/implementing-user-manager-tp523395p547733.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message