org.exist.xmldb
Interface UserManagementService

All Superinterfaces:
Configurable, Service
All Known Subinterfaces:
EXistUserManagementService
All Known Implementing Classes:
LocalUserManagementService, RemoteUserManagementService

public interface UserManagementService
extends Service

An eXist-specific service which provides methods to manage users and permissions.

Author:
Wolfgang Meier , Modified by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it, Adam Retter

Method Summary
 void addAccount(Account account)
          Add a new account to the database
 void addAccountToGroup(String accountName, String groupName)
           
 void addGroup(Group group)
           
 void addGroupManager(String manager, String groupName)
           
 void addUser(User user)
          Deprecated. 
 void addUserGroup(Account 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 resource, int mode)
          Change permissions for the specified resource.
 void chmod(Resource resource, String modeStr)
          Change permissions for the specified resource.
 void chmod(String modeStr)
          Change permissions for the current collection
 void chown(Account u, String group)
          Change owner and group of the current collection.
 void chown(Resource res, Account u, String group)
          Change owner and group of the specified resource.
 Account getAccount(String name)
          Get a account record from the database
 Account[] getAccounts()
          Retrieve a list of all existing accounts.
 Group getGroup(String name)
           
 String[] getGroupMembers(String groupName)
           
 String[] getGroups()
          Retrieve a list of all existing groups.
 String getName()
          Get the name of this service
 Permission getPermissions(Collection coll)
          Get permissions for the specified collections
 Permission getPermissions(Resource res)
          Get permissions for the specified resource
 String getProperty(String property)
          Get a property defined by this service.
 Date getSubCollectionCreationTime(Collection parent, String string)
           
 Permission getSubCollectionPermissions(Collection parent, String name)
          Get the permissions of the sub-collection
 Permission getSubResourcePermissions(Collection parent, String name)
          Get the permissions of the sub-resource
 User getUser(String name)
          Deprecated. 
 User[] getUsers()
          Deprecated. 
 String getVersion()
          Get the version of this service
 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, Account u)
          Lock the specified resource for the specified user.
 void lockResource(Resource res, User u)
          Deprecated. 
 void removeAccount(Account account)
          Delete a user from the database
 void removeGroup(Group group)
           
 void removeGroupManager(String groupName, String manager)
           
 void removeGroupMember(String group, String account)
           
 void removeUser(User user)
          Deprecated. 
 void setCollection(Collection collection)
          Set the current collection for this service
 void setPermissions(Collection child, Permission perm)
          Set permissions for the specified collection.
 void setPermissions(Collection child, String owner, String group, int mode, List<ACEAider> aces)
           
 void setPermissions(Resource resource, Permission perm)
          Set permissions for the specified resource.
 void setPermissions(Resource resource, String owner, String group, int mode, List<ACEAider> aces)
           
 void setProperty(String property, String value)
          Set a property for this service.
 void unlockResource(Resource res)
          Unlock the specified resource.
 void updateAccount(Account account)
          Update existing account information
 void updateGroup(Group group)
          Update existing group information
 void updateUser(User user)
          Deprecated. 
 

Method Detail

getName

String getName()
Get the name of this service

Specified by:
getName in interface Service
Returns:
The name

getVersion

String getVersion()
Get the version of this service

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

setPermissions

void setPermissions(Collection child,
                    Permission perm)
                    throws XMLDBException
Set permissions for the specified collection.

Parameters:
child -
perm -
Throws:
XMLDBException

setPermissions

void setPermissions(Collection child,
                    String owner,
                    String group,
                    int mode,
                    List<ACEAider> aces)
                    throws XMLDBException
Throws:
XMLDBException

setPermissions

void setPermissions(Resource resource,
                    Permission perm)
                    throws XMLDBException
Set permissions for the specified resource.

Parameters:
resource -
perm -
Throws:
XMLDBException

setPermissions

void setPermissions(Resource resource,
                    String owner,
                    String group,
                    int mode,
                    List<ACEAider> aces)
                    throws XMLDBException
Throws:
XMLDBException

chown

void chown(Account u,
           String group)
           throws XMLDBException
Change owner and group of the current collection.

Parameters:
u - Description of the Parameter
group - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

chown

void chown(Resource res,
           Account u,
           String group)
           throws XMLDBException
Change owner and group of the specified resource.

Parameters:
res - Description of the Parameter
u - Description of the Parameter
group - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

chmod

void chmod(Resource resource,
           String modeStr)
           throws XMLDBException
Change permissions for the specified resource. Permissions are specified in a string according to the following format:
[user|group|other]=[+|-][read|write|update]
For example, to grant all permissions to the group and deny everything to others: group=+write,+read,+update,other=-read The changes are applied to the permissions currently active for this resource.

Parameters:
resource - Description of the Parameter
modeStr - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

chmod

void chmod(String modeStr)
           throws XMLDBException
Change permissions for the current collection

Parameters:
modeStr - String describing the permissions to grant or deny.
Throws:
XMLDBException

chmod

void chmod(int mode)
           throws XMLDBException
Throws:
XMLDBException

