|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Definitions of all required user driver methods.
Field Summary | |
static int |
DRIVER_TYPE_ID
The type ID to identify user driver implementations. |
Method Summary | |
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 groupName,
java.lang.String description,
int flags,
java.lang.String parentGroupName,
java.lang.Object reservedParam)
Creates a new group. |
CmsUser |
createUser(CmsDbContext dbc,
java.lang.String name,
java.lang.String password,
java.lang.String description,
java.lang.String firstname,
java.lang.String lastname,
java.lang.String email,
long lastlogin,
int flags,
java.util.Map additionalInfos,
java.lang.String address,
int type)
Creates a new user. |
void |
createUserInGroup(CmsDbContext dbc,
CmsUUID userid,
CmsUUID groupid,
java.lang.Object reservedParam)
Adds a user to a group. |
void |
deleteAccessControlEntries(CmsDbContext dbc,
CmsProject project,
CmsUUID resource)
Deletes all access control entries (ACEs) belonging to a resource. |
void |
deleteGroup(CmsDbContext dbc,
java.lang.String name)
Deletes a group. |
void |
deleteUser(CmsDbContext dbc,
java.lang.String userName)
Deletes a user. |
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 groupname,
java.lang.Object reservedParam)
Tests if a group with the specified name exists. |
boolean |
existsUser(CmsDbContext dbc,
java.lang.String username,
int usertype,
java.lang.Object reservedParam)
Tests if a user with the specified name exists. |
CmsSqlManager |
getSqlManager()
Returns the SqlManager of this driver. |
CmsUser |
importUser(CmsDbContext dbc,
CmsUUID id,
java.lang.String name,
java.lang.String password,
java.lang.String description,
java.lang.String firstname,
java.lang.String lastname,
java.lang.String email,
long lastlogin,
int flags,
java.util.Map additionalInfos,
java.lang.String address,
int type,
java.lang.Object reservedParam)
Creates a new user by import. |
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 |
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 |
readChildGroups(CmsDbContext dbc,
java.lang.String groupname)
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 groupName)
Reads a group based on the group name. |
java.util.List |
readGroups(CmsDbContext dbc)
Reads all existing groups. |
java.util.List |
readGroupsOfUser(CmsDbContext dbc,
CmsUUID userId,
java.lang.String paramStr)
Reads all groups the given user is a member in. |
CmsUser |
readUser(CmsDbContext dbc,
CmsUUID id)
Reads a user based on the user id. |
CmsUser |
readUser(CmsDbContext dbc,
java.lang.String name,
int type)
Reads a user based in the user name and user type. |
CmsUser |
readUser(CmsDbContext dbc,
java.lang.String name,
java.lang.String password,
int type)
Reads a user from the database, only if the password is correct. |
CmsUser |
readUser(CmsDbContext dbc,
java.lang.String name,
java.lang.String password,
java.lang.String remoteAddress,
int type)
Reads a user from the database, only if the password is correct. |
java.util.List |
readUsers(CmsDbContext dbc,
int type)
Reads all existing users of the given type. |
java.util.List |
readUsersOfGroup(CmsDbContext dbc,
java.lang.String name,
int type)
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 |
writeAccessControlEntry(CmsDbContext dbc,
CmsProject project,
CmsAccessControlEntry acEntry)
Writes an access control entry. |
void |
writeGroup(CmsDbContext dbc,
CmsGroup group)
Writes an already existing group. |
void |
writePassword(CmsDbContext dbc,
java.lang.String userName,
int type,
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 |
writeUserType(CmsDbContext dbc,
CmsUUID userId,
int userType)
Changes the user type of the given user. |
Methods inherited from interface org.opencms.db.I_CmsDriver |
init, toString |
Field Detail |
public static final int DRIVER_TYPE_ID
Method Detail |
public void 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 wrongpublic CmsGroup createGroup(CmsDbContext dbc, CmsUUID groupId, java.lang.String groupName, java.lang.String description, int flags, java.lang.String parentGroupName, java.lang.Object reservedParam) throws CmsDataAccessException
dbc
- the current database contextgroupId
- the id of the new groupgroupName
- the 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)reservedParam
- reserved optional parameter, should be null on standard OpenCms installations
CmsDataAccessException
- if something goes wrongpublic CmsUser createUser(CmsDbContext dbc, java.lang.String name, java.lang.String password, java.lang.String description, java.lang.String firstname, java.lang.String lastname, java.lang.String email, long lastlogin, int flags, java.util.Map additionalInfos, java.lang.String address, int type) throws CmsDataAccessException, CmsPasswordEncryptionException
dbc
- the current database contextname
- the user namepassword
- the user passworddescription
- the user descriptionfirstname
- the user firstnamelastname
- the user lastnameemail
- the user emaillastlogin
- the user lastlogin timeflags
- the user flagsadditionalInfos
- the user additional infosaddress
- the user default addresstype
- the user type
CmsDataAccessException
- if something goes wrong
CmsPasswordEncryptionException
- if the user password could not be encryptedpublic void createUserInGroup(CmsDbContext dbc, CmsUUID userid, CmsUUID groupid, java.lang.Object reservedParam) throws CmsDataAccessException
dbc
- the current database contextuserid
- the id of the user that is to be added to the groupgroupid
- the id of the groupreservedParam
- reserved optional parameter, should be null on standard OpenCms installations
CmsDataAccessException
- if operation was not succesfullpublic void deleteAccessControlEntries(CmsDbContext dbc, CmsProject project, CmsUUID resource) throws CmsDataAccessException
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 wrongpublic void deleteGroup(CmsDbContext dbc, java.lang.String name) throws CmsDataAccessException
Only groups that contain no subgroups can be deleted.
dbc
- the current database contextname
- the name of the group that is to be deleted
CmsDataAccessException
- if something goes wrongpublic void deleteUser(CmsDbContext dbc, java.lang.String userName) throws CmsDataAccessException
dbc
- the current database contextuserName
- the name of the user to delete
CmsDataAccessException
- if something goes wrongpublic void 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 wrongpublic void destroy() throws java.lang.Throwable
java.lang.Throwable
- if something goes wrongpublic boolean existsGroup(CmsDbContext dbc, java.lang.String groupname, java.lang.Object reservedParam) throws CmsDataAccessException
dbc
- the current database contextgroupname
- the user name to be checkedreservedParam
- reserved optional parameter, should be null on standard OpenCms installations
CmsDataAccessException
- if something goes wrongpublic boolean existsUser(CmsDbContext dbc, java.lang.String username, int usertype, java.lang.Object reservedParam) throws CmsDataAccessException
dbc
- the current database contextusername
- the user name to be checkedusertype
- the type of the userreservedParam
- reserved optional parameter, should be null on standard OpenCms installations
CmsDataAccessException
- if something goes wrongpublic CmsSqlManager getSqlManager()
public CmsUser importUser(CmsDbContext dbc, CmsUUID id, java.lang.String name, java.lang.String password, java.lang.String description, java.lang.String firstname, java.lang.String lastname, java.lang.String email, long lastlogin, int flags, java.util.Map additionalInfos, java.lang.String address, int type, java.lang.Object reservedParam) throws CmsDataAccessException
dbc
- the current database contextid
- the id of the username
- the new name for the userpassword
- the new password for the userdescription
- the description for the userfirstname
- the firstname of the userlastname
- the lastname of the useremail
- the email of the userlastlogin
- the user lastlogin timeflags
- the flags for a user (e.g. I_CmsPrincipal.FLAG_ENABLED
)additionalInfos
- a Map
with additional infos for the user. These
infos may be stored into the Usertables (depending on the implementation).address
- the address of the usertype
- the type of the userreservedParam
- reserved optional parameter, should be null
on standard OpenCms installations
CmsUser
object representing the added user
CmsDataAccessException
- if operation was not successfulpublic CmsSqlManager initSqlManager(java.lang.String classname)
To obtain JDBC connections from different pools, further {online|offline|backup} pool Urls have to be specified.
classname
- the classname of the SQL manager
public 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 wrongpublic java.util.List 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 wrongpublic CmsAccessControlEntry 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 wrongpublic java.util.List readChildGroups(CmsDbContext dbc, java.lang.String groupname) throws CmsDataAccessException
dbc
- the current database contextgroupname
- the name of the group to read the child groups from
CmsGroup
objects or null
CmsDataAccessException
- if operation was not succesfulpublic CmsGroup 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 wrongpublic CmsGroup readGroup(CmsDbContext dbc, java.lang.String groupName) throws CmsDataAccessException
dbc
- the current database contextgroupName
- the name of the group that is to be read
CmsDataAccessException
- if something goes wrongpublic java.util.List readGroups(CmsDbContext dbc) throws CmsDataAccessException
dbc
- the current database context
CmsGroup
objects
CmsDataAccessException
- if something goes wrongpublic java.util.List readGroupsOfUser(CmsDbContext dbc, CmsUUID userId, java.lang.String paramStr) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the userparamStr
- additional parameter
CmsGroup
objects
CmsDataAccessException
- if something goes wrongpublic CmsUser readUser(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
dbc
- the current database contextid
- the id of the user to read
CmsDataAccessException
- if something goes wrongpublic CmsUser readUser(CmsDbContext dbc, java.lang.String name, int type) throws CmsDataAccessException
dbc
- the current database contextname
- the name of the user to readtype
- the type of the user to read
CmsDataAccessException
- if something goes wrongpublic CmsUser readUser(CmsDbContext dbc, java.lang.String name, java.lang.String password, int type) throws CmsDataAccessException, CmsPasswordEncryptionException
If the user/pwd pair is not valid a
is thrown.CmsDataAccessException
dbc
- the current database contextname
- the name of the userpassword
- the password of the usertype
- the type of the user
CmsDataAccessException
- if something goes wrong
CmsPasswordEncryptionException
- if the password of the user could not be encryptedpublic CmsUser readUser(CmsDbContext dbc, java.lang.String name, java.lang.String password, java.lang.String remoteAddress, int type) throws CmsDataAccessException, CmsPasswordEncryptionException
dbc
- the current database contextname
- the name of the userpassword
- the password of the userremoteAddress
- the remote address of the requesttype
- the type of the user
CmsDataAccessException
- if something goes wrong
CmsPasswordEncryptionException
- if the password of the user could not be encryptedpublic java.util.List readUsers(CmsDbContext dbc, int type) throws CmsDataAccessException
dbc
- the current database contexttype
- the type to read the users for
CmsUser
objects of the given type
CmsDataAccessException
- if something goes wrongpublic java.util.List readUsersOfGroup(CmsDbContext dbc, java.lang.String name, int type) throws CmsDataAccessException
dbc
- the current database contextname
- the name of the group to read the users fromtype
- the type of the users to read
CmsUser
objects in the group
CmsDataAccessException
- if something goes wrongpublic void 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 wrongpublic void 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 wrongpublic void 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 wrongpublic void 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 wrongpublic void 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 wrongpublic void writePassword(CmsDbContext dbc, java.lang.String userName, int type, java.lang.String oldPassword, java.lang.String newPassword) throws CmsDataAccessException, CmsPasswordEncryptionException
dbc
- the current database contextuserName
- the user to set the password fortype
- the type of the useroldPassword
- the current passwordnewPassword
- the password to set
CmsDataAccessException
- if something goes wrong
CmsPasswordEncryptionException
- if the (new) password could not be encryptedpublic void 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 wrongpublic void writeUserType(CmsDbContext dbc, CmsUUID userId, int userType) throws CmsDataAccessException
dbc
- the current database contextuserId
- the id of the user to changeuserType
- the new type of the user
CmsDataAccessException
- if something goes wrong
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |