org.exist.xmldb
Class RemoteUserManagementService

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

public class RemoteUserManagementService
extends java.lang.Object
implements UserManagementService


Constructor Summary
RemoteUserManagementService(RemoteCollection collection)
           
 
Method Summary
 void addUser(User user)
          Add a new user account
 void chmod(int mode)
           
 void chmod(org.xmldb.api.base.Resource res, int mode)
          Change permissions for the specified resource.
 void chmod(org.xmldb.api.base.Resource res, java.lang.String mode)
          Change access mode of a resource
 void chmod(java.lang.String mode)
          Change access mode of the current collection
 void chown(org.xmldb.api.base.Resource res, User u, java.lang.String group)
          Change the owner of a resource
 void chown(User u, java.lang.String group)
          Change the owner of the current collection
 java.lang.String[] getGroups()
          Retrieve a list of all existing groups.
 java.lang.String getName()
          Gets the name attribute of the UserManagementServiceImpl object
 Permission getPermissions(org.xmldb.api.base.Collection coll)
          Get current permissions for a collection
 Permission getPermissions(org.xmldb.api.base.Resource res)
          Get current permissions for a resource
 java.lang.String getProperty(java.lang.String property)
          Gets the property attribute of the UserManagementServiceImpl object
 User getUser(java.lang.String name)
          Get user information for specified user
 User[] getUsers()
          Get a list of all users currently defined
 java.lang.String getVersion()
          Gets the version attribute of the UserManagementServiceImpl object
 java.lang.String hasUserLock(org.xmldb.api.base.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(org.xmldb.api.base.Resource res, User u)
          Lock the specified resource for the specified user.
 void removeUser(User u)
          Description of the Method
 void setCollection(org.xmldb.api.base.Collection collection)
          Sets the collection attribute of the UserManagementServiceImpl object
 void setPermissions(org.xmldb.api.base.Collection child, Permission perms)
          Change permissions for a resource.
 void setPermissions(org.xmldb.api.base.Resource res, Permission perms)
          Change permissions for a resource.
 void setProperty(java.lang.String property, java.lang.String value)
          Sets the property attribute of the UserManagementServiceImpl object
 void unlockResource(org.xmldb.api.base.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 org.xmldb.api.base.XMLDBException
Add a new user account

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

setPermissions

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

Specified by:
setPermissions in interface UserManagementService
Throws:
org.xmldb.api.base.XMLDBException

setPermissions

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

Specified by:
setPermissions in interface UserManagementService
Throws:
org.xmldb.api.base.XMLDBException

chmod

public void chmod(org.xmldb.api.base.Resource res,
                  java.lang.String mode)
           throws org.xmldb.api.base.XMLDBException
Change access mode of a resource

Specified by:
chmod in interface UserManagementService
Parameters:
mode - Access mode
res - Description of the Parameter
Throws:
org.xmldb.api.base.XMLDBException - Description of the Exception

chmod

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

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

chmod

public void chmod(java.lang.String mode)
           throws org.xmldb.api.base.XMLDBException
Change access mode of the current collection

Specified by:
chmod in interface UserManagementService
Parameters:
mode - Access mode
Throws:
org.xmldb.api.base.XMLDBException - Description of the Exception

chmod

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

lockResource

public void lockResource(org.xmldb.api.base.Resource res,
                         User u)
                  throws org.xmldb.api.base.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:
org.xmldb.api.base.XMLDBException

hasUserLock

public java.lang.String hasUserLock(org.xmldb.api.base.Resource res)
                             throws org.xmldb.api.base.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:
Throws:
org.xmldb.api.base.XMLDBException

unlockResource

public void unlockResource(org.xmldb.api.base.Resource res)
                    throws org.xmldb.api.base.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:
org.xmldb.api.base.XMLDBException

chown

public void chown(User u,
                  java.lang.String group)
           throws org.xmldb.api.base.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:
org.xmldb.api.base.XMLDBException - Description of the Exception

chown

public void chown(org.xmldb.api.base.Resource res,
                  User u,
                  java.lang.String group)
           throws org.xmldb.api.base.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:
org.xmldb.api.base.XMLDBException - Description of the Exception

getName

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

Specified by:
getName in interface UserManagementService
Specified by:
getName in interface org.xmldb.api.base.Service
Returns:
The name value

getPermissions

public Permission getPermissions(org.xmldb.api.base.Collection coll)
                          throws org.xmldb.api.base.XMLDBException
Get current permissions for a collection

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

getPermissions

public Permission getPermissions(org.xmldb.api.base.Resource res)
                          throws org.xmldb.api.base.XMLDBException
Get current permissions for a resource

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

listResourcePermissions

public Permission[] listResourcePermissions()
                                     throws org.xmldb.api.base.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:
org.xmldb.api.base.XMLDBException

listCollectionPermissions

public Permission[] listCollectionPermissions()
                                       throws org.xmldb.api.base.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:
org.xmldb.api.base.XMLDBException

getProperty

public java.lang.String getProperty(java.lang.String property)
                             throws org.xmldb.api.base.XMLDBException
Gets the property attribute of the UserManagementServiceImpl object

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

getUser

public User getUser(java.lang.String name)
             throws org.xmldb.api.base.XMLDBException
Get user information for specified user

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

getUsers

public User[] getUsers()
                throws org.xmldb.api.base.XMLDBException
Get a list of all users currently defined

Specified by:
getUsers in interface UserManagementService
Returns:
The users value
Throws:
org.xmldb.api.base.XMLDBException - Description of the Exception

getVersion

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

Specified by:
getVersion in interface UserManagementService
Specified by:
getVersion in interface org.xmldb.api.base.Service
Returns:
The version value

removeUser

public void removeUser(User u)
                throws org.xmldb.api.base.XMLDBException
Description of the Method

Specified by:
removeUser in interface UserManagementService
Parameters:
name - Description of the Parameter
Throws:
org.xmldb.api.base.XMLDBException - Description of the Exception

setCollection

public void setCollection(org.xmldb.api.base.Collection collection)
                   throws org.xmldb.api.base.XMLDBException
Sets the collection attribute of the UserManagementServiceImpl object

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

setProperty

public void setProperty(java.lang.String property,
                        java.lang.String value)
                 throws org.xmldb.api.base.XMLDBException
Sets the property attribute of the UserManagementServiceImpl object

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

updateUser

public void updateUser(User user)
                throws org.xmldb.api.base.XMLDBException
Update the specified user

Specified by:
updateUser in interface UserManagementService
Parameters:
user - Description of the Parameter
Throws:
org.xmldb.api.base.XMLDBException - Description of the Exception

getGroups

public java.lang.String[] getGroups()
                             throws org.xmldb.api.base.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:
Throws:
org.xmldb.api.base.XMLDBException


Copyright (C) Wolfgang Meier. All rights reserved.