|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface I_CmsUserDriver
Definitions of all required user driver methods.
Field Summary | |
---|---|
static int |
DRIVER_TYPE_ID
The type ID to identify user driver implementations. |
Fields inherited from interface org.opencms.db.I_CmsDriver |
---|
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION |
Method Summary | |
---|---|
void |
addResourceToOrganizationalUnit(CmsDbContext dbc,
CmsOrganizationalUnit orgUnit,
CmsResource resource)
Adds a resource to the given organizational unit. |
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 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)
Deprecated. use removeAccessControlEntries(CmsDbContext, CmsProject, CmsUUID) instead |
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 |
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. |
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. |
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. |
Methods inherited from interface org.opencms.db.I_CmsDriver |
---|
init, toString |
Field Detail |
---|
static final int DRIVER_TYPE_ID
Method Detail |
---|
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 unit
CmsDataAccessException
- 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
- flags
CmsDataAccessException
- 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 resource
CmsOrganizationalUnit
object representing
the newly created organizational unit
CmsDataAccessException
- 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 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 infos
CmsDataAccessException
- 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 group
CmsDataAccessException
- if operation was not successfulvoid deleteAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource) throws CmsDataAccessException
removeAccessControlEntries(CmsDbContext, CmsProject, CmsUUID)
instead
dbc
- the current database contextproject
- the project to delete the ACEs inresource
- the id of the resource to delete the ACEs from
CmsDataAccessException
- if something goes wrongvoid 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 deleted
CmsDataAccessException
- 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 delete
CmsDataAccessException
- 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 delete
CmsDataAccessException
- if something goes wrongvoid deleteUserInfos(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the user to update
CmsDataAccessException
- 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 group
CmsDataAccessException
- 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 checked
true
, if a group with the specified name exists, false
otherwise
CmsDataAccessException
- 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 checked
CmsDataAccessException
- 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 groups
CmsGroup
objects in the organizational unit
CmsDataAccessException
- 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 returned
CmsOrganizationalUnit
objects
CmsDataAccessException
- if operation was not successfuljava.util.List getResourcesForOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit) throws CmsDataAccessException
dbc
- the current db contextorgUnit
- the organizational unit to get all resources for
CmsResource
objects in the organizational unit
CmsDataAccessException
- 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 too
CmsUser
objects in the organizational unit
CmsDataAccessException
- 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 manager
void 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 id
CmsDataAccessException
- 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 returned
CmsAccessControlEntry
objects defining all permissions for the given resource
CmsDataAccessException
- 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 principal
CmsDataAccessException
- 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 from
CmsGroup
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 read
CmsDataAccessException
- 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 read
CmsDataAccessException
- 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 groups
CmsGroup
objects
CmsDataAccessException
- 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 read
CmsDataAccessException
- if something goes wrongCmsUser readUser(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
dbc
- the current database contextid
- the id of the user to read
CmsDataAccessException
- 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 read
CmsDataAccessException
- 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 wrong
CmsPasswordEncryptionException
- 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 update
CmsDataAccessException
- 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 units
CmsUser
objects in the group
CmsDataAccessException
- 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 resource
CmsDataAccessException
- 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 principal
CmsDataAccessException
- 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 principal
CmsDataAccessException
- 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 unit
CmsDataAccessException
- if something goes wrongvoid 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 unit
CmsDataAccessException
- 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 write
CmsDataAccessException
- 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 update
CmsDataAccessException
- 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 written
CmsDataAccessException
- 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 set
CmsDataAccessException
- if something goes wrong
CmsPasswordEncryptionException
- 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 update
CmsDataAccessException
- 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 write
CmsDataAccessException
- if something goes wrong
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |