Class ActiveDirectoryPrincipalReader
- java.lang.Object
-
- lumis.portal.principal.importprincipal.reader.ActiveDirectoryPrincipalReader
-
- All Implemented Interfaces:
IPrincipalReader
@StableMinor(version="14.0", sinceVersion="11.0") public class ActiveDirectoryPrincipalReader extends Object implements IPrincipalReader
Implementation of IPrincipalReader for Active Directory- Since:
- 4.0.8
- Version:
- $Revision: 24476 $ $Date: 2021-04-28 11:28:23 -0300 (Wed, 28 Apr 2021) $
-
-
Constructor Summary
Constructors Constructor Description ActiveDirectoryPrincipalReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
evaluateLoginExpression(String loginExpression, Attributes userAttributes)
Evaluates an expression for resolving the login to be used for an user.protected Collection<String>
getCustomUserAttributes()
Returns the custom attributes to be read for each user.protected String
getGroupShortId(Attributes groupAttributes)
Returns the shortId for the group with the given attributes.protected String
getUserPrimaryLogin(Attributes userAttributes)
Returns the primary login for the user with the given attributes.Map<String,String>
read(Node reader)
Read users and groups and return them in string format in entries named userList and groupList of the map returned.protected void
readGroup(StringBuilder sbGroup, SearchResult entry)
Read a group from aSearchResult
and stores the XML string in the givenStringBuilder
.protected String
readGroups()
Returns a XML string containing the groups read from AD.protected void
readGroups(StringBuilder sbGroup, LdapContext context, boolean recursive)
Reads the groups using the givenLdapContext
and stores the XML string in the givenStringBuilder
.protected void
readUser(StringBuilder sbUser, SearchResult entry)
Read a user from aSearchResult
and stores the XML string in the givenStringBuilder
.protected String
readUsers()
Returns a XML string containing the users read from AD.protected void
readUsers(StringBuilder sbUser, LdapContext context, boolean recursive)
Reads the users from ActiveDirectory using the givenLdapContext
and store the result XML string in the givenStringBuilder
.
-
-
-
Method Detail
-
read
public Map<String,String> read(Node reader) throws PortalException
Description copied from interface:IPrincipalReader
Read users and groups and return them in string format in entries named userList and groupList of the map returned.- Specified by:
read
in interfaceIPrincipalReader
- Returns:
- Throws:
PortalException
-
readUsers
protected String readUsers() throws PortalException
Returns a XML string containing the users read from AD.- Returns:
- a XML string containing the users read from AD.
- Throws:
PortalException
- Since:
- 8.2.0
-
readGroups
protected String readGroups() throws PortalException
Returns a XML string containing the groups read from AD.- Returns:
- a XML string containing the groups read from AD.
- Throws:
PortalException
- Since:
- 8.2.0
-
readUsers
protected void readUsers(StringBuilder sbUser, LdapContext context, boolean recursive) throws PortalException
Reads the users from ActiveDirectory using the givenLdapContext
and store the result XML string in the givenStringBuilder
. In the default implementation, this method is called byreadUsers()
.- Parameters:
sbUser
- theStringBuilder
that stores the users XML string.context
- theLdapContext
.- Throws:
PortalException
- Since:
- 8.2.0
-
readUser
protected void readUser(StringBuilder sbUser, SearchResult entry) throws NamingException
Read a user from aSearchResult
and stores the XML string in the givenStringBuilder
. In the default implementation, this method is called from#readUsers(StringBuilder, LdapContext)
.- Parameters:
sbUser
- theStringBuilder
.entry
- theSearchResult
.- Throws:
NamingException
- Since:
- 8.2.0
-
getCustomUserAttributes
protected Collection<String> getCustomUserAttributes()
Returns the custom attributes to be read for each user.- Returns:
- the custom attributes to be read for each user.
- Since:
- 8.2.0
-
getUserPrimaryLogin
protected String getUserPrimaryLogin(Attributes userAttributes) throws NamingException
Returns the primary login for the user with the given attributes.- Parameters:
userAttributes
- the user's attributes.- Returns:
- the primary login or null if the user has no login available.
- Throws:
NamingException
- Since:
- 4.0.11
-
evaluateLoginExpression
protected String evaluateLoginExpression(String loginExpression, Attributes userAttributes)
Evaluates an expression for resolving the login to be used for an user.- Parameters:
loginExpression
- the login expression.userAttributes
- the user's attributes.- Returns:
- the evaluated result.
- Since:
- 11.0.0
-
getGroupShortId
protected String getGroupShortId(Attributes groupAttributes) throws NamingException
Returns the shortId for the group with the given attributes.- Parameters:
groupAttributes
- the group's attributes.- Returns:
- the short id for the group.
- Throws:
NamingException
- Since:
- 11.0.0
-
readGroups
protected void readGroups(StringBuilder sbGroup, LdapContext context, boolean recursive) throws PortalException
Reads the groups using the givenLdapContext
and stores the XML string in the givenStringBuilder
. In the default implementation, this method is called byreadGroups()
.- Parameters:
sbGroup
- theStringBuilder
.context
- theLdapContext
.- Throws:
PortalException
- Since:
- 8.2.0
-
readGroup
protected void readGroup(StringBuilder sbGroup, SearchResult entry) throws NamingException
Read a group from aSearchResult
and stores the XML string in the givenStringBuilder
. In the default implementation, this method is called from#readGroups(StringBuilder, LdapContext)
.- Parameters:
sbUser
- theStringBuilder
.entry
- theSearchResult
.- Throws:
NamingException
- Since:
- 8.2.0
-
-