public interface I_CmsUserDriver extends I_CmsDriver
Modifier and Type | Field and Description |
---|---|
static int |
DRIVER_TYPE_ID
The type ID to identify user driver implementations.
|
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION
Modifier and Type | Method and Description |
---|---|
void |
addResourceToOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsResource resource)
Adds a resource to the given organizational unit.
|
long |
countUsers(CmsDbContext dbc,
CmsUserSearchParameters searchParams)
Counts the total number of users which match the given search criteria.
|
void |
createAccessControlEntry(CmsDbContext dbc,
CmsProject project,
CmsUUID resource,
CmsUUID principal,
int allowed,
int denied,
int flags)
Creates an access control entry.
|
CmsGroup |
createGroup(CmsDbContext dbc,
CmsUUID groupId,
java.lang.String groupFqn,
java.lang.String description,
int flags,
java.lang.String parentGroupName)
Creates a new group.
|
CmsOrganizationalUnit |
createOrganizationalUnit(CmsDbContext dbc,
java.lang.String name,
java.lang.String description,
int flags,
CmsOrganizationalUnit parent,
java.lang.String associationRootPath)
Creates a new organizational unit.
|
void |
createRootOrganizationalUnit(CmsDbContext dbc)
Creates the default root organizational unit.
|
CmsUser |
createUser(CmsDbContext dbc,
CmsUUID id,
java.lang.String userFqn,
java.lang.String password,
java.lang.String firstname,
java.lang.String lastname,
java.lang.String email,
long lastlogin,
int flags,
long dateCreated,
java.util.Map<java.lang.String,java.lang.Object> additionalInfos)
Creates a new user.
|
void |
createUserInGroup(CmsDbContext dbc,
CmsUUID userid,
CmsUUID groupid)
Adds a user to a group.
|
void |
deleteGroup(CmsDbContext dbc,
java.lang.String groupFqn)
Deletes a group.
|
void |
deleteOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit organizationalUnit)
Deletes an organizational unit.
|
void |
deleteUser(CmsDbContext dbc,
java.lang.String userFqn)
Deletes a user.
|
void |
deleteUserInfos(CmsDbContext dbc,
CmsUUID userId)
Deletes the user additional information table.
|
void |
deleteUserInGroup(CmsDbContext dbc,
CmsUUID userId,
CmsUUID groupId)
Removes a user from a group.
|
void |
destroy()
Destroys this driver.
|
boolean |
existsGroup(CmsDbContext dbc,
java.lang.String groupFqn)
Tests if a group with the specified name exists.
|
boolean |
existsUser(CmsDbContext dbc,
java.lang.String userFqn)
Tests if a user with the specified name exists.
|
void |
fillDefaults(CmsDbContext dbc)
Initializes the default organizational units, users and groups.
|
java.util.List<CmsGroup> |
getGroups(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean includeSubOus,
boolean readRoles)
Returns all groups of the given organizational unit.
|
java.util.List<CmsOrganizationalUnit> |
getOrganizationalUnits(CmsDbContext dbc,
CmsOrganizationalUnit parent,
boolean includeChildren)
Returns all child organizational units of the given parent organizational unit including
hierarchical deeper organization units if needed.
|
java.util.List<CmsResource> |
getResourcesForOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit)
Returns all resources of the given organizational unit.
|
CmsSqlManager |
getSqlManager()
Returns the SqlManager of this driver.
|
java.util.List<CmsUser> |
getUsers(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive)
Returns all users of the given organizational unit.
|
java.util.List<CmsUser> |
getUsersWithoutAdditionalInfo(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive)
Returns all users of the given organizational unit, without reading their additional infos.
|
CmsSqlManager |
initSqlManager(java.lang.String classname)
Initializes the SQL manager for this driver.
|
void |
publishAccessControlEntries(CmsDbContext dbc,
CmsProject offlineProject,
CmsProject onlineProject,
CmsUUID offlineId,
CmsUUID onlineId)
Publish all access control entries of a resource from the given offline project to the online project.
|
java.util.List<CmsAccessControlEntry> |
readAccessControlEntries(CmsDbContext dbc,
CmsProject project,
CmsUUID resource,
boolean inheritedOnly)
Reads all relevant access control entries for a given resource.
|
CmsAccessControlEntry |
readAccessControlEntry(CmsDbContext dbc,
CmsProject project,
CmsUUID resource,
CmsUUID principal)
Reads an access control entry for a given principal that is attached to a resource.
|
java.util.List<CmsGroup> |
readChildGroups(CmsDbContext dbc,
java.lang.String groupFqn)
Reads all child groups of a group.
|
CmsGroup |
readGroup(CmsDbContext dbc,
CmsUUID groupId)
Reads a group based on the group id.
|
CmsGroup |
readGroup(CmsDbContext dbc,
java.lang.String groupFqn)
Reads a group based on the group name.
|
java.util.List<CmsGroup> |
readGroupsOfUser(CmsDbContext dbc,
CmsUUID userId,
java.lang.String ouFqn,
boolean includeChildOus,
java.lang.String remoteAddress,
boolean readRoles)
Reads all groups the given user is a member in.
|
CmsOrganizationalUnit |
readOrganizationalUnit(CmsDbContext dbc,
java.lang.String ouFqn)
Reads an organizational Unit based on its fully qualified name.
|
CmsUser |
readUser(CmsDbContext dbc,
CmsUUID id)
Reads a user based on the user id.
|
CmsUser |
readUser(CmsDbContext dbc,
java.lang.String userFqn)
Reads a user based in the user fully qualified name.
|
CmsUser |
readUser(CmsDbContext dbc,
java.lang.String userFqn,
java.lang.String password,
java.lang.String remoteAddress)
Reads a user from the database, only if the password is correct.
|
java.util.Map<java.lang.String,java.lang.Object> |
readUserInfos(CmsDbContext dbc,
CmsUUID userId)
Reads the user additional information map.
|
java.util.List<CmsUser> |
readUsersOfGroup(CmsDbContext dbc,
java.lang.String groupFqn,
boolean includeOtherOuUsers)
Reads all users that are members of the given group.
|
void |
removeAccessControlEntries(CmsDbContext dbc,
CmsProject project,
CmsUUID resource)
Removes all access control entries belonging to a resource.
|
void |
removeAccessControlEntriesForPrincipal(CmsDbContext dbc,
CmsProject project,
CmsProject onlineProject,
CmsUUID principal)
Removes all access control entries belonging to a principal.
|
void |
removeAccessControlEntry(CmsDbContext dbc,
CmsProject project,
CmsUUID resource,
CmsUUID principal)
Removes an access control entry.
|
void |
removeResourceFromOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsResource resource)
Removes a resource from the given organizational unit.
|
java.util.List<CmsUser> |
searchUsers(CmsDbContext dbc,
CmsUserSearchParameters searchParams)
Searches for users which match the given search criteria.
|
void |
setDriverManager(CmsDriverManager driverManager)
Sets the driver manager for this driver if possible.
|
void |
setSqlManager(CmsSqlManager sqlManager)
Sets the SQL manager for this driver if possible.
|
void |
setUsersOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsUser user)
Moves an user to the given organizational unit.
|
void |
writeAccessControlEntry(CmsDbContext dbc,
CmsProject project,
CmsAccessControlEntry acEntry)
Writes an access control entry.
|
void |
writeGroup(CmsDbContext dbc,
CmsGroup group)
Writes an already existing group.
|
void |
writeOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit organizationalUnit)
Writes an already existing organizational unit.
|
void |
writePassword(CmsDbContext dbc,
java.lang.String userFqn,
java.lang.String oldPassword,
java.lang.String newPassword)
Sets a new password for a user.
|
void |
writeUser(CmsDbContext dbc,
CmsUser user)
Updates the user information.
|
void |
writeUserInfo(CmsDbContext dbc,
CmsUUID userId,
java.lang.String key,
java.lang.Object value)
Writes an user additional information entry.
|
init, toString
static final int DRIVER_TYPE_ID
void addResourceToOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsDataAccessException
dbc
- the current db contextorgUnit
- the organizational unit to add the resource toresource
- the resource that is to be added to the organizational unitCmsDataAccessException
- if something goes wronglong countUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams) throws CmsDataAccessException
dbc
- the database contextsearchParams
- the search criteriaCmsDataAccessException
- if something goes wrongvoid createAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal, int allowed, int denied, int flags) throws CmsDataAccessException
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceprincipal
- the id of the principal (user or group)allowed
- the bitset of allowed permissionsdenied
- the bitset of denied permissionsflags
- flagsCmsDataAccessException
- if something goes wrongCmsGroup createGroup(CmsDbContext dbc, CmsUUID groupId, java.lang.String groupFqn, java.lang.String description, int flags, java.lang.String parentGroupName) throws CmsDataAccessException
dbc
- the current database contextgroupId
- the id of the new groupgroupFqn
- the fully qualified name of the new groupdescription
- The description for the new groupflags
- the flags for the new groupparentGroupName
- the name of the parent group (or null if the group has no parent)CmsDataAccessException
- if something goes wrongCmsOrganizationalUnit createOrganizationalUnit(CmsDbContext dbc, java.lang.String name, java.lang.String description, int flags, CmsOrganizationalUnit parent, java.lang.String associationRootPath) throws CmsDataAccessException
dbc
- the current db contextname
- the name of the new organizational unitdescription
- the description of the new organizational unitflags
- the flags for the new organizational unitparent
- the parent organizational unit (or null
)associationRootPath
- the first associated resourceCmsOrganizationalUnit
object representing
the newly created organizational unitCmsDataAccessException
- if operation was not successfulvoid createRootOrganizationalUnit(CmsDbContext dbc)
dbc
- the current database contextCmsUser createUser(CmsDbContext dbc, CmsUUID id, java.lang.String userFqn, java.lang.String password, java.lang.String firstname, java.lang.String lastname, java.lang.String email, long lastlogin, int flags, long dateCreated, java.util.Map<java.lang.String,java.lang.Object> additionalInfos) throws CmsDataAccessException
dbc
- the current database contextid
- the id of the useruserFqn
- the fully qualified name of the new userpassword
- the already encripted user passwordfirstname
- the user firstnamelastname
- the user lastnameemail
- the user emaillastlogin
- the user lastlogin timeflags
- the user flagsdateCreated
- the creation dateadditionalInfos
- the user additional infosCmsDataAccessException
- if something goes wrongvoid createUserInGroup(CmsDbContext dbc, CmsUUID userid, CmsUUID groupid) throws CmsDataAccessException
dbc
- the current database contextuserid
- the id of the user that is to be added to the groupgroupid
- the id of the groupCmsDataAccessException
- if operation was not successfulvoid deleteGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
Only groups that contain no subgroups can be deleted.
dbc
- the current database contextgroupFqn
- the fully qualified name of the group that is to be deletedCmsDataAccessException
- if something goes wrongvoid deleteOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsDataAccessException
Only organizational units that contain no suborganizational unit can be deleted.
dbc
- the current db contextorganizationalUnit
- the organizational unit to deleteCmsDataAccessException
- if operation was not successfulvoid deleteUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
dbc
- the current database contextuserFqn
- the fully qualified name of the user to deleteCmsDataAccessException
- if something goes wrongvoid deleteUserInfos(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the user to updateCmsDataAccessException
- if something goes wrongvoid deleteUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the user that is to be removed from the groupgroupId
- the id of the groupCmsDataAccessException
- if something goes wrongvoid destroy() throws java.lang.Throwable
java.lang.Throwable
- if something goes wrongboolean existsGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
dbc
- the current database contextgroupFqn
- the fully qualified group name to be checkedtrue
, if a group with the specified name exists, false
otherwiseCmsDataAccessException
- if something goes wrongboolean existsUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
dbc
- the current database contextuserFqn
- the fully qualified name of the user to be checkedCmsDataAccessException
- if something goes wrongvoid fillDefaults(CmsDbContext dbc) throws CmsInitException
dbc
- the current database context, be aware that this dbc has no runtime data!CmsInitException
- if something goes wrongjava.util.List<CmsGroup> getGroups(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus, boolean readRoles) throws CmsDataAccessException
dbc
- the current db contextorgUnit
- the organizational unit to get all groups forincludeSubOus
- flag to signalize the retrieval of groups of sub-organizational units tooreadRoles
- if to read roles or groupsCmsGroup
objects in the organizational unitCmsDataAccessException
- if operation was not successfuljava.util.List<CmsOrganizationalUnit> getOrganizationalUnits(CmsDbContext dbc, CmsOrganizationalUnit parent, boolean includeChildren) throws CmsDataAccessException
dbc
- the current db contextparent
- the parent organizational unit, or null
for the rootincludeChildren
- if hierarchical deeper organization units should also be returnedCmsOrganizationalUnit
objectsCmsDataAccessException
- if operation was not succesfuljava.util.List<CmsResource> getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) throws CmsDataAccessException
dbc
- the current db contextorgUnit
- the organizational unit to get all resources forCmsResource
objects in the organizational unitCmsDataAccessException
- if operation was not successfulCmsSqlManager getSqlManager()
java.util.List<CmsUser> getUsers(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) throws CmsDataAccessException
dbc
- the current db contextorgUnit
- the organizational unit to get all users forrecursive
- flag to signalize the retrieval of users of sub-organizational units tooCmsUser
objects in the organizational unitCmsDataAccessException
- if operation was not successfuljava.util.List<CmsUser> getUsersWithoutAdditionalInfo(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) throws CmsDataAccessException
dbc
- the current db contextorgUnit
- the organizational unit to get all users forrecursive
- flag to signalize the retrieval of users of sub-organizational units tooCmsUser
objects in the organizational unitCmsDataAccessException
- if operation was not successfulCmsSqlManager initSqlManager(java.lang.String classname)
To obtain JDBC connections from different pools, further {online|offline|history} pool Urls have to be specified.
classname
- the classname of the SQL managervoid publishAccessControlEntries(CmsDbContext dbc, CmsProject offlineProject, CmsProject onlineProject, CmsUUID offlineId, CmsUUID onlineId) throws CmsDataAccessException
Within the given project, the resource is identified by its offlineId, in the online project, it is identified by the given onlineId.
dbc
- the current database contextofflineProject
- an offline projectonlineProject
- the onlie projectofflineId
- the offline resource idonlineId
- the online resource idCmsDataAccessException
- if something goes wrongjava.util.List<CmsAccessControlEntry> readAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource, boolean inheritedOnly) throws CmsDataAccessException
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceinheritedOnly
- flag to indicate that only inherited entries should be returnedCmsAccessControlEntry
objects defining all permissions for the given resourceCmsDataAccessException
- if something goes wrongCmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal) throws CmsDataAccessException
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceprincipal
- the id of the principalCmsDataAccessException
- if something goes wrongjava.util.List<CmsGroup> readChildGroups(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
dbc
- the current database contextgroupFqn
- the fully qualified name of the group to read the child groups fromCmsGroup
objects or null
CmsDataAccessException
- if operation was not succesfulCmsGroup readGroup(CmsDbContext dbc, CmsUUID groupId) throws CmsDataAccessException
dbc
- the current database contextgroupId
- the id of the group that is to be readCmsDataAccessException
- if something goes wrongCmsGroup readGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
dbc
- the current database contextgroupFqn
- the fully qualified name of the group that is to be readCmsDataAccessException
- if something goes wrongjava.util.List<CmsGroup> readGroupsOfUser(CmsDbContext dbc, CmsUUID userId, java.lang.String ouFqn, boolean includeChildOus, java.lang.String remoteAddress, boolean readRoles) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the userouFqn
- the fully qualified name of the organizational unit to restrict the result set forincludeChildOus
- include groups of child organizational unitsremoteAddress
- the IP address to filter the groups in the result listreadRoles
- if to read roles or groupsCmsGroup
objectsCmsDataAccessException
- if something goes wrongCmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc, java.lang.String ouFqn) throws CmsDataAccessException
dbc
- the current db contextouFqn
- the fully qualified name of the organizational Unit to be readCmsDataAccessException
- if something goes wrongCmsUser readUser(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
dbc
- the current database contextid
- the id of the user to readCmsDataAccessException
- if something goes wrongCmsUser readUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
dbc
- the current database contextuserFqn
- the fully qualified name of the user to readCmsDataAccessException
- if something goes wrongCmsUser readUser(CmsDbContext dbc, java.lang.String userFqn, java.lang.String password, java.lang.String remoteAddress) throws CmsDataAccessException, CmsPasswordEncryptionException
dbc
- the current database contextuserFqn
- the name of the userpassword
- the password of the userremoteAddress
- the remote address of the request, may be null
CmsDataAccessException
- if something goes wrongCmsPasswordEncryptionException
- if the password of the user could not be encryptedjava.util.Map<java.lang.String,java.lang.Object> readUserInfos(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the user to updateCmsDataAccessException
- if something goes wrongjava.util.List<CmsUser> readUsersOfGroup(CmsDbContext dbc, java.lang.String groupFqn, boolean includeOtherOuUsers) throws CmsDataAccessException
dbc
- the current database contextgroupFqn
- the fully qualified name of the group to read the users fromincludeOtherOuUsers
- include users of other organizational unitsCmsUser
objects in the groupCmsDataAccessException
- if something goes wrongvoid removeAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource) throws CmsDataAccessException
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceCmsDataAccessException
- if something goes wrongvoid removeAccessControlEntriesForPrincipal(CmsDbContext dbc, CmsProject project, CmsProject onlineProject, CmsUUID principal) throws CmsDataAccessException
dbc
- the current database contextproject
- the project to write the entryonlineProject
- the online projectprincipal
- the id of the principalCmsDataAccessException
- if something goes wrongvoid removeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal) throws CmsDataAccessException
dbc
- the current database contextproject
- the project to write the entryresource
- the id of the resourceprincipal
- the id of the principalCmsDataAccessException
- if something goes wrongvoid removeResourceFromOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsDataAccessException
dbc
- the current db contextorgUnit
- the organizational unit to remove the resource fromresource
- the resource that is to be removed from the organizational unitCmsDataAccessException
- if something goes wrongjava.util.List<CmsUser> searchUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams) throws CmsDataAccessException
dbc
- the database contextsearchParams
- the search criteriaCmsDataAccessException
- if something goes wrongvoid setDriverManager(CmsDriverManager driverManager)
driverManager
- the new driver managervoid setSqlManager(CmsSqlManager sqlManager)
sqlManager
- the new SQL managervoid setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user) throws CmsDataAccessException
dbc
- the current db contextorgUnit
- the organizational unit to move the user touser
- the user that is to be moved to the given organizational unitCmsDataAccessException
- if something goes wrongvoid writeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsAccessControlEntry acEntry) throws CmsDataAccessException
dbc
- the current database contextproject
- the project to write the entryacEntry
- the entry to writeCmsDataAccessException
- if something goes wrongvoid writeGroup(CmsDbContext dbc, CmsGroup group) throws CmsDataAccessException
The group id has to be a valid OpenCms group id.
The group with the given id will be completely overriden
by the given data.
dbc
- the current database contextgroup
- the group to updateCmsDataAccessException
- if something goes wrongvoid writeOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsDataAccessException
The organizational unit id has to be a valid OpenCms organizational unit id.
The organizational unit with the given id will be completely overriden
by the given data.
dbc
- the current db contextorganizationalUnit
- the organizational unit that should be writtenCmsDataAccessException
- if operation was not successfulvoid writePassword(CmsDbContext dbc, java.lang.String userFqn, java.lang.String oldPassword, java.lang.String newPassword) throws CmsDataAccessException, CmsPasswordEncryptionException
dbc
- the current database contextuserFqn
- the fullyqualified name of the user to set the password foroldPassword
- the current passwordnewPassword
- the password to setCmsDataAccessException
- if something goes wrongCmsPasswordEncryptionException
- if the (new) password could not be encryptedvoid writeUser(CmsDbContext dbc, CmsUser user) throws CmsDataAccessException
The user id has to be a valid OpenCms user id.
The user with the given id will be completely overriden by the given data.
dbc
- the current database contextuser
- the user to updateCmsDataAccessException
- if something goes wrongvoid writeUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the user to updatekey
- the key of the info to writevalue
- the value of the info to writeCmsDataAccessException
- if something goes wrong