org.exist.xmldb
Class RemoteUserManagementService

java.lang.Object
  extended by org.exist.xmldb.RemoteUserManagementService
All Implemented Interfaces:
UserManagementService, Configurable, Service

public class RemoteUserManagementService
extends Object
implements UserManagementService

Modified by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it


Constructor Summary
RemoteUserManagementService(RemoteCollection collection)
           
 
Method Summary
 void addUser(User user)
          Add a new user account
 void addUserGroup(User user)
          Update the specified user without update user's password Method added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it
 void chmod(int mode)
           
 void chmod(Resource res, int mode)
          Change permissions for the specified resource.
 void chmod(Resource res, String mode)
          Change access mode of a resource
 void chmod(String mode)
          Change access mode of the current collection
 void chown(Resource res, User u, String group)
          Change the owner of a resource
 void chown(User u, String group)
          Change the owner of the current collection
 String[] getGroups()
          Retrieve a list of all existing groups.
 String getName()
          Gets the name attribute of the UserManagementServiceImpl object
 Permission getPermissions(Collection coll)
          Get current permissions for a collection
 Permission getPermissions(Resource res)
          Get current permissions for a resource
 String getProperty(String property)
          Gets the property attribute of the UserManagementServiceImpl object
 User getUser(String name)
          Get user information for specified user
 User[] getUsers()
          Get a list of all users currently defined
 String getVersion()
          Gets the version attribute of the UserManagementServiceImpl object
 String hasUserLock(Resource res)
          Check if the resource has a user lock.
 Permission[] listCollectionPermissions()
          Get permissions for all child collections contained in the current collection.
 Permission[] listResourcePermissions()
          Get permissions for all resources contained in the current collection.
 void lockResource(Resource res, User u)
          Lock the specified resource for the specified user.
 void removeGroup(User user, String rmgroup)
          Update the specified user removing a group from user's group method added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it
 void removeUser(User u)
          Remove user.
 void setCollection(Collection collection)
          Sets the collection attribute of the UserManagementServiceImpl object
 void setPermissions(Collection child, Permission perms)
          Change permissions for a resource.
 void setPermissions(Resource res, Permission perms)
          Change permissions for a resource.
 void setProperty(String property, String value)
          Sets the property attribute of the UserManagementServiceImpl object
 void unlockResource(Resource res)
          Unlock the specified resource.
 void updateUser(User user)
          Update the specified user
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteUserManagementService

public RemoteUserManagementService(RemoteCollection collection)
Method Detail

addUser

public void addUser(User user)
             throws XMLDBException
Add a new user account

Specified by:
addUser in interface UserManagementService
Parameters:
user - The user to be added
Throws:
XMLDBException - Description of the Exception

setPermissions

public void setPermissions(Resource res,
                           Permission perms)
                    throws XMLDBException
Change permissions for a resource.

Specified by:
setPermissions in interface UserManagementService
Throws:
XMLDBException

setPermissions

public void setPermissions(Collection child,
                           Permission perms)
                    throws XMLDBException
Change permissions for a resource.

Specified by:
setPermissions in interface UserManagementService
Throws:
XMLDBException

chmod

public void chmod(Resource res,
                  String mode)
           throws XMLDBException
Change access mode of a resource

Specified by:
chmod in interface UserManagementService
Parameters:
mode - Access mode
res - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

chmod

public void chmod(Resource res,
                  int mode)
           throws XMLDBException
Description copied from interface: UserManagementService
Change permissions for the specified resource.

Specified by:
chmod in interface UserManagementService
Throws:
XMLDBException
See Also:
UserManagementService.chmod(org.xmldb.api.base.Resource, int)

chmod

public void chmod(String mode)
           throws XMLDBException
Change access mode of the current collection

Specified by:
chmod in interface UserManagementService
Parameters:
mode - Access mode
Throws:
XMLDBException - Description of the Exception

chmod

public void chmod(int mode)
           throws XMLDBException
Specified by:
chmod in interface UserManagementService
Throws:
XMLDBException
See Also:
UserManagementService.chmod(int)

lockResource

public void lockResource(Resource res,
                         User u)
                  throws XMLDBException
Description copied from interface: UserManagementService
Lock the specified resource for the specified user. A locked resource cannot be changed by other users (except users in group DBA) until the lock is released. Users with admin privileges can always change a resource.

Specified by:
lockResource in interface UserManagementService
Throws:
XMLDBException

hasUserLock

public String hasUserLock(Resource res)
                   throws XMLDBException
Description copied from interface: UserManagementService
Check if the resource has a user lock. Returns the name of the owner of the lock or null if no lock has been set on the resource.

Specified by:
hasUserLock in interface UserManagementService
Returns:
Name of the owner of the lock
Throws:
XMLDBException

unlockResource

public void unlockResource(Resource res)
                    throws XMLDBException
Description copied from interface: UserManagementService
Unlock the specified resource. The current user has to be same who locked the resource. Exception: admin users can always unlock a resource.

