Class LDAPDriver
- java.lang.Object
-
- org.silverpeas.core.admin.domain.AbstractDomainDriver
-
- org.silverpeas.core.admin.domain.driver.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.admin.domain.DomainDriver
DomainDriver.ActionConstants, DomainDriver.UserFilterManager
-
-
Field Summary
Fields Modifier and Type Field Description protected LDAPSettings
driverSettings
protected AbstractLDAPGroup
groupTranslator
protected LDAPUser
userTranslator
-
Constructor Summary
Constructors Constructor Description LDAPDriver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertiesToImport(List<DomainProperty> props)
void
addPropertiesToImport(List<DomainProperty> props, Map<String,String> descriptions)
void
beginSynchronization()
Called when Admin starts the synchronizationString
createGroup(GroupDetail group)
String
createUser(UserDetail user)
void
deleteGroup(String groupId)
void
deleteUser(String userId)
String
endSynchronization()
Called when Admin ends the synchronizationGroupDetail[]
getAllGroups()
Retrieve all groups from the databaseGroupDetail[]
getAllRootGroups()
Retrieve all root groups from the databaseUserDetail[]
getAllUsers()
Retrieve all users from the databaselong
getDriverActions()
Gets all the actions this driver supports.GroupDetail
getGroup(String specificId)
Retrieve group information from databaseGroupDetail
getGroupByName(String groupName)
String[]
getGroupMemberGroupIds(String groupId)
GroupDetail[]
getGroups(String groupId)
Retrieve all groups contained in the given groupUserDetail
getUser(String specificId)
Retrieve user information from databaseList<String>
getUserAttributes()
UserFull
getUserFull(String specificId)
Retrieve user information from databaseString[]
getUserMemberGroupIds(String specificId)
Retrieve user's groupsUserDetail[]
getUsersByQuery(Map<String,String> query)
UserDetail[]
getUsersBySpecificProperty(String propertyName, String propertyValue)
GroupDetail
importGroup(String groupName)
Import a given group in Database from the referenceUserDetail
importUser(String userLogin)
Import a given user in Database from the referencevoid
initFromProperties(org.silverpeas.kernel.bundle.SettingBundle rs)
Initializes the driver from the specified settings bundle.boolean
isGroupsInheritProfiles()
boolean
isSynchroOnLoginEnabled()
boolean
isSynchroOnLoginRecursToGroups()
boolean
isSynchroThreaded()
List<UserFull>
listUserFulls(Collection<String> specificIds)
Retrieves common user information with the additional data from database against the given identifiers.List<UserDetail>
listUsers(Collection<String> specificIds)
Retrieves the common user information from database against the given identifiers.boolean
mustImportUsers()
void
removeGroup(String groupId)
Remove a given group from databasevoid
removeUser(String userId)
Remove a given user from databasevoid
resetEncryptedPassword(UserDetail user, String encryptedPassword)
void
resetPassword(UserDetail user, String password)
GroupDetail
synchroGroup(String groupId)
Update group information in databaseUserDetail
synchroUser(String userId)
Update user information in databasevoid
updateGroup(GroupDetail group)
void
updateUserDetail(UserDetail user)
void
updateUserFull(UserFull user)
-
Methods inherited from class org.silverpeas.core.admin.domain.AbstractDomainDriver
endSynchronization, getDomainId, getMapParameters, getPropertiesDescriptions, getPropertiesLabels, getPropertiesNames, getPropertiesToImport, getProperty, idAsInt, idAsString, init, isSynchroInProcess, isX509CertificateEnabled, isX509Enabled, setSynchroInProcess
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.admin.domain.DomainDriver
getUserFilterManager
-
-
-
-
Field Detail
-
driverSettings
protected LDAPSettings driverSettings
-
userTranslator
protected LDAPUser userTranslator
-
groupTranslator
protected AbstractLDAPGroup groupTranslator
-
-
Method Detail
-
initFromProperties
public void initFromProperties(org.silverpeas.kernel.bundle.SettingBundle rs) throws AdminException
Initializes the driver from the specified settings bundle.- Specified by:
initFromProperties
in interfaceDomainDriver
- Overrides:
initFromProperties
in classAbstractDomainDriver
- Parameters:
rs
- name of resource file- Throws:
AdminException
- if the initialization fails.
-
addPropertiesToImport
public void addPropertiesToImport(List<DomainProperty> props)
- Specified by:
addPropertiesToImport
in interfaceDomainDriver
- Overrides:
addPropertiesToImport
in classAbstractDomainDriver
-
addPropertiesToImport
public void addPropertiesToImport(List<DomainProperty> props, Map<String,String> descriptions)
- Specified by:
addPropertiesToImport
in interfaceDomainDriver
- Overrides:
addPropertiesToImport
in classAbstractDomainDriver
-
getDriverActions
public long getDriverActions()
Gets all the actions this driver supports.- Specified by:
getDriverActions
in interfaceDomainDriver
- Overrides:
getDriverActions
in classAbstractDomainDriver
- Returns:
- a bit mask identifying the supported actions.
-
isSynchroOnLoginEnabled
public boolean isSynchroOnLoginEnabled()
- Specified by:
isSynchroOnLoginEnabled
in interfaceDomainDriver
- Overrides:
isSynchroOnLoginEnabled
in classAbstractDomainDriver
-
isSynchroOnLoginRecursToGroups
public boolean isSynchroOnLoginRecursToGroups()
- Specified by:
isSynchroOnLoginRecursToGroups
in interfaceDomainDriver
- Overrides:
isSynchroOnLoginRecursToGroups
in classAbstractDomainDriver
-
isGroupsInheritProfiles
public boolean isGroupsInheritProfiles()
- Specified by:
isGroupsInheritProfiles
in interfaceDomainDriver
- Overrides:
isGroupsInheritProfiles
in classAbstractDomainDriver
-
mustImportUsers
public boolean mustImportUsers()
- Specified by:
mustImportUsers
in interfaceDomainDriver
- Overrides:
mustImportUsers
in classAbstractDomainDriver
-
isSynchroThreaded
public boolean isSynchroThreaded()
- Specified by:
isSynchroThreaded
in interfaceDomainDriver
- Overrides:
isSynchroThreaded
in classAbstractDomainDriver
-
beginSynchronization
public void beginSynchronization()
Called when Admin starts the synchronization- Specified by:
beginSynchronization
in interfaceDomainDriver
- Overrides:
beginSynchronization
in classAbstractDomainDriver
-
endSynchronization
public String endSynchronization()
Called when Admin ends the synchronization
-
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 AdminException
Update user information in database- Parameters:
userId
- The User Id to synchronize- Returns:
- The User object that contain new user information
- Throws:
AdminException
-
createUser
public String createUser(UserDetail user) throws AdminException
- Throws:
AdminException
-
deleteUser
public void deleteUser(String userId) throws AdminException
- Throws:
AdminException
-
updateUserFull
public void updateUserFull(UserFull user) throws AdminException
- Throws:
AdminException
-
updateUserDetail
public void updateUserDetail(UserDetail user)
-
getUserFull
public UserFull getUserFull(String specificId) throws AdminException
Retrieve user information from database- Parameters:
specificId
- The user id as stored in the database- Returns:
- The User object that contain new user information
- Throws:
AdminException
- if the user cannot be gotten.
-
listUserFulls
public List<UserFull> listUserFulls(Collection<String> specificIds) throws AdminException
Description copied from interface:DomainDriver
Retrieves common user information with the additional data from database against the given identifiers.- Parameters:
specificIds
- The user ids as stored in the database.- Returns:
- a list of full User object.
- Throws:
AdminException
-
getUser
public UserDetail getUser(String specificId) throws AdminException
Retrieve user information from database- Parameters:
specificId
- The user id as stored in the database- Returns:
- The User object that contain new user information
- Throws:
AdminException
- if the user cannot be gotten.
-
listUsers
public List<UserDetail> listUsers(Collection<String> specificIds) throws AdminException
Description copied from interface:DomainDriver
Retrieves the common user information from database against the given identifiers.- Parameters:
specificIds
- The user ids as stored in the database.- Returns:
- a list of common User object.
- 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
- if the fetching of the users fails.
-
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 specificId) throws AdminException
Retrieve user's groups- Parameters:
specificId
- The user id as stored in the database- Returns:
- The User's groups specific Ids
- Throws:
AdminException
-
importGroup
public GroupDetail 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 GroupDetail 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(GroupDetail group) throws AdminException
- Throws:
AdminException
-
deleteGroup
public void deleteGroup(String groupId) throws AdminException
- Throws:
AdminException
-
updateGroup
public void updateGroup(GroupDetail group) throws AdminException
- Throws:
AdminException
-
getGroup
public GroupDetail getGroup(String specificId) throws AdminException
Retrieve group information from database- Parameters:
specificId
- The group id as stored in the database- Returns:
- The GroupDetail object that contains user information
- Throws:
AdminException
-
getGroupByName
public GroupDetail getGroupByName(String groupName) throws AdminException
- Throws:
AdminException
-
getGroups
public GroupDetail[] getGroups(String groupId) throws AdminException
Retrieve all groups contained in the given group- Parameters:
groupId
- The group id as stored in the database- Returns:
- GroupDetail[] An array of GroupDetail Objects that contain groups information
- Throws:
AdminException
-
getAllGroups
public GroupDetail[] getAllGroups() throws AdminException
Retrieve all groups from the database- Returns:
- GroupDetail[] An array of GroupDetail Objects that contain groups information
- Throws:
AdminException
-
getAllRootGroups
public GroupDetail[] getAllRootGroups() throws AdminException
Retrieve all root groups from the database- Returns:
- GroupDetail[] An array of GroupDetail Objects that contain root groups information
- Throws:
AdminException
-
getGroupMemberGroupIds
public String[] getGroupMemberGroupIds(String groupId) throws AdminException
- Throws:
AdminException
-
getUserAttributes
public List<String> getUserAttributes() throws AdminException
- Throws:
AdminException
-
resetPassword
public void resetPassword(UserDetail user, String password) throws AdminException
- Throws:
AdminException
-
resetEncryptedPassword
public void resetEncryptedPassword(UserDetail user, String encryptedPassword)
-
-