com.opensymphony.user.provider.ejb
Class UserManagerEJB

java.lang.Object
  extended bycom.opensymphony.ejb.SessionAdapter
      extended bycom.opensymphony.user.provider.ejb.UserManagerEJB
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

public class UserManagerEJB
extends com.opensymphony.ejb.SessionAdapter

User: Hani Suleiman Date: Dec 22, 2003 Time: 4:25:35 PM

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.opensymphony.ejb.SessionAdapter
context
 
Constructor Summary
UserManagerEJB()
           
 
Method Summary
 boolean addToGroup(java.lang.String userName, java.lang.String groupName)
           
 boolean authenticate(java.lang.String user, java.lang.String password)
           
 boolean changePassword(java.lang.String user, java.lang.String password)
           
 boolean createGroup(java.lang.String name)
           
 boolean createUser(java.lang.String name)
           
 void ejbCreate()
           
 java.util.List getGroupNames()
           
 com.opensymphony.module.propertyset.PropertySet getGroupPropertySet(java.lang.String name)
           
 java.util.List getUserGroups(java.lang.String user)
          Get a list of group names that the specified user belongs to.
 java.util.List getUserNames()
           
 com.opensymphony.module.propertyset.PropertySet getUserPropertySet(java.lang.String name)
           
 java.util.List getUsersInGroup(java.lang.String group)
          Get a list of user names that the specified group contains.
 boolean groupExists(java.lang.String name)
           
 boolean isUserInGroup(java.lang.String user, java.lang.String group)
           
 boolean removeFromGroup(java.lang.String userName, java.lang.String groupName)
           
 boolean removeGroup(java.lang.String group)
          Remove the specified group.
 boolean removeUser(java.lang.String user)
          Remove the specified user.
 boolean userExists(java.lang.String name)
           
 
Methods inherited from class com.opensymphony.ejb.SessionAdapter
ejbActivate, ejbPassivate, ejbRemove, getSessionContext, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManagerEJB

public UserManagerEJB()
Method Detail

getGroupNames

public java.util.List getGroupNames()

getGroupPropertySet

public com.opensymphony.module.propertyset.PropertySet getGroupPropertySet(java.lang.String name)
                                                                    throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getUserGroups

public java.util.List getUserGroups(java.lang.String user)
Get a list of group names that the specified user belongs to.

Returns:
a List of group names, or an empty list if the user does not exist or does not belong to any groups.

isUserInGroup

public boolean isUserInGroup(java.lang.String user,
                             java.lang.String group)

getUserNames

public java.util.List getUserNames()

getUserPropertySet

public com.opensymphony.module.propertyset.PropertySet getUserPropertySet(java.lang.String name)
                                                                   throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getUsersInGroup

public java.util.List getUsersInGroup(java.lang.String group)
Get a list of user names that the specified group contains.

Returns:
a List of user names, or an empty list if the group does not exist or does not contain any users.

addToGroup

public boolean addToGroup(java.lang.String userName,
                          java.lang.String groupName)
Parameters:
userName - The user to add to the group.
groupName - The group to add the user to.
Returns:
true if the user was added to the group, false otherwise.

authenticate

public boolean authenticate(java.lang.String user,
                            java.lang.String password)

changePassword

public boolean changePassword(java.lang.String user,
                              java.lang.String password)

createGroup

public boolean createGroup(java.lang.String name)
                    throws javax.ejb.CreateException
Parameters:
name - the group name to create.
Returns:
true if the group was created successfully.
Throws:
javax.ejb.CreateException

createUser

public boolean createUser(java.lang.String name)
                   throws javax.ejb.CreateException
Throws:
javax.ejb.CreateException

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
Throws:
javax.ejb.CreateException

groupExists

public boolean groupExists(java.lang.String name)

removeFromGroup

public boolean removeFromGroup(java.lang.String userName,
                               java.lang.String groupName)

removeGroup

public boolean removeGroup(java.lang.String group)
Remove the specified group.

Returns:
true if the group was successfully removed, false if the group does not exist or there was an error removing it.

removeUser

public boolean removeUser(java.lang.String user)
Remove the specified user.

Returns:
true if the user was successfully removed, false if the user does not exist or there was an error removing it.

userExists

public boolean userExists(java.lang.String name)

See www.opensymphony.com for more information.