Package org.silverpeas.core.admin.domain
Class DomainDriverManager
- java.lang.Object
-
- org.silverpeas.core.admin.domain.AbstractDomainDriver
-
- org.silverpeas.core.admin.domain.DomainDriverManager
-
- All Implemented Interfaces:
DomainDriver
@Service @Singleton public class DomainDriverManager extends AbstractDomainDriver
A manager of domain drivers. It exposes domain related operations and delegates the domain specific tasks to the correct domain driver for a given domain identifier for which the operation is performed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.admin.domain.DomainDriver
DomainDriver.ActionConstants, DomainDriver.UserFilterManager
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DomainDriverManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
authenticate(String sKey)
Map<String,String>
authenticate(String sKey, boolean removeKey)
void
beginSynchronization(String domainId)
Called when Admin starts the synchronization on a particular DomainString
createDomain(Domain theDomain)
String
createGroup(GroupDetail group)
String
createUser(UserDetail user)
Create a new User.void
deleteGroup(String groupId)
void
deleteUser(String userId)
Delete given user from SilverpeasString
endSynchronization(String domainId, boolean cancelSynchro)
Called when Admin ends the synchronizationDomain[]
getAllDomains()
List<GroupDetail>
getAllGroupOfDomain(String domainId)
GroupDetail[]
getAllGroups()
GroupDetail[]
getAllRootGroups()
GroupDetail[]
getAllRootGroups(String domainId)
UserDetail[]
getAllUsers()
UserDetail[]
getAllUsers(String domainId)
Domain
getDomain(String domainId)
long
getDomainActions(String domainId)
DomainDriver
getDomainDriver(String domainId)
GroupDetail
getGroup(String specificId)
Gets the group of users with the given identifier.GroupDetail
getGroupByName(String groupName)
GroupDetail
getGroupByNameInDomain(String groupName, String domainId)
Gets the group of users whose name is the specified one in the given user domain.String[]
getGroupMemberGroupIds(String groupId)
String[]
getGroupMemberGroupIds(String domainId, String groupId)
GroupDetail[]
getGroups(String groupId)
String
getNextDomainId()
UserDetail
getUser(String specificId)
Retrieves common user information from database.List<String>
getUserAttributes()
UserFull
getUserFull(String specificId)
Retrieves common user information from database with the additional data.String[]
getUserMemberGroupIds(String specificId)
UserDetail[]
getUsersByQuery(Map<String,String> query)
UserDetail[]
getUsersBySpecificProperty(String propertyName, String value)
GroupDetail
importGroup(String groupName)
UserDetail
importUser(String userLogin)
void
indexAllGroups(String domainId)
Indexes all the groups of users of the specified user domain.void
indexAllUsers(String domainId)
Indexes all the user of the specified user domain.void
indexGroup(GroupDetail group)
Indexes the specified group of users.void
indexUser(String userId)
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.void
removeDomain(String domainId)
void
removeGroup(String groupId)
void
removeUser(String userId)
void
resetEncryptedPassword(UserDetail user, String encryptedPassword)
void
resetPassword(UserDetail user, String password)
GroupDetail
synchroGroup(String groupId)
UserDetail
synchroUser(String userId)
void
unindexGroup(String groupId)
Unindex the specified group of users.void
unindexUser(String userId)
String
updateDomain(Domain theDomain)
void
updateGroup(GroupDetail group)
Updates the specified group of users.void
updateUserDetail(UserDetail user)
void
updateUserFull(UserFull user)
-
Methods inherited from class org.silverpeas.core.admin.domain.AbstractDomainDriver
addPropertiesToImport, addPropertiesToImport, beginSynchronization, endSynchronization, getDomainId, getDriverActions, getMapParameters, getPropertiesDescriptions, getPropertiesLabels, getPropertiesNames, getPropertiesToImport, getProperty, idAsInt, idAsString, init, initFromProperties, isGroupsInheritProfiles, isSynchroInProcess, isSynchroOnLoginEnabled, isSynchroOnLoginRecursToGroups, isSynchroThreaded, isX509CertificateEnabled, isX509Enabled, mustImportUsers, 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
-
DOMAIN
public static final String DOMAIN
- See Also:
- Constant Field Values
-
GROUP
public static final String GROUP
- See Also:
- Constant Field Values
-
-
Method Detail
-
createUser
public String createUser(UserDetail user) throws AdminException
Create a new User.- Parameters:
user
- the user to create- Returns:
- the unique identifier of the created user.
- Throws:
AdminException
- if the creation fails.
-
importUser
public UserDetail importUser(String userLogin) throws AdminException
- Throws:
AdminException
-
removeUser
public void removeUser(String userId) throws AdminException
- Throws:
AdminException
-
synchroUser
public UserDetail synchroUser(String userId) throws AdminException
- Throws:
AdminException
-
deleteUser
public void deleteUser(String userId) throws AdminException
Delete given user from Silverpeas- Parameters:
userId
- user Id- Throws:
AdminException
- if the user deletion failed.
-
updateUserDetail
public void updateUserDetail(UserDetail user) throws AdminException
- Throws:
AdminException
-
getUser
public UserDetail getUser(String specificId) throws AdminException
Description copied from interface:DomainDriver
Retrieves common user information from database.- Parameters:
specificId
- The user id as stored in the database.- Returns:
- The full User object that contain ALL user information.
- Throws:
AdminException
-
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
-
updateUserFull
public void updateUserFull(UserFull user) throws AdminException
- Throws:
AdminException
-
getUserFull
public UserFull getUserFull(String specificId) throws AdminException
Description copied from interface:DomainDriver
Retrieves common user information from database with the additional data.- Parameters:
specificId
- The user id as stored in the database.- Returns:
- The full User object that contain ALL user information.
- Throws:
AdminException
-
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
-
getUserMemberGroupIds
public String[] getUserMemberGroupIds(String specificId) throws AdminException
- Throws:
AdminException
-
getAllUsers
public UserDetail[] getAllUsers() throws AdminException
- Throws:
AdminException
-
getUsersBySpecificProperty
public UserDetail[] getUsersBySpecificProperty(String propertyName, String value) throws AdminException
- Throws:
AdminException
-
getUsersByQuery
public UserDetail[] getUsersByQuery(Map<String,String> query) throws AdminException
- Throws:
AdminException
-
importGroup
public GroupDetail importGroup(String groupName) throws AdminException
- Throws:
AdminException
-
removeGroup
public void removeGroup(String groupId) throws AdminException
- Throws:
AdminException
-
synchroGroup
public GroupDetail synchroGroup(String groupId) throws AdminException
- Throws:
AdminException
-
getAllUsers
public UserDetail[] getAllUsers(String domainId) throws AdminException
- Throws:
AdminException
-
indexAllUsers
public void indexAllUsers(String domainId) throws AdminException
Indexes all the user of the specified user domain.- Parameters:
domainId
- the unique identifier of a user domain.- Throws:
AdminException
- if the indexation fails.
-
indexUser
public void indexUser(String userId)
-
unindexUser
public void unindexUser(String userId)
-
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
Updates the specified group of users.- Parameters:
group
- the group to update.- Throws:
AdminException
-
getGroup
public GroupDetail getGroup(String specificId) throws AdminException
Gets the group of users with the given identifier.- Parameters:
specificId
- the identifier of the group specific to the user domain to which it belongs.- Returns:
- GroupDetail instance.
- Throws:
AdminException
- if the group cannot be gotten.- API Note:
- The list of the identifiers of the users of the group are loaded.
-
getGroupByName
public GroupDetail getGroupByName(String groupName) throws AdminException
- Throws:
AdminException
-
getGroupByNameInDomain
public GroupDetail getGroupByNameInDomain(String groupName, String domainId) throws AdminException
Gets the group of users whose name is the specified one in the given user domain.- Parameters:
groupName
- the name of the group to get.domainId
- the unique identifier of the user domain.- Returns:
- GroupDetail instance
- Throws:
AdminException
-
getGroups
public GroupDetail[] getGroups(String groupId) throws AdminException
- Throws:
AdminException
-
getAllGroups
public GroupDetail[] getAllGroups() throws AdminException
- Throws:
AdminException
-
getAllRootGroups
public GroupDetail[] getAllRootGroups() throws AdminException
- Throws:
AdminException
-
getGroupMemberGroupIds
public String[] getGroupMemberGroupIds(String groupId) throws AdminException
- Throws:
AdminException
-
getGroupMemberGroupIds
public String[] getGroupMemberGroupIds(String domainId, String groupId) throws AdminException
- Throws:
AdminException
-
getAllRootGroups
public GroupDetail[] getAllRootGroups(String domainId) throws AdminException
- Throws:
AdminException
-
getAllGroupOfDomain
public List<GroupDetail> getAllGroupOfDomain(String domainId) throws AdminException
- Throws:
AdminException
-
indexAllGroups
public void indexAllGroups(String domainId) throws AdminException
Indexes all the groups of users of the specified user domain.- Parameters:
domainId
- the unique identifier of the user domain.- Throws:
AdminException
- if the indexation fails.
-
indexGroup
public void indexGroup(GroupDetail group)
Indexes the specified group of users.- Parameters:
group
- the group to index.
-
unindexGroup
public void unindexGroup(String groupId)
Unindex the specified group of users.- Parameters:
groupId
- the unique identifier of the group to unindex.
-
authenticate
public Map<String,String> authenticate(String sKey) throws AdminException
- Throws:
AdminException
-
authenticate
public Map<String,String> authenticate(String sKey, boolean removeKey) throws AdminException
- Throws:
AdminException
-
getAllDomains
public Domain[] getAllDomains() throws AdminException
- Throws:
AdminException
-
getDomainActions
public long getDomainActions(String domainId) throws AdminException
- Throws:
AdminException
-
getNextDomainId
public String getNextDomainId()
-
createDomain
public String createDomain(Domain theDomain) throws AdminException
- Throws:
AdminException
-
updateDomain
public String updateDomain(Domain theDomain) throws AdminException
- Throws:
AdminException
-
removeDomain
public void removeDomain(String domainId) throws AdminException
- Throws:
AdminException
-
getDomain
public Domain getDomain(String domainId) throws AdminException
- Throws:
AdminException
-
getDomainDriver
public DomainDriver getDomainDriver(String domainId) throws AdminException
- Throws:
AdminException
-
beginSynchronization
public void beginSynchronization(String domainId) throws AdminException
Called when Admin starts the synchronization on a particular Domain- Throws:
AdminException
-
endSynchronization
public String endSynchronization(String domainId, boolean cancelSynchro) throws AdminException
Called when Admin ends the synchronization- Parameters:
cancelSynchro
- true if the synchronization is cancelled, false if it ends normally- 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) throws AdminException
- Throws:
AdminException
-
-