org.exist.xmldb
Class UserManagementServiceImpl

java.lang.Object
  extended byorg.exist.xmldb.UserManagementServiceImpl
All Implemented Interfaces:
Configurable, Service, UserManagementService

public class UserManagementServiceImpl
extends java.lang.Object
implements UserManagementService

Description of the Class

Author:
Wolfgang Meier

Constructor Summary
UserManagementServiceImpl(RemoteCollection collection)
           
 
Method Summary
 void addUser(User user)
          Add a new user account
 void chmod(int mode)
           
 void chmod(Resource res, int mode)
           
 void chmod(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(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(Collection coll)
          Get current permissions for a collection
 Permission getPermissions(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
 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 removeUser(User u)
          Description of the Method
 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(java.lang.String property, java.lang.String value)
          Sets the property attribute of the UserManagementServiceImpl object
 void updateUser(User user)
          Update the specified user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManagementServiceImpl

public UserManagementServiceImpl(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
Parameters:
res -
perms -
Throws:
XMLDBException

setPermissions

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

Specified by:
setPermissions in interface UserManagementService
Parameters:
child -
perms -
Throws:
XMLDBException

chmod

public void chmod(Resource res,
                  java.lang.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
Specified by:
chmod in interface UserManagementService
Throws:
XMLDBException
See Also:
UserManagementService.chmod(org.xmldb.api.base.Resource, int)

chmod

public void chmod(java.lang.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)

chown

public void chown(User u,
                  java.lang.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,
                  java.lang.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 java.lang.String getName()
Gets the name attribute of the UserManagementServiceImpl object

Specified by:
getName in interface UserManagementService
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 java.lang.String getProperty(java.lang.String property)
                             throws XMLDBException
Gets the property attribute of the UserManagementServiceImpl object

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

getUser

public User getUser(java.lang.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 java.lang.String getVersion()
Gets the version attribute of the UserManagementServiceImpl object

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

removeUser

public void removeUser(User u)
                throws XMLDBException
Description of the Method

Specified by:
removeUser in interface UserManagementService
Throws:
XMLDBException - Description of the Exception

setCollection

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

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

setProperty

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

Specified by:
setProperty in interface UserManagementService
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

getGroups

public java.lang.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:
Throws:
XMLDBException


Copyright (C) Wolfgang Meier. All rights reserved.