com.stratelia.silverpeas.domains.ldapdriver
Class LDAPDriver

java.lang.Object
  extended by com.stratelia.webactiv.beans.admin.AbstractDomainDriver
      extended by com.stratelia.silverpeas.domains.ldapdriver.LDAPDriver
All Implemented Interfaces:
DomainDriver

public class LDAPDriver
extends AbstractDomainDriver

Domain driver for LDAP access. Could be used to access any type of LDAP DB (even exchange) IMPORTANT : For the moment, it is not possible to add, remove or update a group neither add or remove an user. However, it is possible to update an user...

Author:
tleroi

Field Summary
protected  LDAPSettings driverSettings
           
protected  AbstractLDAPGroup groupTranslator
           
protected  LDAPUser userTranslator
           
 
Fields inherited from class com.stratelia.webactiv.beans.admin.AbstractDomainDriver
domainId, domainProperties, keys, m_mapParameters, m_PropertiesDescriptions, m_PropertiesLabels, m_PropertiesMultilang, x509Enabled
 
Fields inherited from interface com.stratelia.webactiv.beans.admin.DomainDriver
ACTION_CREATE_GROUP, ACTION_CREATE_USER, ACTION_DELETE_GROUP, ACTION_DELETE_USER, ACTION_EDIT_USER_IN_GROUP, ACTION_IMPORT_GROUP, ACTION_IMPORT_USER, ACTION_MASK_ALL, ACTION_MASK_MIXED_GROUPS, ACTION_MASK_RO, ACTION_MASK_RW, ACTION_NONE, ACTION_READ_GROUP, ACTION_READ_USER, ACTION_REMOVE_GROUP, ACTION_REMOVE_USER, ACTION_SYNCHRO_GROUP, ACTION_SYNCHRO_USER, ACTION_UPDATE_GROUP, ACTION_UPDATE_USER, ACTION_X509_USER
 
Constructor Summary
LDAPDriver()
           
 
Method Summary
 void addPropertiesToImport(List<DomainProperty> props)
           
 void addPropertiesToImport(List<DomainProperty> props, Map<String,String> descriptions)
           
 void beginSynchronization()
          Called when Admin starts the synchronization
 void commit()
          Commit transaction
 String createGroup(Group m_Group)
           
 String createUser(UserDetail user)
           
 void deleteGroup(String groupId)
           
 void deleteUser(String userId)
           
 String endSynchronization()
          Called when Admin ends the synchronization
 Group[] getAllChangedGroups(String fromTimeStamp, String toTimeStamp)
           
 UserDetail[] getAllChangedUsers(String fromTimeStamp, String toTimeStamp)
           
 Group[] getAllGroups()
          Retrieve all groups from the database
 Group[] getAllRootGroups()
          Retrieve all root groups from the database
 UserDetail[] getAllUsers()
          Retrieve all users from the database
 long getDriverActions()
          Called when Admin starts the synchronization
 Group getGroup(String groupId)
          Retrieve group information from database
 Group getGroupByName(String groupName)
           
 String[] getGroupMemberGroupIds(String groupId)
           
 Group[] getGroups(String groupId)
          Retrieve all groups contained in the given group
 String getTimeStamp(String minTimeStamp)
           
 String getTimeStampField()
           
 UserDetail getUser(String userId)
          Retrieve user information from database
 List<String> getUserAttributes()
           
 UserFull getUserFull(String userId)
          Retrieve user information from database
 String[] getUserMemberGroupIds(String userId)
          Retrieve user's groups
 UserDetail[] getUsersByQuery(Map<String,String> query)
           
 UserDetail[] getUsersBySpecificProperty(String propertyName, String propertyValue)
           
 Group importGroup(String groupName)
          Import a given group in Database from the reference
 UserDetail importUser(String userLogin)
          Import a given user in Database from the reference
 void initFromProperties(ResourceLocator rs)
          Virtual method that performs extra initialization from a properties file.
 boolean isGroupsInheritProfiles()
           
 boolean isSynchroOnLoginEnabled()
           
 boolean isSynchroOnLoginRecursToGroups()
           
 boolean isSynchroThreaded()
           
 boolean mustImportUsers()
           
 void removeGroup(String groupId)
          Remove a given group from database
 void removeUser(String userId)
          Remove a given user from database
 void resetEncryptedPassword(UserDetail user, String encryptedPassword)
           
 void resetPassword(UserDetail user, String password)
           
 void rollback()
          Rollback transaction
 void startTransaction(boolean bAutoCommit)
          Start a new transaction
 Group synchroGroup(String groupId)
          Update group information in database
 UserDetail synchroUser(String userId)
          Update user information in database
 void updateGroup(Group m_Group)
           
 void updateUserDetail(UserDetail user)
           
 void updateUserFull(UserFull user)
           
 