Specified by:
unlockResource in interface UserManagementService
Throws:
XMLDBException

chown

public void chown(User u,
                  String group)
           throws XMLDBException
Change the owner of the current collection

Specified by:
chown in interface UserManagementService
Parameters:
u - Description of the Parameter
group - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

chown

public void chown(Resource res,
                  User u,
                  String group)
           throws XMLDBException
Change the owner of a resource

Specified by:
chown in interface UserManagementService
Parameters:
res - Resource
u - The new owner of the resource
group - The owner group
Throws:
XMLDBException - Description of the Exception

getName

public String getName()
Gets the name attribute of the UserManagementServiceImpl object

Specified by:
getName in interface UserManagementService
Specified by:
getName in interface Service
Returns:
The name value

getPermissions

public Permission getPermissions(Collection coll)
                          throws XMLDBException
Get current permissions for a collection

Specified by:
getPermissions in interface UserManagementService
Parameters:
coll - Collection
Returns:
The permissions value
Throws:
XMLDBException - Description of the Exception

getPermissions

public Permission getPermissions(Resource res)
                          throws XMLDBException
Get current permissions for a resource

Specified by:
getPermissions in interface UserManagementService
Parameters:
res - Description of the Parameter
Returns:
The permissions value
Throws:
XMLDBException - Description of the Exception

listResourcePermissions

public Permission[] listResourcePermissions()
                                     throws XMLDBException
Description copied from interface: UserManagementService
Get permissions for all resources contained in the current collection. Returns a list of permissions in the same order as Collection.listResources().

Specified by:
listResourcePermissions in interface UserManagementService
Returns:
Permission[]
Throws:
XMLDBException

listCollectionPermissions

public Permission[] listCollectionPermissions()
                                       throws XMLDBException
Description copied from interface: UserManagementService
Get permissions for all child collections contained in the current collection. Returns a list of permissions in the same order as Collection.listChildCollections().

Specified by:
listCollectionPermissions in interface UserManagementService
Returns:
Permission[]
Throws:
XMLDBException

getProperty

public String getProperty(String property)
                   throws XMLDBException
Gets the property attribute of the UserManagementServiceImpl object

Specified by:
getProperty in interface UserManagementService
Specified by:
getProperty in interface Configurable
Parameters:
property - Description of the Parameter
Returns:
The property value
Throws:
XMLDBException - Description of the Exception

getUser

public User getUser(String name)
             throws XMLDBException
Get user information for specified user

Specified by:
getUser in interface UserManagementService
Parameters:
name - Description of the Parameter
Returns:
The user value
Throws:
XMLDBException - Description of the Exception

getUsers

public User[] getUsers()
                throws XMLDBException
Get a list of all users currently defined

Specified by:
getUsers in interface UserManagementService
Returns:
The users value
Throws:
XMLDBException - Description of the Exception

getVersion

public String getVersion()
Gets the version attribute of the UserManagementServiceImpl object

Specified by:
getVersion in interface UserManagementService
Specified by:
getVersion in interface Service
Returns:
The version value

removeUser

public void removeUser(User u)
                throws XMLDBException
Remove user.

Specified by:
removeUser in interface UserManagementService
Parameters:
u - User
Throws:
XMLDBException

setCollection

public void setCollection(Collection collection)
                   throws XMLDBException
Sets the collection attribute of the UserManagementServiceImpl object

Specified by:
setCollection in interface UserManagementService
Specified by:
setCollection in interface Service
Parameters:
collection - The new collection value
Throws:
XMLDBException - Description of the Exception

setProperty

public void setProperty(String property,
                        String value)
                 throws XMLDBException
Sets the property attribute of the UserManagementServiceImpl object

Specified by:
setProperty in interface UserManagementService
Specified by:
setProperty in interface Configurable
Parameters:
property - The new property value
value - The new property value
Throws:
XMLDBException - Description of the Exception

updateUser

public void updateUser(User user)
                throws XMLDBException
Update the specified user

Specified by:
updateUser in interface UserManagementService
Parameters:
user - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

addUserGroup

public void addUserGroup(User user)
                  throws XMLDBException
Update the specified user without update user's password Method added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it

Specified by:
addUserGroup in interface UserManagementService
Parameters:
user - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

removeGroup

public void removeGroup(User user,
                        String rmgroup)
                 throws XMLDBException
Update the specified user removing a group from user's group method added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it

Specified by:
removeGroup in interface UserManagementService
Parameters:
user - Description of the Parameter
rmgroup - Description of group to remove
Throws:
XMLDBException - Description of the Exception

getGroups

public String[] getGroups()
                   throws XMLDBException
Description copied from interface: UserManagementService
Retrieve a list of all existing groups. Please note: new groups are created automatically if a new group is assigned to a user. You can't add or remove them.

Specified by:
getGroups in interface UserManagementService
Returns:
List of all existing groups.
Throws:
XMLDBException


Copyright (C) Wolfgang Meier. All rights reserved.