chmod

void chmod(Resource resource,
           int mode)
           throws XMLDBException
Change permissions for the specified resource.

Throws:
XMLDBException

lockResource

void lockResource(Resource res,
                  Account u)
                  throws XMLDBException
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.

Parameters:
res -
u -
Throws:
XMLDBException

hasUserLock

String hasUserLock(Resource res)
                   throws XMLDBException
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.

Parameters:
res -
Returns:
Name of the owner of the lock
Throws:
XMLDBException

unlockResource

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

Parameters:
res -
Throws:
XMLDBException

addAccount

void addAccount(Account account)
                throws XMLDBException
Add a new account to the database

Parameters:
account - The feature to be added to the Account
Throws:
XMLDBException - Description of the Exception

updateAccount

void updateAccount(Account account)
                   throws XMLDBException
Update existing account information

Parameters:
account - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

updateGroup

void updateGroup(Group group)
                 throws XMLDBException
Update existing group information

Parameters:
group - The group to update
Throws:
XMLDBException - if the group could not be updated

getAccount

Account getAccount(String name)
                   throws XMLDBException
Get a account record from the database

Parameters:
name - Description of the Parameter
Returns:
The user value
Throws:
XMLDBException - Description of the Exception

addAccountToGroup

void addAccountToGroup(String accountName,
                       String groupName)
                       throws XMLDBException
Throws:
XMLDBException

addGroupManager

void addGroupManager(String manager,
                     String groupName)
                     throws XMLDBException
Throws:
XMLDBException

removeGroupManager

void removeGroupManager(String groupName,
                        String manager)
                        throws XMLDBException
Throws:
XMLDBException

getAccounts

Account[] getAccounts()
                      throws XMLDBException
Retrieve a list of all existing accounts.

Returns:
The accounts value
Throws:
XMLDBException - Description of the Exception

getGroup

Group getGroup(String name)
               throws XMLDBException
Throws:
XMLDBException

getGroups

String[] getGroups()
                   throws XMLDBException
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.

Returns:
List of all existing groups.
Throws:
XMLDBException

getProperty

String getProperty(String property)
                   throws XMLDBException
Get a property defined by this service.

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

setProperty

void setProperty(String property,
                 String value)
                 throws XMLDBException
Set a property for this service.

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

setCollection

void setCollection(Collection collection)
                   throws XMLDBException
Set the current collection for this service

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

getPermissions

Permission getPermissions(Collection coll)
                          throws XMLDBException
Get permissions for the specified collections

Parameters:
coll - Description of the Parameter
Returns:
The permissions value
Throws:
XMLDBException - Description of the Exception

getSubCollectionPermissions

Permission getSubCollectionPermissions(Collection parent,
                                       String name)
                                       throws XMLDBException
Get the permissions of the sub-collection

Throws:
XMLDBException

getSubResourcePermissions

Permission getSubResourcePermissions(Collection parent,
                                     String name)
                                     throws XMLDBException
Get the permissions of the sub-resource

Throws:
XMLDBException

getSubCollectionCreationTime

Date getSubCollectionCreationTime(Collection parent,
                                  String string)
                                  throws XMLDBException
Throws:
XMLDBException

getPermissions

Permission getPermissions(Resource res)
                          throws XMLDBException
Get permissions for the specified resource

Parameters:
res - Description of the Parameter
Returns:
The permissions value
Throws:
XMLDBException - Description of the Exception

listResourcePermissions

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

Returns:
Permission[]
Throws:
XMLDBException

listCollectionPermissions

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

Returns:
Permission[]
Throws:
XMLDBException

removeAccount

void removeAccount(Account account)
                   throws XMLDBException
Delete a user from the database

Parameters:
account - User
Throws:
XMLDBException

removeGroup

void removeGroup(Group group)
                 throws XMLDBException
Throws:
XMLDBException

addUserGroup

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

Parameters:
user - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

removeGroupMember

void removeGroupMember(String group,
                       String account)
                       throws XMLDBException
Throws:
XMLDBException

addGroup

void addGroup(Group group)
              throws XMLDBException
Throws:
XMLDBException

addUser

@Deprecated
void addUser(User user)
             throws XMLDBException
Deprecated. 

Throws:
XMLDBException

updateUser

@Deprecated
void updateUser(User user)
                throws XMLDBException
Deprecated. 

Throws:
XMLDBException

getUser

@Deprecated
User getUser(String name)
             throws XMLDBException
Deprecated. 

Throws:
XMLDBException

getUsers

@Deprecated
User[] getUsers()
                throws XMLDBException
Deprecated. 

Throws:
XMLDBException

removeUser

@Deprecated
void removeUser(User user)
                throws XMLDBException
Deprecated. 

Throws:
XMLDBException

lockResource

@Deprecated
void lockResource(Resource res,
                             User u)
                  throws XMLDBException
Deprecated. 

Throws:
XMLDBException

getGroupMembers

String[] getGroupMembers(String groupName)
                         throws XMLDBException
Throws:
XMLDBException


Copyright (C) The eXist-db Project. All rights reserved.