Methods inherited from class com.stratelia.webactiv.beans.admin.AbstractDomainDriver
endSynchronization, getMapParameters, getPropertiesDescriptions, getPropertiesLabels, getPropertiesNames, getPropertiesToImport, getProperty, idAsInt, idAsString, init, isSynchroInProcess, isX509CertificateEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

driverSettings

protected LDAPSettings driverSettings

userTranslator

protected LDAPUser userTranslator

groupTranslator

protected AbstractLDAPGroup groupTranslator
Constructor Detail

LDAPDriver

public LDAPDriver()
Method Detail

initFromProperties

public void initFromProperties(ResourceLocator rs)
                        throws AdminException
Virtual method that performs extra initialization from a properties file. To overload by the class who need it.

Specified by:
initFromProperties in interface DomainDriver
Overrides:
initFromProperties in class AbstractDomainDriver
Parameters:
rs - name of resource file
Throws:
AdminException

addPropertiesToImport

public void addPropertiesToImport(List<DomainProperty> props)
Specified by:
addPropertiesToImport in interface DomainDriver
Overrides:
addPropertiesToImport in class AbstractDomainDriver

addPropertiesToImport

public void addPropertiesToImport(List<DomainProperty> props,
                                  Map<String,String> descriptions)
Specified by:
addPropertiesToImport in interface DomainDriver
Overrides:
addPropertiesToImport in class AbstractDomainDriver

getDriverActions

public long getDriverActions()
Called when Admin starts the synchronization

Specified by:
getDriverActions in interface DomainDriver
Overrides:
getDriverActions in class AbstractDomainDriver
Returns:

isSynchroOnLoginEnabled

public boolean isSynchroOnLoginEnabled()
Specified by:
isSynchroOnLoginEnabled in interface DomainDriver
Overrides:
isSynchroOnLoginEnabled in class AbstractDomainDriver

isSynchroOnLoginRecursToGroups

public boolean isSynchroOnLoginRecursToGroups()
Specified by:
isSynchroOnLoginRecursToGroups in interface DomainDriver
Overrides:
isSynchroOnLoginRecursToGroups in class AbstractDomainDriver

isGroupsInheritProfiles

public boolean isGroupsInheritProfiles()
Specified by:
isGroupsInheritProfiles in interface DomainDriver
Overrides:
isGroupsInheritProfiles in class AbstractDomainDriver

mustImportUsers

public boolean mustImportUsers()
Specified by:
mustImportUsers in interface DomainDriver
Overrides:
mustImportUsers in class AbstractDomainDriver

isSynchroThreaded

public boolean isSynchroThreaded()
Specified by:
isSynchroThreaded in interface DomainDriver
Overrides:
isSynchroThreaded in class AbstractDomainDriver

getTimeStamp

public String getTimeStamp(String minTimeStamp)
                    throws AdminException
Specified by:
getTimeStamp in interface DomainDriver
Overrides:
getTimeStamp in class AbstractDomainDriver
Throws:
AdminException

getTimeStampField

public String getTimeStampField()
Specified by:
getTimeStampField in interface DomainDriver
Overrides:
getTimeStampField in class AbstractDomainDriver

getAllChangedUsers

public UserDetail[] getAllChangedUsers(String fromTimeStamp,
                                       String toTimeStamp)
                                throws AdminException
Throws:
AdminException

getAllChangedGroups

public Group[] getAllChangedGroups(String fromTimeStamp,
                                   String toTimeStamp)
                            throws AdminException
Throws:
AdminException

beginSynchronization

public void beginSynchronization()
                          throws Exception
Called when Admin starts the synchronization

Specified by:
beginSynchronization in interface DomainDriver
Overrides:
beginSynchronization in class AbstractDomainDriver
Throws:
Exception

endSynchronization

public String endSynchronization()
                          throws Exception
Called when Admin ends the synchronization

Throws:
Exception

importUser

public UserDetail importUser(String userLogin)
                      throws AdminException
Import a given user in Database from the reference

Parameters:
userLogin - The User Login to import
Returns:
The User object that contain new user information
Throws:
AdminException

removeUser

public void removeUser(String userId)
                throws AdminException
Remove a given user from database

Parameters:
userId - The user id To remove synchro
Throws:
AdminException

synchroUser

