org.exist.xmldb
Class RemoteUserManagementService

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

public class RemoteUserManagementService
extends Object
implements EXistUserManagementService

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


Constructor Summary
RemoteUserManagementService(RemoteCollection collection)
           
 
Method Summary
 void addAccount(Account user)
          Add a new user account
 void addAccountToGroup(String accountName, String groupName)
           
 void addGroup(Group role)
           
 void addGroupManager(String manager, String groupName)
           
 void addUser(User user)
           
 void addUserGroup(Account user)
          Update the specified accounts groups
 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(Account u, String group)
          Change the owner of the current collection
 void chown(Resource res, Account u, String group)
          Change the owner of a resource
 Account getAccount(String name)
          Get user information for specified user
 Account[] getAccounts()
          Get a list of all users currently defined
 Group getGroup(String name)
           
 String[] getGroupMembers(String groupName)
           
 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
 Date getSubCollectionCreationTime(Collection cParent, String name)
           
 Permission getSubCollectionPermissions(Collection cParent, String name)
          Get the permissions of the sub-collection
 Permission getSubResourcePermissions(Collection cParent, String name)
          Get the permissions of the sub-resource
 User getUser(String name)
           
 User[] getUsers()
           
 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, Account u)
          Lock the specified resource for the specified user.
 void lockResource(Resource res, User u)
           
 void removeAccount(Account u)
          Remove user.
 void removeGroup(Group role)
           
 void removeGroupManager(String groupName, String manager)
           
 void removeGroupMember(String group, String account)
          Remove an account from a group
 void removeUser(User user)
           
 void setCollection(Collection collection)
          Sets the collection attribute of the UserManagementServiceImpl object
 void setPermissions(Collection child, Permission perm)
          Change permissions for a resource.
 void setPermissions(Collection child, String owner, String group, int mode, List<ACEAider> aces)
           
 void setPermissions(Resource res, Permission perm)
          Change permissions for a resource.
 void setPermissions(Resource res, String owner, String group, int mode, List<ACEAider> aces)
           
 void setProperty(String property, String value)
          Sets the property attribute of the UserManagementServiceImpl object
 void setUserPrimaryGroup(String username, String groupName)
           
 void unlockResource(Resource res)
          Unlock the specified resource.
 void updateAccount(Account user)
          Update the specified user
 void updateGroup(Group group)
          Update existing group information
 void updateUser(User 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

addAccount

public void addAccount(Account user)
                throws XMLDBException
Add a new user account

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

addGroup

public void addGroup(Group role)
              throws XMLDBException
Specified by:
addGroup in interface UserManagementService
Throws:
XMLDBException

setUserPrimaryGroup

public void setUserPrimaryGroup(String username,
                                String groupName)
                         throws XMLDBException
Specified by:
setUserPrimaryGroup in interface EXistUserManagementService
Throws:
XMLDBException

setPermissions

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

Specified by:
setPermissions in interface UserManagementService
Throws:
XMLDBException

setPermissions

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

Specified by:
setPermissions in interface UserManagementService
Throws:
XMLDBException

setPermissions

public void setPermissions(Collection child,
                           String owner,
                           String group,
                           int mode,
                           List<ACEAider> aces)
                    throws XMLDBException
Specified by:
setPermissions in interface UserManagementService
Throws:
XMLDBException

setPermissions

public void setPermissions(Resource res,
                           String owner,
                           String group,
                           int mode,
                           List<ACEAider> aces)
                    throws XMLDBException
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,
                         Account 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(Account 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,
                  Account 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

getSubCollectionCreationTime

public Date getSubCollectionCreationTime(Collection cParent,
                                         String name)
                                  throws XMLDBException
Specified by:
getSubCollectionCreationTime in interface UserManagementService
Throws:
XMLDBException

getSubCollectionPermissions

public Permission getSubCollectionPermissions(Collection cParent,
                                              String name)
                                       throws XMLDBException
Description copied from interface: UserManagementService
Get the permissions of the sub-collection

Specified by:
getSubCollectionPermissions in interface UserManagementService
Throws:
XMLDBException

getSubResourcePermissions

public Permission getSubResourcePermissions(Collection cParent,
                                            String name)
                                     throws XMLDBException
Description copied from interface: UserManagementService
Get the permissions of the sub-resource

Specified by:
getSubResourcePermissions in interface UserManagementService
Throws:
XMLDBException

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

getAccount

public Account getAccount(String name)
                   throws XMLDBException
Get user information for specified user

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

getAccounts

public Account[] getAccounts()
                      throws XMLDBException
Get a list of all users currently defined

Specified by:
getAccounts in interface UserManagementService
Returns:
The user accounts
Throws:
XMLDBException - Description of the Exception

getGroup

public Group getGroup(String name)
               throws XMLDBException
Specified by:
getGroup in interface UserManagementService
Throws:
XMLDBException

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

removeAccount

public void removeAccount(Account u)
                   throws XMLDBException
Remove user.

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

removeGroup

public void removeGroup(Group role)
                 throws XMLDBException
Specified by:
removeGroup in interface UserManagementService
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

updateAccount

public void updateAccount(Account user)
                   throws XMLDBException
Update the specified user

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

updateGroup

public void updateGroup(Group group)
                 throws XMLDBException
Description copied from interface: UserManagementService
Update existing group information

Specified by:
updateGroup in interface UserManagementService
Parameters:
group - The group to update
Throws:
XMLDBException - if the group could not be updated

getGroupMembers

public String[] getGroupMembers(String groupName)
                         throws XMLDBException
Specified by:
getGroupMembers in interface UserManagementService
Throws:
XMLDBException

addAccountToGroup

public void addAccountToGroup(String accountName,
                              String groupName)
                       throws XMLDBException
Specified by:
addAccountToGroup in interface UserManagementService
Throws:
XMLDBException

addGroupManager

public void addGroupManager(String manager,
                            String groupName)
                     throws XMLDBException
Specified by:
addGroupManager in interface UserManagementService
Throws:
XMLDBException

removeGroupManager

public void removeGroupManager(String groupName,
                               String manager)
                        throws XMLDBException
Specified by:
removeGroupManager in interface UserManagementService
Throws:
XMLDBException

addUserGroup

public void addUserGroup(Account user)
                  throws XMLDBException
Update the specified accounts groups

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

removeGroupMember

public void removeGroupMember(String group,
                              String account)
                       throws XMLDBException
Remove an account from a group

Specified by:
removeGroupMember in interface UserManagementService
Throws:
XMLDBException

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

addUser

public void addUser(User user)
             throws XMLDBException
Specified by:
addUser in interface UserManagementService
Throws:
XMLDBException

updateUser

public void updateUser(User user)
                throws XMLDBException
Specified by:
updateUser in interface UserManagementService
Throws:
XMLDBException

getUser

public User getUser(String name)
             throws XMLDBException
Specified by:
getUser in interface UserManagementService
Throws:
XMLDBException

getUsers

public User[] getUsers()
                throws XMLDBException
Specified by:
getUsers in interface UserManagementService
Throws:
XMLDBException

removeUser

public void removeUser(User user)
                throws XMLDBException
Specified by:
removeUser in interface UserManagementService
Throws:
XMLDBException

lockResource

public void lockResource(Resource res,
                         User u)
                  throws XMLDBException
Specified by:
lockResource in interface UserManagementService
Throws:
XMLDBException


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