public class CmsUserDriver extends java.lang.Object implements I_CmsUserDriver
| Modifier and Type | Field and Description |
|---|---|
protected java.security.MessageDigest |
m_digest
A digest to encrypt the passwords.
|
protected java.lang.String |
m_digestAlgorithm
The algorithm used to encode passwords.
|
protected java.lang.String |
m_digestFileEncoding
The file.encoding to code passwords after encryption with digest.
|
protected CmsDriverManager |
m_driverManager
The driver manager.
|
protected CmsSqlManager |
m_sqlManager
The SQL manager.
|
static java.lang.String |
ORGUNIT_BASE_FOLDER
The root path for organizational units.
|
static java.lang.String |
REQ_ATTR_DONT_DIGEST_PASSWORD
The internal request attribute to indicate that the password has not to be digested.
|
DRIVER_TYPE_IDAND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION| Constructor and Description |
|---|
CmsUserDriver() |
| 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 parentGroupFqn)
Creates a new group.
|
CmsOrganizationalUnit |
createOrganizationalUnit(CmsDbContext dbc,
java.lang.String name,
java.lang.String description,
int flags,
CmsOrganizationalUnit parent,
java.lang.String associatedResource)
Creates a new organizational unit.
|
protected java.lang.String |
createRoleQuery(java.lang.String mainQuery,
boolean includeSubOus,
boolean readRoles)
Returns a sql query to select groups.
|
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.
|
protected CmsPair<java.lang.String,java.util.List<java.lang.Object>> |
createUserQuery(CmsUserSearchParameters searchParams,
boolean countOnly)
Creates a query for searching users.
|
protected CmsUserQueryBuilder |
createUserQueryBuilder()
Creates a new user query builder.
|
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.
|
void |
init(CmsDbContext dbc,
CmsConfigurationManager configurationManager,
java.util.List<java.lang.String> successiveDrivers,
CmsDriverManager driverManager)
Initializes the driver.
|
CmsSqlManager |
initSqlManager(java.lang.String classname)
Initializes the SQL manager for this driver.
|
protected CmsAccessControlEntry |
internalCreateAce(java.sql.ResultSet res)
Internal helper method to create an access control entry from a database record.
|
protected CmsAccessControlEntry |
internalCreateAce(java.sql.ResultSet res,
CmsUUID newId)
Internal helper method to create an access control entry from a database record.
|
protected void |
internalCreateDefaultGroups(CmsDbContext dbc,
java.lang.String ouFqn,
java.lang.String ouDescription,
boolean webuser)
Creates the default groups and user for the given organizational unit.
|
protected CmsGroup |
internalCreateGroup(java.sql.ResultSet res)
Semi-constructor to create a
CmsGroup instance from a JDBC result set. |
protected CmsOrganizationalUnit |
internalCreateOrgUnitFromResource(CmsDbContext dbc,
CmsResource resource)
Returns the organizational unit represented by the given resource.
|
protected CmsResource |
internalCreateResourceForOrgUnit(CmsDbContext dbc,
java.lang.String path,
int flags)
Creates a folder with the given path an properties, offline AND online.
|
protected CmsUser |
internalCreateUser(CmsDbContext dbc,
java.sql.ResultSet res)
Semi-constructor to create a
CmsUser instance from a JDBC result set. |
protected void |
internalDeleteOrgUnitResource(CmsDbContext dbc,
CmsResource resource)
Deletes a resource representing a organizational unit, offline AND online.
|
protected void |
internalDeleteUserInfo(CmsDbContext dbc,
CmsUUID userId,
java.lang.String key)
Deletes an additional user info.
|
protected java.util.List<CmsUser> |
internalGetUsers(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive,
boolean readAdditionalInfos)
Internal implementation for reading users of an OU, with or without additional infos.
|
protected CmsResource |
internalOrgUnitFolder(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit)
Returns the folder for the given organizational units, or the base folder if
null. |
protected java.util.List<java.lang.String> |
internalResourcesForOrgUnit(CmsDbContext dbc,
CmsResource ouResource)
Returns the list of root paths associated to the organizational unit represented by the given resource.
|
protected void |
internalUpdateRoleGroup(CmsDbContext dbc,
java.lang.String groupName,
CmsRole role)
Updates a group to a virtual group.
|
protected void |
internalUpdateUserInfo(CmsDbContext dbc,
CmsUUID userId,
java.lang.String key,
java.lang.Object value)
Updates additional user info.
|
protected void |
internalValidateResourceForOrgUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
java.lang.String rootPath)
Validates the given root path to be in the scope of the resources of the given organizational unit.
|
protected boolean |
internalValidateUserInGroup(CmsDbContext dbc,
CmsUUID userId,
CmsUUID groupId)
Checks if a user is member of a group.
|
protected void |
internalWriteOrgUnitProperty(CmsDbContext dbc,
CmsResource resource,
CmsProperty property)
Writes a property for an organizational unit resource, online AND offline.
|
protected void |
internalWriteUserInfo(CmsDbContext dbc,
CmsUUID userId,
java.lang.String key,
java.lang.Object value)
Writes a new additional user info.
|
protected void |
internalWriteUserInfos(CmsDbContext dbc,
CmsUUID userId,
java.util.Map<java.lang.String,java.lang.Object> additionalInfo)
Updates the user additional information map.
|
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 parentGroupFqn)
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringpublic static final java.lang.String ORGUNIT_BASE_FOLDER
public static final java.lang.String REQ_ATTR_DONT_DIGEST_PASSWORD
protected java.security.MessageDigest m_digest
protected java.lang.String m_digestAlgorithm
protected java.lang.String m_digestFileEncoding
protected CmsDriverManager m_driverManager
protected CmsSqlManager m_sqlManager
public CmsUserDriver()
public void addResourceToOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsDataAccessException
I_CmsUserDriveraddResourceToOrganizationalUnit in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.addResourceToOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, org.opencms.file.CmsResource)public long countUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams) throws CmsDataAccessException
I_CmsUserDrivercountUsers in interface I_CmsUserDriverdbc - the database contextsearchParams - the search criteriaCmsDataAccessException - if something goes wrongI_CmsUserDriver.countUsers(org.opencms.db.CmsDbContext, org.opencms.file.CmsUserSearchParameters)public void createAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal, int allowed, int denied, int flags) throws CmsDataAccessException
I_CmsUserDrivercreateAccessControlEntry in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.createAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID, int, int, int)public CmsGroup createGroup(CmsDbContext dbc, CmsUUID groupId, java.lang.String groupFqn, java.lang.String description, int flags, java.lang.String parentGroupFqn) throws CmsDataAccessException
I_CmsUserDrivercreateGroup in interface I_CmsUserDriverdbc - 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 groupparentGroupFqn - the name of the parent group (or null if the group has no parent)CmsDataAccessException - if something goes wrongI_CmsUserDriver.createGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.String, int, java.lang.String)public CmsOrganizationalUnit createOrganizationalUnit(CmsDbContext dbc, java.lang.String name, java.lang.String description, int flags, CmsOrganizationalUnit parent, java.lang.String associatedResource) throws CmsDataAccessException
I_CmsUserDrivercreateOrganizationalUnit in interface I_CmsUserDriverdbc - 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)associatedResource - the first associated resourceCmsOrganizationalUnit object representing
the newly created organizational unitCmsDataAccessException - if operation was not successfulI_CmsUserDriver.createOrganizationalUnit(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, int, org.opencms.security.CmsOrganizationalUnit, String)public void createRootOrganizationalUnit(CmsDbContext dbc)
I_CmsUserDrivercreateRootOrganizationalUnit in interface I_CmsUserDriverdbc - the current database contextI_CmsUserDriver.createRootOrganizationalUnit(org.opencms.db.CmsDbContext)public 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) throws CmsDataAccessException
I_CmsUserDrivercreateUser in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.createUser(CmsDbContext, CmsUUID, String, String, String, String, String, long, int, long, Map)public void createUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId) throws CmsDataAccessException
I_CmsUserDrivercreateUserInGroup in interface I_CmsUserDriverdbc - 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 successfulI_CmsUserDriver.createUserInGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)public void deleteGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
I_CmsUserDriverOnly groups that contain no subgroups can be deleted.
deleteGroup in interface I_CmsUserDriverdbc - the current database contextgroupFqn - the fully qualified name of the group that is to be deletedCmsDataAccessException - if something goes wrongI_CmsUserDriver.deleteGroup(org.opencms.db.CmsDbContext, java.lang.String)public void deleteOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsDataAccessException
I_CmsUserDriverOnly organizational units that contain no suborganizational unit can be deleted.
deleteOrganizationalUnit in interface I_CmsUserDriverdbc - the current db contextorganizationalUnit - the organizational unit to deleteCmsDataAccessException - if operation was not successfulI_CmsUserDriver.deleteOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)public void deleteUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
I_CmsUserDriverdeleteUser in interface I_CmsUserDriverdbc - the current database contextuserFqn - the fully qualified name of the user to deleteCmsDataAccessException - if something goes wrongI_CmsUserDriver.deleteUser(org.opencms.db.CmsDbContext, java.lang.String)public void deleteUserInfos(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
I_CmsUserDriverdeleteUserInfos in interface I_CmsUserDriverdbc - the current database contextuserId - the id of the user to updateCmsDataAccessException - if something goes wrongI_CmsUserDriver.deleteUserInfos(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)public void deleteUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId) throws CmsDataAccessException
I_CmsUserDriverdeleteUserInGroup in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.deleteUserInGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)public void destroy() throws java.lang.Throwable
I_CmsUserDriverdestroy in interface I_CmsUserDriverjava.lang.Throwable - if something goes wrongI_CmsUserDriver.destroy()public boolean existsGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
I_CmsUserDriverexistsGroup in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.existsGroup(org.opencms.db.CmsDbContext, java.lang.String)public boolean existsUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
I_CmsUserDriverexistsUser in interface I_CmsUserDriverdbc - the current database contextuserFqn - the fully qualified name of the user to be checkedCmsDataAccessException - if something goes wrongI_CmsUserDriver.existsUser(org.opencms.db.CmsDbContext, java.lang.String)public void fillDefaults(CmsDbContext dbc) throws CmsInitException
I_CmsUserDriverfillDefaults in interface I_CmsUserDriverdbc - the current database context, be aware that this dbc has no runtime data!CmsInitException - if something goes wrongI_CmsUserDriver.fillDefaults(org.opencms.db.CmsDbContext)public java.util.List<CmsGroup> getGroups(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean includeSubOus, boolean readRoles) throws CmsDataAccessException
I_CmsUserDrivergetGroups in interface I_CmsUserDriverdbc - 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 successfulI_CmsUserDriver.getGroups(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean, boolean)public java.util.List<CmsOrganizationalUnit> getOrganizationalUnits(CmsDbContext dbc, CmsOrganizationalUnit parent, boolean includeChildren) throws CmsDataAccessException
I_CmsUserDrivergetOrganizationalUnits in interface I_CmsUserDriverdbc - 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 succesfulI_CmsUserDriver.getOrganizationalUnits(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)public java.util.List<CmsResource> getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) throws CmsDataAccessException
I_CmsUserDrivergetResourcesForOrganizationalUnit in interface I_CmsUserDriverdbc - the current db contextorgUnit - the organizational unit to get all resources forCmsResource objects in the organizational unitCmsDataAccessException - if operation was not successfulI_CmsUserDriver.getResourcesForOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)public CmsSqlManager getSqlManager()
I_CmsUserDrivergetSqlManager in interface I_CmsUserDriverI_CmsUserDriver.getSqlManager()public java.util.List<CmsUser> getUsers(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) throws CmsDataAccessException
I_CmsUserDrivergetUsers in interface I_CmsUserDriverdbc - 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 successfulI_CmsUserDriver.getUsers(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)public java.util.List<CmsUser> getUsersWithoutAdditionalInfo(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive) throws CmsDataAccessException
I_CmsUserDrivergetUsersWithoutAdditionalInfo in interface I_CmsUserDriverdbc - 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 successfulI_CmsUserDriver.getUsersWithoutAdditionalInfo(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)public void init(CmsDbContext dbc, CmsConfigurationManager configurationManager, java.util.List<java.lang.String> successiveDrivers, CmsDriverManager driverManager)
I_CmsDriverinit in interface I_CmsDriverdbc - the current database contextconfigurationManager - the configuration managersuccessiveDrivers - a list of successive drivers to be initializeddriverManager - the initialized OpenCms driver managerI_CmsDriver.init(org.opencms.db.CmsDbContext, org.opencms.configuration.CmsConfigurationManager, java.util.List, org.opencms.db.CmsDriverManager)public CmsSqlManager initSqlManager(java.lang.String classname)
I_CmsUserDriverTo obtain JDBC connections from different pools, further {online|offline|history} pool Urls have to be specified.
initSqlManager in interface I_CmsUserDriverclassname - the classname of the SQL managerI_CmsUserDriver.initSqlManager(String)public void publishAccessControlEntries(CmsDbContext dbc, CmsProject offlineProject, CmsProject onlineProject, CmsUUID offlineId, CmsUUID onlineId) throws CmsDataAccessException
I_CmsUserDriverWithin the given project, the resource is identified by its offlineId, in the online project, it is identified by the given onlineId.
publishAccessControlEntries in interface I_CmsUserDriverdbc - the current database contextofflineProject - an offline projectonlineProject - the onlie projectofflineId - the offline resource idonlineId - the online resource idCmsDataAccessException - if something goes wrongI_CmsUserDriver.publishAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)public java.util.List<CmsAccessControlEntry> readAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource, boolean inheritedOnly) throws CmsDataAccessException
I_CmsUserDriverreadAccessControlEntries in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.readAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, boolean)public CmsAccessControlEntry readAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal) throws CmsDataAccessException
I_CmsUserDriverreadAccessControlEntry in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryresource - the id of the resourceprincipal - the id of the principalCmsDataAccessException - if something goes wrongI_CmsUserDriver.readAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)public java.util.List<CmsGroup> readChildGroups(CmsDbContext dbc, java.lang.String parentGroupFqn) throws CmsDataAccessException
I_CmsUserDriverreadChildGroups in interface I_CmsUserDriverdbc - the current database contextparentGroupFqn - the fully qualified name of the group to read the child groups fromCmsGroup objects or nullCmsDataAccessException - if operation was not succesfulI_CmsUserDriver.readChildGroups(org.opencms.db.CmsDbContext, java.lang.String)public CmsGroup readGroup(CmsDbContext dbc, CmsUUID groupId) throws CmsDataAccessException
I_CmsUserDriverreadGroup in interface I_CmsUserDriverdbc - the current database contextgroupId - the id of the group that is to be readCmsDataAccessException - if something goes wrongI_CmsUserDriver.readGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)public CmsGroup readGroup(CmsDbContext dbc, java.lang.String groupFqn) throws CmsDataAccessException
I_CmsUserDriverreadGroup in interface I_CmsUserDriverdbc - the current database contextgroupFqn - the fully qualified name of the group that is to be readCmsDataAccessException - if something goes wrongI_CmsUserDriver.readGroup(org.opencms.db.CmsDbContext, java.lang.String)public java.util.List<CmsGroup> readGroupsOfUser(CmsDbContext dbc, CmsUUID userId, java.lang.String ouFqn, boolean includeChildOus, java.lang.String remoteAddress, boolean readRoles) throws CmsDataAccessException
I_CmsUserDriverreadGroupsOfUser in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.readGroupsOfUser(CmsDbContext, CmsUUID, String, boolean, String, boolean)public CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc, java.lang.String ouFqn) throws CmsDataAccessException
I_CmsUserDriverreadOrganizationalUnit in interface I_CmsUserDriverdbc - the current db contextouFqn - the fully qualified name of the organizational Unit to be readCmsDataAccessException - if something goes wrongI_CmsUserDriver.readOrganizationalUnit(org.opencms.db.CmsDbContext, String)public CmsUser readUser(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
I_CmsUserDriverreadUser in interface I_CmsUserDriverdbc - the current database contextid - the id of the user to readCmsDataAccessException - if something goes wrongI_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)public CmsUser readUser(CmsDbContext dbc, java.lang.String userFqn) throws CmsDataAccessException
I_CmsUserDriverreadUser in interface I_CmsUserDriverdbc - the current database contextuserFqn - the fully qualified name of the user to readCmsDataAccessException - if something goes wrongI_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, java.lang.String)public CmsUser readUser(CmsDbContext dbc, java.lang.String userFqn, java.lang.String password, java.lang.String remoteAddress) throws CmsDataAccessException
I_CmsUserDriverreadUser in interface I_CmsUserDriverdbc - the current database contextuserFqn - the name of the userpassword - the password of the userremoteAddress - the remote address of the request, may be nullCmsDataAccessException - if something goes wrongI_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, String)public java.util.Map<java.lang.String,java.lang.Object> readUserInfos(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
I_CmsUserDriverreadUserInfos in interface I_CmsUserDriverdbc - the current database contextuserId - the id of the user to updateCmsDataAccessException - if something goes wrongI_CmsUserDriver.readUserInfos(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)public java.util.List<CmsUser> readUsersOfGroup(CmsDbContext dbc, java.lang.String groupFqn, boolean includeOtherOuUsers) throws CmsDataAccessException
I_CmsUserDriverreadUsersOfGroup in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.readUsersOfGroup(CmsDbContext, String, boolean)public void removeAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource) throws CmsDataAccessException
I_CmsUserDriverremoveAccessControlEntries in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryresource - the id of the resourceCmsDataAccessException - if something goes wrongI_CmsUserDriver.removeAccessControlEntries(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID)public void removeAccessControlEntriesForPrincipal(CmsDbContext dbc, CmsProject project, CmsProject onlineProject, CmsUUID principal) throws CmsDataAccessException
I_CmsUserDriverremoveAccessControlEntriesForPrincipal in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryonlineProject - the online projectprincipal - the id of the principalCmsDataAccessException - if something goes wrongI_CmsUserDriver.removeAccessControlEntriesForPrincipal(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsProject, org.opencms.util.CmsUUID)public void removeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsUUID resource, CmsUUID principal) throws CmsDataAccessException
I_CmsUserDriverremoveAccessControlEntry in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryresource - the id of the resourceprincipal - the id of the principalCmsDataAccessException - if something goes wrongI_CmsUserDriver.removeAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)public void removeResourceFromOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource) throws CmsDataAccessException
I_CmsUserDriverremoveResourceFromOrganizationalUnit in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.removeResourceFromOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, CmsResource)public java.util.List<CmsUser> searchUsers(CmsDbContext dbc, CmsUserSearchParameters searchParams) throws CmsDataAccessException
I_CmsUserDriversearchUsers in interface I_CmsUserDriverdbc - the database contextsearchParams - the search criteriaCmsDataAccessException - if something goes wrongI_CmsUserDriver.searchUsers(org.opencms.db.CmsDbContext, org.opencms.file.CmsUserSearchParameters)public void setDriverManager(CmsDriverManager driverManager)
I_CmsUserDriversetDriverManager in interface I_CmsUserDriverdriverManager - the new driver managerI_CmsUserDriver.setDriverManager(org.opencms.db.CmsDriverManager)public void setSqlManager(CmsSqlManager sqlManager)
I_CmsUserDriversetSqlManager in interface I_CmsUserDriversqlManager - the new SQL managerI_CmsUserDriver.setSqlManager(org.opencms.db.CmsSqlManager)public void setUsersOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsUser user) throws CmsDataAccessException
I_CmsUserDriversetUsersOrganizationalUnit in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.setUsersOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, org.opencms.file.CmsUser)public void writeAccessControlEntry(CmsDbContext dbc, CmsProject project, CmsAccessControlEntry acEntry) throws CmsDataAccessException
I_CmsUserDriverwriteAccessControlEntry in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryacEntry - the entry to writeCmsDataAccessException - if something goes wrongI_CmsUserDriver.writeAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.security.CmsAccessControlEntry)public void writeGroup(CmsDbContext dbc, CmsGroup group) throws CmsDataAccessException
I_CmsUserDriver
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.
writeGroup in interface I_CmsUserDriverdbc - the current database contextgroup - the group to updateCmsDataAccessException - if something goes wrongI_CmsUserDriver.writeGroup(org.opencms.db.CmsDbContext, org.opencms.file.CmsGroup)public void writeOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit) throws CmsDataAccessException
I_CmsUserDriver
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.
writeOrganizationalUnit in interface I_CmsUserDriverdbc - the current db contextorganizationalUnit - the organizational unit that should be writtenCmsDataAccessException - if operation was not successfulI_CmsUserDriver.writeOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)public void writePassword(CmsDbContext dbc, java.lang.String userFqn, java.lang.String oldPassword, java.lang.String newPassword) throws CmsDataAccessException, CmsPasswordEncryptionException
I_CmsUserDriverwritePassword in interface I_CmsUserDriverdbc - 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 encryptedI_CmsUserDriver.writePassword(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, java.lang.String)public void writeUser(CmsDbContext dbc, CmsUser user) throws CmsDataAccessException
I_CmsUserDriverThe user id has to be a valid OpenCms user id.
The user with the given id will be completely overriden by the given data.
writeUser in interface I_CmsUserDriverdbc - the current database contextuser - the user to updateCmsDataAccessException - if something goes wrongI_CmsUserDriver.writeUser(org.opencms.db.CmsDbContext, org.opencms.file.CmsUser)public void writeUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value) throws CmsDataAccessException
I_CmsUserDriverwriteUserInfo in interface I_CmsUserDriverdbc - 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 wrongI_CmsUserDriver.writeUserInfo(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.Object)protected java.lang.String createRoleQuery(java.lang.String mainQuery, boolean includeSubOus, boolean readRoles)
mainQuery - the main select sql queryincludeSubOus - if groups in sub-ous should be included in the selectionreadRoles - if groups or roles whould be selectedprotected CmsPair<java.lang.String,java.util.List<java.lang.Object>> createUserQuery(CmsUserSearchParameters searchParams, boolean countOnly)
searchParams - the user search criteriacountOnly - if true, the query will only count the total number of results instead of returning themprotected CmsUserQueryBuilder createUserQueryBuilder()
protected CmsAccessControlEntry internalCreateAce(java.sql.ResultSet res) throws java.sql.SQLException
res - resultset of the current queryCmsAccessControlEntry initialized with the values from the current database recordjava.sql.SQLException - if something goes wrongprotected CmsAccessControlEntry internalCreateAce(java.sql.ResultSet res, CmsUUID newId) throws java.sql.SQLException
res - resultset of the current querynewId - the id of the new access control entryCmsAccessControlEntry initialized with the values from the current database recordjava.sql.SQLException - if something goes wrongprotected void internalCreateDefaultGroups(CmsDbContext dbc, java.lang.String ouFqn, java.lang.String ouDescription, boolean webuser) throws CmsException
dbc - the database contextouFqn - the fully qualified name of the organizational unit to create the principals forouDescription - the description of the given organizational unitwebuser - the webuser ou flagCmsException - if something goes wrongprotected CmsGroup internalCreateGroup(java.sql.ResultSet res) throws java.sql.SQLException
CmsGroup instance from a JDBC result set.res - the JDBC ResultSetjava.sql.SQLException - in case the result set does not include a requested table attributeprotected CmsOrganizationalUnit internalCreateOrgUnitFromResource(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc - the current db contextresource - the resource that represents an organizational unitCmsException - if something goes wrongprotected CmsResource internalCreateResourceForOrgUnit(CmsDbContext dbc, java.lang.String path, int flags) throws CmsException
dbc - the current database contextpath - the path to create the folderflags - the resource flagsCmsException - if something goes wrongprotected CmsUser internalCreateUser(CmsDbContext dbc, java.sql.ResultSet res) throws java.sql.SQLException
CmsUser instance from a JDBC result set.dbc - the current database contextres - the JDBC ResultSetjava.sql.SQLException - in case the result set does not include a requested table attributeprotected void internalDeleteOrgUnitResource(CmsDbContext dbc, CmsResource resource) throws CmsException
dbc - the current database contextresource - the resource to deleteCmsException - if something goes wrongprotected void internalDeleteUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key) throws CmsDataAccessException
dbc - the current dbcuserId - the user to delete additional info fromkey - the additional info to deleteCmsDataAccessException - if something goes wrongprotected java.util.List<CmsUser> internalGetUsers(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, boolean recursive, boolean readAdditionalInfos) throws CmsDataAccessException
dbc - the database contextorgUnit - the OUrecursive - if true, sub-OUs should be searchedreadAdditionalInfos - if true, additional infos should be readCmsDataAccessException - if something goes wrongprotected CmsResource internalOrgUnitFolder(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) throws CmsException
null.The base folder will be created if it does not exist.
dbc - the current db contextorgUnit - the organizational unit to get the folder forCmsException - if something goes wrongprotected java.util.List<java.lang.String> internalResourcesForOrgUnit(CmsDbContext dbc, CmsResource ouResource) throws CmsException
dbc - the current db contextouResource - the resource that represents the organizational unit to get the resources forCmsException - if something goes wrongprotected void internalUpdateRoleGroup(CmsDbContext dbc, java.lang.String groupName, CmsRole role) throws CmsDataAccessException
dbc - the database contextgroupName - the name of the group to updaterole - the role for this groupCmsDataAccessException - if something goes wrongprotected void internalUpdateUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value) throws CmsDataAccessException
dbc - the current dbcuserId - the user id to add the user info forkey - the name of the additional user infovalue - the value of the additional user infoCmsDataAccessException - if something goes wrongprotected void internalValidateResourceForOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, java.lang.String rootPath) throws CmsException
dbc - the current db contextorgUnit - the organizational unitrootPath - the root path to checkCmsException - if something goes wrongprotected boolean internalValidateUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId) throws CmsDataAccessException
dbc - the database contextuserId - the id of the user to checkgroupId - the id of the group to checkCmsDataAccessException - if operation was not succesfulprotected void internalWriteOrgUnitProperty(CmsDbContext dbc, CmsResource resource, CmsProperty property) throws CmsException
dbc - the current database contextresource - the resource representing the organizational unitproperty - the property to writeCmsException - if something goes wrongprotected void internalWriteUserInfo(CmsDbContext dbc, CmsUUID userId, java.lang.String key, java.lang.Object value) throws CmsDataAccessException
dbc - the current dbcuserId - the user id to add the user info forkey - the name of the additional user infovalue - the value of the additional user infoCmsDataAccessException - if something goes wrongprotected void internalWriteUserInfos(CmsDbContext dbc, CmsUUID userId, java.util.Map<java.lang.String,java.lang.Object> additionalInfo) throws CmsDataAccessException
dbc - the current database contextuserId - the id of the user to updateadditionalInfo - the info to writeCmsDataAccessException - if user data could not be written