public UserDetail synchroUser(String userId)
                       throws Exception
Update user information in database

Parameters:
userId - The User Id to synchronize
Returns:
The User object that contain new user information
Throws:
Exception

createUser

public String createUser(UserDetail user)
                  throws Exception
Throws:
Exception

deleteUser

public void deleteUser(String userId)
                throws Exception
Throws:
Exception

updateUserFull

public void updateUserFull(UserFull user)
                    throws AdminException
Throws:
AdminException

updateUserDetail

public void updateUserDetail(UserDetail user)
                      throws Exception
Throws:
Exception

getUserFull

public UserFull getUserFull(String userId)
                     throws AdminException
Retrieve user information from database

Parameters:
userId - The user id as stored in the database
Returns:
The User object that contain new user information
Throws:
AdminException

getUser

public UserDetail getUser(String userId)
                   throws AdminException
Retrieve user information from database

Parameters:
userId - The user id as stored in the database
Returns:
The User object that contain new user information
Throws:
AdminException

getAllUsers

public UserDetail[] getAllUsers()
                         throws AdminException
Retrieve all users from the database

Returns:
User[] An array of User Objects that contain users information
Throws:
AdminException

getUsersBySpecificProperty

public UserDetail[] getUsersBySpecificProperty(String propertyName,
                                               String propertyValue)
                                        throws AdminException
Throws:
AdminException

getUsersByQuery

public UserDetail[] getUsersByQuery(Map<String,String> query)
                             throws AdminException
Throws:
AdminException

getUserMemberGroupIds

public String[] getUserMemberGroupIds(String userId)
                               throws AdminException
Retrieve user's groups

Parameters:
userId - The user id as stored in the database
Returns:
The User's groups specific Ids
Throws:
AdminException

importGroup

public Group importGroup(String groupName)
                  throws AdminException
Import a given group in Database from the reference

Parameters:
groupName - The group name to import
Returns:
The group object that contain new group information
Throws:
AdminException

removeGroup

public void removeGroup(String groupId)
                 throws AdminException
Remove a given group from database

Parameters:
groupId - The group id To remove synchro
Throws:
AdminException

synchroGroup

public Group synchroGroup(String groupId)
                   throws AdminException
Update group information in database

Parameters:
groupId - The group Id to synchronize
Returns:
The group object that contain new group information
Throws:
AdminException

createGroup

public String createGroup(Group m_Group)
                   throws AdminException
Throws:
AdminException

deleteGroup

public void deleteGroup(String groupId)
                 throws AdminException
Throws:
AdminException

updateGroup

public void updateGroup(Group m_Group)
                 throws AdminException
Throws:
AdminException

getGroup

public Group getGroup(String groupId)
               throws AdminException
Retrieve group information from database

Parameters:
groupId - The group id as stored in the database
Returns:
The Group object that contains user information
Throws:
AdminException

getGroupByName

public Group getGroupByName(String groupName)
                     throws AdminException
Throws:
AdminException

getGroups

public Group[] getGroups(String groupId)
                  throws AdminException
Retrieve all groups contained in the given group

Parameters:
groupId - The group id as stored in the database
Returns:
Group[] An array of Group Objects that contain groups information
Throws:
AdminException

getAllGroups

public Group[] getAllGroups()
                     throws AdminException
Retrieve all groups from the database

Returns:
Group[] An array of Group Objects that contain groups information
Throws:
AdminException

getAllRootGroups

public Group[] getAllRootGroups()
                         throws AdminException
Retrieve all root groups from the database

Returns:
Group[] An array of Group Objects that contain root groups information
Throws:
AdminException

getGroupMemberGroupIds

public String[] getGroupMemberGroupIds(String groupId)
                                throws AdminException
Throws:
AdminException

startTransaction

public void startTransaction(boolean bAutoCommit)
Start a new transaction

Parameters:
bAutoCommit - Specifies is transaction is automatically committed (without explicit 'commit' statement)

commit

public void commit()
            throws AdminException
Commit transaction

Throws:
AdminException

rollback

public void rollback()
              throws AdminException
Rollback transaction

Throws:
AdminException

getUserAttributes

public List<String> getUserAttributes()
                               throws AdminException
Throws:
AdminException

resetPassword

public void resetPassword(UserDetail user,
                          String password)
                   throws Exception
Throws:
Exception

resetEncryptedPassword

public void resetEncryptedPassword(UserDetail user,
                                   String encryptedPassword)
                            throws Exception
Throws:
Exception


Copyright © 2016 Silverpeas. All Rights Reserved.