org.opencms.db.postgresql
Class CmsUserDriver

java.lang.Object
  extended by org.opencms.db.generic.CmsUserDriver
      extended by org.opencms.db.postgresql.CmsUserDriver
All Implemented Interfaces:
I_CmsDriver, I_CmsUserDriver

public class CmsUserDriver
extends CmsUserDriver

PostgreSql implementation of the user driver methods.

Since:
6.0.0
Version:
$Revision: 1.17 $
Author:
Antonio Core

Field Summary
 
Fields inherited from class org.opencms.db.generic.CmsUserDriver
m_adminUserName, m_digest, m_digestAlgorithm, m_digestFileEncoding, m_driverManager, m_sqlManager
 
Fields inherited from interface org.opencms.db.I_CmsUserDriver
DRIVER_TYPE_ID
 
Constructor Summary
CmsUserDriver()
           
 
Method Summary
 CmsGroup createGroup(CmsDbContext dbc, CmsUUID groupId, String groupName, String description, int flags, String parentGroupName, Object reservedParam)
          Creates a new group.
 CmsUser createUser(CmsDbContext dbc, String name, String password, String description, String firstname, String lastname, String email, long lastlogin, int flags, Map additionalInfos, String address, int type)
          Creates a new user.
 CmsUser importUser(CmsDbContext dbc, CmsUUID id, String name, String password, String description, String firstname, String lastname, String email, long lastlogin, int flags, Map additionalInfos, String address, int type, Object reservedParam)
          Creates a new user by import.
 CmsSqlManager initSqlManager(String classname)
          Initializes the SQL manager for this driver.
 void writeGroup(CmsDbContext dbc, CmsGroup group)
          Writes an already existing group.
 void writeUser(CmsDbContext dbc, CmsUser user)
          Updates the user information.
 
Methods inherited from class org.opencms.db.generic.CmsUserDriver
createAccessControlEntry, createUserInGroup, deleteAccessControlEntries, deleteGroup, deleteUser, deleteUserInGroup, destroy, existsGroup, existsUser, finalize, getSqlManager, init, internalCreateGroup, internalCreateUser, internalSerializeAdditionalUserInfo, publishAccessControlEntries, readAccessControlEntries, readAccessControlEntry, readChildGroups, readGroup, readGroup, readGroups, readGroupsOfUser, readUser, readUser, readUser, readUser, readUsers, readUsersOfGroup, removeAccessControlEntries, removeAccessControlEntriesForPrincipal, removeAccessControlEntry, writeAccessControlEntry, writePassword, writeUserType
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsUserDriver

public CmsUserDriver()
Method Detail

createGroup

public CmsGroup createGroup(CmsDbContext dbc,
                            CmsUUID groupId,
                            String groupName,
                            String description,
                            int flags,
                            String parentGroupName,
                            Object reservedParam)
                     throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Creates a new group.

Specified by:
createGroup in interface I_CmsUserDriver
Overrides:
createGroup in class CmsUserDriver
Parameters:
dbc - the current database context
groupId - the id of the new group
groupName - the name of the new group
description - The description for the new group
flags - the flags for the new group
parentGroupName - 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
Returns:
the created group
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.createGroup(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.String, int, java.lang.String, java.lang.Object)

createUser

public CmsUser createUser(CmsDbContext dbc,
                          String name,
                          String password,
                          String description,
                          String firstname,
                          String lastname,
                          String email,
                          long lastlogin,
                          int flags,
                          Map additionalInfos,
                          String address,
                          int type)
                   throws CmsDataAccessException,
                          CmsPasswordEncryptionException
Description copied from interface: I_CmsUserDriver
Creates a new user.

Specified by:
createUser in interface I_CmsUserDriver
Overrides:
createUser in class CmsUserDriver
Parameters:
dbc - the current database context
name - the user name
password - the user password
description - the user description
firstname - the user firstname
lastname - the user lastname
email - the user email
lastlogin - the user lastlogin time
flags - the user flags
additionalInfos - the user additional infos
address - the user default address
type - the user type
Returns:
the created user
Throws:
CmsDataAccessException - if something goes wrong
CmsPasswordEncryptionException - if the user password could not be encrypted
See Also:
I_CmsUserDriver.createUser(org.opencms.db.CmsDbContext, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, long, int, java.util.Map, java.lang.String, int)

importUser

public CmsUser importUser(CmsDbContext dbc,
                          CmsUUID id,
                          String name,
                          String password,
                          String description,
                          String firstname,
                          String lastname,
                          String email,
                          long lastlogin,
                          int flags,
                          Map additionalInfos,
                          String address,
                          int type,
                          Object reservedParam)
                   throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Creates a new user by import.

Specified by:
importUser in interface I_CmsUserDriver
Overrides:
importUser in class CmsUserDriver
Parameters:
dbc - the current database context
id - the id of the user
name - the new name for the user
password - the new password for the user
description - the description for the user
firstname - the firstname of the user
lastname - the lastname of the user
email - the email of the user
lastlogin - the user lastlogin time
flags - 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 user
type - the type of the user
reservedParam - reserved optional parameter, should be null on standard OpenCms installations
Returns:
a new CmsUser object representing the added user
Throws:
CmsDataAccessException - if operation was not successful
See Also:
I_CmsUserDriver.importUser(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, long, int, java.util.Map, java.lang.String, int, java.lang.Object)

initSqlManager

public CmsSqlManager initSqlManager(String classname)
Description copied from interface: I_CmsUserDriver
Initializes the SQL manager for this driver.

To obtain JDBC connections from different pools, further {online|offline|backup} pool Urls have to be specified.

Specified by:
initSqlManager in interface I_CmsUserDriver
Overrides:
initSqlManager in class CmsUserDriver
Parameters:
classname - the classname of the SQL manager
Returns:
the SQL manager for this driver
See Also:
I_CmsUserDriver.initSqlManager(String)

writeGroup

public void writeGroup(CmsDbContext dbc,
                       CmsGroup group)
                throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Writes an already existing group.

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.

Specified by:
writeGroup in interface I_CmsUserDriver
Overrides:
writeGroup in class CmsUserDriver
Parameters:
dbc - the current database context
group - the group to update
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.writeGroup(org.opencms.db.CmsDbContext, org.opencms.file.CmsGroup)

writeUser

public void writeUser(CmsDbContext dbc,
                      CmsUser user)
               throws CmsDataAccessException
Description copied from interface: I_CmsUserDriver
Updates the user information.

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.

Specified by:
writeUser in interface I_CmsUserDriver
Overrides:
writeUser in class CmsUserDriver
Parameters:
dbc - the current database context
user - the user to update
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsUserDriver.writeUser(org.opencms.db.CmsDbContext, org.opencms.file.CmsUser)