|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.db.jpa.CmsUserDriver
public class CmsUserDriver
JPA database server implementation of the user driver methods.
| Field Summary | |
|---|---|
protected MessageDigest |
m_digest
A digest to encrypt the passwords. |
protected String |
m_digestAlgorithm
The algorithm used to encode passwords. |
protected 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 String |
ORGUNIT_BASE_FOLDER
The root path for organizational units. |
static String |
REQ_ATTR_DONT_DIGEST_PASSWORD
The internal request attribute to indicate that the password has not to be digested. |
| Fields inherited from interface org.opencms.db.I_CmsUserDriver |
|---|
DRIVER_TYPE_ID |
| Fields inherited from interface org.opencms.db.I_CmsDriver |
|---|
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION |
| Constructor Summary | |
|---|---|
CmsUserDriver()
|
|
| Method Summary | |
|---|---|
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,
String groupFqn,
String description,
int flags,
String parentGroupFqn)
Creates a new group. |
CmsOrganizationalUnit |
createOrganizationalUnit(CmsDbContext dbc,
String name,
String description,
int flags,
CmsOrganizationalUnit parent,
String associatedResource)
Creates a new organizational unit. |
protected javax.persistence.Query |
createQueryFromStringAndParams(String queryString,
List<Object> queryParams)
|
protected String |
createRoleQuery(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,
String userFqn,
String password,
String firstname,
String lastname,
String email,
long lastlogin,
int flags,
long dateCreated,
Map<String,Object> additionalInfos)
Creates a new user. |
void |
createUserInGroup(CmsDbContext dbc,
CmsUUID userId,
CmsUUID groupId)
Adds a user to a group. |
void |
deleteAccessControlEntries(CmsDbContext dbc,
CmsProject project,
CmsUUID resource)
Possibly there is no need for this method. |
void |
deleteGroup(CmsDbContext dbc,
String groupFqn)
Deletes a group. |
void |
deleteOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit organizationalUnit)
Deletes an organizational unit. |
void |
deleteUser(CmsDbContext dbc,
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,
String groupFqn)
Tests if a group with the specified name exists. |
boolean |
existsUser(CmsDbContext dbc,
String userFqn)
Tests if a user with the specified name exists. |
void |
fillDefaults(CmsDbContext dbc)
Initializes the default organizational units, users and groups. |
List<CmsGroup> |
getGroups(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean includeSubOus,
boolean readRoles)
Returns all groups of the given organizational unit. |
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. |
List<CmsResource> |
getResourcesForOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit)
Returns all resources of the given organizational unit. |
CmsSqlManager |
getSqlManager()
Returns the SqlManager of this driver. |
List<CmsUser> |
getUsers(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive)
Returns all users of the given organizational unit. |
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,
List<String> successiveDrivers,
CmsDriverManager driverManager)
Initializes the driver. |
CmsSqlManager |
initSqlManager(String classname)
Initializes the SQL manager for this driver. |
protected CmsAccessControlEntry |
internalCreateAce(I_CmsDAOAccessControl ac)
Internal helper method to create an access control entry from a database record. |
protected CmsAccessControlEntry |
internalCreateAce(I_CmsDAOAccessControl ac,
CmsUUID newId)
Internal helper method to create an access control entry from a database record. |
protected void |
internalCreateDefaultGroups(CmsDbContext dbc,
String ouFqn,
String ouDescription,
boolean webuser)
Creates the default groups and user for the given organizational unit. |
protected CmsGroup |
internalCreateGroup(CmsDAOGroups g)
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,
String path,
int flags)
Creates a folder with the given path an properties, offline AND online. |
protected CmsUser |
internalCreateUser(CmsDbContext dbc,
CmsDAOUsers u)
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,
String key)
Deletes an additional user info. |
protected CmsResource |
internalOrgUnitFolder(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit)
Returns the folder for the given organizational units, or the base folder if null. |
protected List<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,
String groupName,
CmsRole role)
Updates a group to a virtual group. |
protected void |
internalUpdateUserInfo(CmsDbContext dbc,
CmsUUID userId,
String key,
Object value)
Updates additional user info. |
protected void |
internalValidateResourceForOrgUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
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,
String key,
Object value)
Writes a new additional user info. |
protected void |
internalWriteUserInfos(CmsDbContext dbc,
CmsUUID userId,
Map<String,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. |
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. |
List<CmsGroup> |
readChildGroups(CmsDbContext dbc,
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,
String groupFqn)
Reads a group based on the group name. |
List<CmsGroup> |
readGroupsOfUser(CmsDbContext dbc,
CmsUUID userId,
String ouFqn,
boolean includeChildOus,
String remoteAddress,
boolean readRoles)
Reads all groups the given user is a member in. |
CmsOrganizationalUnit |
readOrganizationalUnit(CmsDbContext dbc,
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,
String userFqn)
Reads a user based in the user fully qualified name. |
CmsUser |
readUser(CmsDbContext dbc,
String userFqn,
String password,
String remoteAddress)
Reads a user from the database, only if the password is correct. |
Map<String,Object> |
readUserInfos(CmsDbContext dbc,
CmsUUID userId)
Reads the user additional information map. |
List<CmsUser> |
readUsersOfGroup(CmsDbContext dbc,
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. |
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,
String userFqn,
String oldPassword,
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,
String key,
Object value)
Writes an user additional information entry. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.opencms.db.I_CmsDriver |
|---|
toString |
| Field Detail |
|---|
public static final String ORGUNIT_BASE_FOLDER
public static final String REQ_ATTR_DONT_DIGEST_PASSWORD
protected MessageDigest m_digest
protected String m_digestAlgorithm
protected String m_digestFileEncoding
protected CmsDriverManager m_driverManager
protected CmsSqlManager m_sqlManager
| Constructor Detail |
|---|
public CmsUserDriver()
| Method Detail |
|---|
public void addResourceToOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsResource resource)
throws CmsDataAccessException
I_CmsUserDriver
addResourceToOrganizationalUnit 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 unit
CmsDataAccessException - 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_CmsUserDriver
countUsers in interface I_CmsUserDriverdbc - the database contextsearchParams - the search criteria
CmsDataAccessException - 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_CmsUserDriver
createAccessControlEntry 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 - flags
CmsDataAccessException - 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,
String groupFqn,
String description,
int flags,
String parentGroupFqn)
throws CmsDataAccessException
I_CmsUserDriver
createGroup 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,
String name,
String description,
int flags,
CmsOrganizationalUnit parent,
String associatedResource)
throws CmsDataAccessException
I_CmsUserDriver
createOrganizationalUnit 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 resource
CmsOrganizationalUnit object representing
the newly created organizational unit
CmsDataAccessException - 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_CmsUserDriver
createRootOrganizationalUnit in interface I_CmsUserDriverdbc - the current database contextI_CmsUserDriver.createRootOrganizationalUnit(org.opencms.db.CmsDbContext)
public CmsUser createUser(CmsDbContext dbc,
CmsUUID id,
String userFqn,
String password,
String firstname,
String lastname,
String email,
long lastlogin,
int flags,
long dateCreated,
Map<String,Object> additionalInfos)
throws CmsDataAccessException
I_CmsUserDriver
createUser 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 infos
CmsDataAccessException - 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_CmsUserDriver
createUserInGroup 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 group
CmsDataAccessException - if operation was not successfulI_CmsUserDriver.createUserInGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)
public void deleteAccessControlEntries(CmsDbContext dbc,
CmsProject project,
CmsUUID resource)
throws CmsDataAccessException
TODO: check if this method is used somewhere TODO: remove this method
dbc - the db contextproject - the projectresource - the resource's UUID
CmsDataAccessException - if something goes wrong
public void deleteGroup(CmsDbContext dbc,
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 deleted
CmsDataAccessException - 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 delete
CmsDataAccessException - if operation was not successfulI_CmsUserDriver.deleteOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)
public void deleteUser(CmsDbContext dbc,
String userFqn)
throws CmsDataAccessException
I_CmsUserDriver
deleteUser in interface I_CmsUserDriverdbc - the current database contextuserFqn - the fully qualified name of the user to delete
CmsDataAccessException - if something goes wrongI_CmsUserDriver.deleteUser(org.opencms.db.CmsDbContext, java.lang.String)
public void deleteUserInfos(CmsDbContext dbc,
CmsUUID userId)
throws CmsDataAccessException
I_CmsUserDriver
deleteUserInfos in interface I_CmsUserDriverdbc - the current database contextuserId - the id of the user to update
CmsDataAccessException - 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_CmsUserDriver
deleteUserInGroup 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 group
CmsDataAccessException - if something goes wrongI_CmsUserDriver.deleteUserInGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)
public void destroy()
throws Throwable
I_CmsUserDriver
destroy in interface I_CmsUserDriverThrowable - if something goes wrongI_CmsUserDriver.destroy()
public boolean existsGroup(CmsDbContext dbc,
String groupFqn)
throws CmsDataAccessException
I_CmsUserDriver
existsGroup in interface I_CmsUserDriverdbc - the current database contextgroupFqn - the fully qualified group name to be checked
true, if a group with the specified name exists, false otherwise
CmsDataAccessException - if something goes wrongI_CmsUserDriver.existsGroup(org.opencms.db.CmsDbContext, java.lang.String)
public boolean existsUser(CmsDbContext dbc,
String userFqn)
throws CmsDataAccessException
I_CmsUserDriver
existsUser in interface I_CmsUserDriverdbc - the current database contextuserFqn - the fully qualified name of the user to be checked
CmsDataAccessException - if something goes wrongI_CmsUserDriver.existsUser(org.opencms.db.CmsDbContext, java.lang.String)
public void fillDefaults(CmsDbContext dbc)
throws CmsInitException
I_CmsUserDriver
fillDefaults 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 List<CmsGroup> getGroups(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean includeSubOus,
boolean readRoles)
throws CmsDataAccessException
I_CmsUserDriver
getGroups 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 groups
CmsGroup objects in the organizational unit
CmsDataAccessException - if operation was not successfulI_CmsUserDriver.getGroups(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean, boolean)
public List<CmsOrganizationalUnit> getOrganizationalUnits(CmsDbContext dbc,
CmsOrganizationalUnit parent,
boolean includeChildren)
throws CmsDataAccessException
I_CmsUserDriver
getOrganizationalUnits 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 returned
CmsOrganizationalUnit objects
CmsDataAccessException - if operation was not succesfulI_CmsUserDriver.getOrganizationalUnits(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)
public List<CmsResource> getResourcesForOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit)
throws CmsDataAccessException
I_CmsUserDriver
getResourcesForOrganizationalUnit in interface I_CmsUserDriverdbc - the current db contextorgUnit - the organizational unit to get all resources for
CmsResource objects in the organizational unit
CmsDataAccessException - if operation was not successfulI_CmsUserDriver.getResourcesForOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)public CmsSqlManager getSqlManager()
I_CmsUserDriver
getSqlManager in interface I_CmsUserDriverI_CmsUserDriver.getSqlManager()
public List<CmsUser> getUsers(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive)
throws CmsDataAccessException
I_CmsUserDriver
getUsers 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 too
CmsUser objects in the organizational unit
CmsDataAccessException - if operation was not successfulI_CmsUserDriver.getUsers(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)
public List<CmsUser> getUsersWithoutAdditionalInfo(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
boolean recursive)
throws CmsDataAccessException
I_CmsUserDriver
getUsersWithoutAdditionalInfo 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 too
CmsUser objects in the organizational unit
CmsDataAccessException - if operation was not successfulI_CmsUserDriver.getUsersWithoutAdditionalInfo(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, boolean)
public void init(CmsDbContext dbc,
CmsConfigurationManager configurationManager,
List<String> successiveDrivers,
CmsDriverManager driverManager)
I_CmsDriver
init 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(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 manager
I_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 id
CmsDataAccessException - 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 List<CmsAccessControlEntry> readAccessControlEntries(CmsDbContext dbc,
CmsProject project,
CmsUUID resource,
boolean inheritedOnly)
throws CmsDataAccessException
I_CmsUserDriver
readAccessControlEntries 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 returned
CmsAccessControlEntry objects defining all permissions for the given resource
CmsDataAccessException - 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_CmsUserDriver
readAccessControlEntry in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryresource - the id of the resourceprincipal - the id of the principal
CmsDataAccessException - if something goes wrongI_CmsUserDriver.readAccessControlEntry(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)
public List<CmsGroup> readChildGroups(CmsDbContext dbc,
String parentGroupFqn)
throws CmsDataAccessException
I_CmsUserDriver
readChildGroups in interface I_CmsUserDriverdbc - the current database contextparentGroupFqn - the fully qualified name of the group to read the child groups from
CmsGroup objects or null
CmsDataAccessException - if operation was not succesfulI_CmsUserDriver.readChildGroups(org.opencms.db.CmsDbContext, java.lang.String)
public CmsGroup readGroup(CmsDbContext dbc,
CmsUUID groupId)
throws CmsDataAccessException
I_CmsUserDriver
readGroup in interface I_CmsUserDriverdbc - the current database contextgroupId - the id of the group that is to be read
CmsDataAccessException - if something goes wrongI_CmsUserDriver.readGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public CmsGroup readGroup(CmsDbContext dbc,
String groupFqn)
throws CmsDataAccessException
I_CmsUserDriver
readGroup in interface I_CmsUserDriverdbc - the current database contextgroupFqn - the fully qualified name of the group that is to be read
CmsDataAccessException - if something goes wrongI_CmsUserDriver.readGroup(org.opencms.db.CmsDbContext, java.lang.String)
public List<CmsGroup> readGroupsOfUser(CmsDbContext dbc,
CmsUUID userId,
String ouFqn,
boolean includeChildOus,
String remoteAddress,
boolean readRoles)
throws CmsDataAccessException
I_CmsUserDriver
readGroupsOfUser 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 groups
CmsGroup objects
CmsDataAccessException - if something goes wrongI_CmsUserDriver.readGroupsOfUser(CmsDbContext, CmsUUID, String, boolean, String, boolean)
public CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc,
String ouFqn)
throws CmsDataAccessException
I_CmsUserDriver
readOrganizationalUnit in interface I_CmsUserDriverdbc - the current db contextouFqn - the fully qualified name of the organizational Unit to be read
CmsDataAccessException - if something goes wrongI_CmsUserDriver.readOrganizationalUnit(org.opencms.db.CmsDbContext, String)
public CmsUser readUser(CmsDbContext dbc,
CmsUUID id)
throws CmsDataAccessException
I_CmsUserDriver
readUser in interface I_CmsUserDriverdbc - the current database contextid - the id of the user to read
CmsDataAccessException - if something goes wrongI_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public CmsUser readUser(CmsDbContext dbc,
String userFqn)
throws CmsDataAccessException
I_CmsUserDriver
readUser in interface I_CmsUserDriverdbc - the current database contextuserFqn - the fully qualified name of the user to read
CmsDataAccessException - if something goes wrongI_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, java.lang.String)
public CmsUser readUser(CmsDbContext dbc,
String userFqn,
String password,
String remoteAddress)
throws CmsDataAccessException,
CmsPasswordEncryptionException
I_CmsUserDriver
readUser 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 null
CmsDataAccessException - if something goes wrong
CmsPasswordEncryptionException - if the password of the user could not be encryptedI_CmsUserDriver.readUser(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, String)
public Map<String,Object> readUserInfos(CmsDbContext dbc,
CmsUUID userId)
throws CmsDataAccessException
I_CmsUserDriver
readUserInfos in interface I_CmsUserDriverdbc - the current database contextuserId - the id of the user to update
CmsDataAccessException - if something goes wrongI_CmsUserDriver.readUserInfos(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public List<CmsUser> readUsersOfGroup(CmsDbContext dbc,
String groupFqn,
boolean includeOtherOuUsers)
throws CmsDataAccessException
I_CmsUserDriver
readUsersOfGroup 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 units
CmsUser objects in the group
CmsDataAccessException - if something goes wrongI_CmsUserDriver.readUsersOfGroup(CmsDbContext, String, boolean)
public void removeAccessControlEntries(CmsDbContext dbc,
CmsProject project,
CmsUUID resource)
throws CmsDataAccessException
I_CmsUserDriver
removeAccessControlEntries in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryresource - the id of the resource
CmsDataAccessException - 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_CmsUserDriver
removeAccessControlEntriesForPrincipal in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryonlineProject - the online projectprincipal - the id of the principal
CmsDataAccessException - 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_CmsUserDriver
removeAccessControlEntry in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryresource - the id of the resourceprincipal - the id of the principal
CmsDataAccessException - 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_CmsUserDriver
removeResourceFromOrganizationalUnit 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 unit
CmsDataAccessException - if something goes wrongI_CmsUserDriver.removeResourceFromOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit, CmsResource)
public List<CmsUser> searchUsers(CmsDbContext dbc,
CmsUserSearchParameters searchParams)
throws CmsDataAccessException
I_CmsUserDriver
searchUsers in interface I_CmsUserDriverdbc - the database contextsearchParams - the search criteria
CmsDataAccessException - if something goes wrongI_CmsUserDriver.searchUsers(org.opencms.db.CmsDbContext, org.opencms.file.CmsUserSearchParameters)public void setDriverManager(CmsDriverManager driverManager)
I_CmsUserDriver
setDriverManager in interface I_CmsUserDriverdriverManager - the new driver managerI_CmsUserDriver.setDriverManager(org.opencms.db.CmsDriverManager)public void setSqlManager(CmsSqlManager sqlManager)
I_CmsUserDriver
setSqlManager 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_CmsUserDriver
setUsersOrganizationalUnit 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 unit
CmsDataAccessException - 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_CmsUserDriver
writeAccessControlEntry in interface I_CmsUserDriverdbc - the current database contextproject - the project to write the entryacEntry - the entry to write
CmsDataAccessException - 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 update
CmsDataAccessException - 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 written
CmsDataAccessException - if operation was not successfulI_CmsUserDriver.writeOrganizationalUnit(org.opencms.db.CmsDbContext, org.opencms.security.CmsOrganizationalUnit)
public void writePassword(CmsDbContext dbc,
String userFqn,
String oldPassword,
String newPassword)
throws CmsDataAccessException,
CmsPasswordEncryptionException
I_CmsUserDriver
writePassword 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 set
CmsDataAccessException - if something goes wrong
CmsPasswordEncryptionException - 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 update
CmsDataAccessException - if something goes wrongI_CmsUserDriver.writeUser(org.opencms.db.CmsDbContext, org.opencms.file.CmsUser)
public void writeUserInfo(CmsDbContext dbc,
CmsUUID userId,
String key,
Object value)
throws CmsDataAccessException
I_CmsUserDriver
writeUserInfo 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 write
CmsDataAccessException - if something goes wrongI_CmsUserDriver.writeUserInfo(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.Object)
protected javax.persistence.Query createQueryFromStringAndParams(String queryString,
List<Object> queryParams)
protected String createRoleQuery(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 selected
protected CmsAccessControlEntry internalCreateAce(I_CmsDAOAccessControl ac)
ac - the access control
CmsAccessControlEntry initialized with the values from the current database record
protected CmsAccessControlEntry internalCreateAce(I_CmsDAOAccessControl ac,
CmsUUID newId)
ac - the access controlnewId - the id of the new access control entry
CmsAccessControlEntry initialized with the values from the current database record
protected void internalCreateDefaultGroups(CmsDbContext dbc,
String ouFqn,
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 flag
CmsException - if something goes wrongprotected CmsGroup internalCreateGroup(CmsDAOGroups g)
CmsGroup instance from a JDBC result set.
g - the group
protected CmsOrganizationalUnit internalCreateOrgUnitFromResource(CmsDbContext dbc,
CmsResource resource)
throws CmsException
dbc - the current db contextresource - the resource that represents an organizational unit
CmsException - if something goes wrong
protected CmsResource internalCreateResourceForOrgUnit(CmsDbContext dbc,
String path,
int flags)
throws CmsException
dbc - the current database contextpath - the path to create the folderflags - the resource flags
CmsException - if something goes wrong
protected CmsUser internalCreateUser(CmsDbContext dbc,
CmsDAOUsers u)
throws CmsDataAccessException
CmsUser instance from a JDBC result set.
dbc - the current database contextu - the user
CmsDataAccessException - if there is an error in de-serializing the user info
protected void internalDeleteOrgUnitResource(CmsDbContext dbc,
CmsResource resource)
throws CmsException
dbc - the current database contextresource - the resource to delete
CmsException - if something goes wrong
protected void internalDeleteUserInfo(CmsDbContext dbc,
CmsUUID userId,
String key)
throws CmsDataAccessException
dbc - the current dbcuserId - the user to delete additional info fromkey - the additional info to delete
CmsDataAccessException - if something goes wrong
protected 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 for
CmsException - if something goes wrong
protected List<String> internalResourcesForOrgUnit(CmsDbContext dbc,
CmsResource ouResource)
throws CmsException
dbc - the current db contextouResource - the resource that represents the organizational unit to get the resources for
CmsException - if something goes wrong
protected void internalUpdateRoleGroup(CmsDbContext dbc,
String groupName,
CmsRole role)
throws CmsDataAccessException
dbc - the database contextgroupName - the name of the group to updaterole - the role for this group
CmsDataAccessException - if something goes wrong
protected void internalUpdateUserInfo(CmsDbContext dbc,
CmsUUID userId,
String key,
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 info
CmsDataAccessException - if something goes wrong
protected void internalValidateResourceForOrgUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
String rootPath)
throws CmsException
dbc - the current db contextorgUnit - the organizational unitrootPath - the root path to check
CmsException - if something goes wrong
protected 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 check
CmsDataAccessException - if operation was not succesful
protected void internalWriteOrgUnitProperty(CmsDbContext dbc,
CmsResource resource,
CmsProperty property)
throws CmsException
dbc - the current database contextresource - the resource representing the organizational unitproperty - the property to write
CmsException - if something goes wrong
protected void internalWriteUserInfo(CmsDbContext dbc,
CmsUUID userId,
String key,
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 info
CmsDataAccessException - if something goes wrong
protected void internalWriteUserInfos(CmsDbContext dbc,
CmsUUID userId,
Map<String,Object> additionalInfo)
throws CmsDataAccessException
dbc - the current database contextuserId - the id of the user to updateadditionalInfo - the info to write
CmsDataAccessException - if user data could not be written
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||