com.opensymphony.user.provider.castor
Class CastorAccessProvider

java.lang.Object
  extended bycom.opensymphony.user.provider.castor.CastorBaseProvider
      extended bycom.opensymphony.user.provider.castor.CastorAccessProvider
All Implemented Interfaces:
AccessProvider, java.io.Serializable, UserProvider

public class CastorAccessProvider
extends CastorBaseProvider
implements AccessProvider

Author:
Dan Bachelder
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.opensymphony.user.provider.castor.CastorBaseProvider
_dataProvider, DatabaseFile, GROUP_CLASS, groupQueryString, MappingFile, USER_CLASS, userQueryString
 
Constructor Summary
CastorAccessProvider()
           
 
Method Summary
 boolean addToGroup(java.lang.String username, java.lang.String groupname)
          Add user to group.
 boolean create(java.lang.String name)
          Create new Entity with given name.
 boolean handles(java.lang.String name)
          Determine whether this UserProvider implementation is responsible for handling this Entity.
 boolean inGroup(java.lang.String username, java.lang.String groupname)
          Find out whether given user is member of given group.
 java.util.List list()
          Returns List of names (Strings) of all Entities that can be accessed by this UserProvider If this UserProvider cannot retrieve a list of names, null is to be returned.
 java.util.List listGroupsContainingUser(java.lang.String username)
          List all groups that contain a user.
 java.util.List listUsersInGroup(java.lang.String groupname)
          List all users that are contained within a group.
 boolean remove(java.lang.String name)
          Create Entity with given name.
 boolean removeFromGroup(java.lang.String username, java.lang.String groupname)
          Remove user from group.
 
Methods inherited from class com.opensymphony.user.provider.castor.CastorBaseProvider
flushCaches, init, load, queryGroupsByNameKey, queryGroupsByNameKey, queryUsersByNameKey, queryUsersByNameKey, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.opensymphony.user.provider.UserProvider
flushCaches, init, load, store
 

Constructor Detail

CastorAccessProvider

public CastorAccessProvider()
Method Detail

addToGroup

public boolean addToGroup(java.lang.String username,
                          java.lang.String groupname)
Add user to group.

Specified by:
addToGroup in interface AccessProvider
Returns:
Whether user was successfully added to group.

create

public boolean create(java.lang.String name)
Create new Entity with given name.

Specified by:
create in interface UserProvider
Returns:
Whether entity was successfully created.

handles

public boolean handles(java.lang.String name)
Determine whether this UserProvider implementation is responsible for handling this Entity.

Specified by:
handles in interface UserProvider

inGroup

public boolean inGroup(java.lang.String username,
                       java.lang.String groupname)
Find out whether given user is member of given group.

Specified by:
inGroup in interface AccessProvider
Returns:
Whether user is member of group.

list

public java.util.List list()
Returns List of names (Strings) of all Entities that can be accessed by this UserProvider If this UserProvider cannot retrieve a list of names, null is to be returned. If there are no current Entities stored by this provider, an empty List is to be returned. The order of names returned can be determined by the UserProvider (it may or may not be relevant). This List should be immutable.

Specified by:
list in interface UserProvider

listGroupsContainingUser

public java.util.List listGroupsContainingUser(java.lang.String username)
List all groups that contain a user.

Specified by:
listGroupsContainingUser in interface AccessProvider
Returns:
List containing Strings of groupnames. If no groups found, empty list should be returned. If feature not supported by UserProvider, null shall be returned. This List should be immutable.

listUsersInGroup

public java.util.List listUsersInGroup(java.lang.String groupname)
List all users that are contained within a group.

Specified by:
listUsersInGroup in interface AccessProvider
Returns:
List containing Strings of usernames. If no users found, empty list should be returned. If feature not supported by UserProvider, null shall be returned. This List should be immutable.

remove

public boolean remove(java.lang.String name)
Create Entity with given name.

Specified by:
remove in interface UserProvider
Returns:
Whether entity was successfully removed.

removeFromGroup

public boolean removeFromGroup(java.lang.String username,
                               java.lang.String groupname)
Remove user from group.

Specified by:
removeFromGroup in interface AccessProvider
Returns:
Whether user was successfully removed from group.

See www.opensymphony.com for more information.