Package org.imixs.workflow.ldap
Class LDAPLookupService
java.lang.Object
org.imixs.workflow.ldap.LDAPLookupService
This EJB provides a ldap lookup service for user informations
The bean reads its configuration from the configuration property file located
in the glassfish domains config folder
(GLASSFISH_DOMAIN/config/imixs-office-ldap.properties).
IMPORTANT!
The LDAPLookupService can not use the EJB PropertyService because of the
PropertyInterceptor Class which will lead into a endless loop between
LDAPGroupInterceptor and PropertyInterceptor !!!
For that reason the proertyService is used manually here!!
- Version:
- 1.0
- Author:
- rsoika
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method is used to put a user object into the cache.String[]findGroups(String aUID) Returns a string array containing all group names for a given UID.org.imixs.workflow.ItemCollectionReturns the ldap attributes for a given user.org.imixs.workflow.ItemCollectionReturns the ldap attributes for a given user.booleanorg.imixs.workflow.ItemCollectionlookupLdapAttributes(String aUID) Returns all attributes for a given user in an ItemCollection.voidonEvent(org.imixs.marty.profile.ProfileEvent event) This method reacts on CDI events of the type ProfileEvent and lookups the profile data in the ldap directoryList<org.imixs.workflow.ItemCollection>searchUserList(String searchPhrase) Returns a list of user entries form the ldap based on a search phrasevoidsetDnSearchFilter(String dnSearchFilter) voidsetGroupSearchFilter(String groupSearchFilter) voidsetSearchContext(String searchContext) voidsetSearchFilterPhrase(String searchFilterPhrase) voidupdateProfileLDAPData(String userID, org.imixs.workflow.ItemCollection profile) This method updates a profile with ldap data.
-
Field Details
-
MAX_RESULT
public static final int MAX_RESULT- See Also:
-
TIME_LIMIT
public static final int TIME_LIMIT- See Also:
-
LDAP_SEARCH_CONTEXT
- See Also:
-
LDAP_SEARCH_FILTER_DN
- See Also:
-
LDAP_SEARCH_FILTER_GROUP
- See Also:
-
LDAP_SEARCH_FILTER_PHRASE
- See Also:
-
LDAP_USER_ATTRIBUTES
- See Also:
-
ldapProfileEvents
-
-
Constructor Details
-
LDAPLookupService
public LDAPLookupService()
-
-
Method Details
-
getDnSearchFilter
-
setDnSearchFilter
-
getSearchFilterPhrase
-
setSearchFilterPhrase
-
getGroupSearchFilter
-
setGroupSearchFilter
-
getSearchContext
-
setSearchContext
-
isEnabled
public boolean isEnabled() -
findUser
Returns the ldap attributes for a given user. If no user was found in LDAP the method returns null. The method uses an internal cache.- Parameters:
aUID- - user id- Returns:
- ItemCollection containing the user attributes or null if no attributes where found.
-
findUser
Returns the ldap attributes for a given user. If no user was found in LDAP the method returns null.If the boolean 'refresh' is true the method lookup the user in any case with a search query and updates the cache.
- Parameters:
aUID- - user idrefresh- - if true, cache will be refreshed.- Returns:
- ItemCollection containing the user attributes or null if no attributes where found.
-
cacheUser
This method is used to put a user object into the cache. The method can be called form a external service interface.- Parameters:
aUID- - useriduser- - user profile
-
searchUserList
Returns a list of user entries form the ldap based on a search phrase- Parameters:
searchPhrase- - search Phrase- Returns:
- ItemCollection containing the user attributes or null if no attributes where found.
-
findGroups
Returns a string array containing all group names for a given UID. If no groups exist or the uid was not found the method returns an empty string array!.- Parameters:
aUID- - user unique id- Returns:
- string array of group names
-
lookupLdapAttributes
Returns all attributes for a given user in an ItemCollection. If ldap service is disabled or the user was not found then the method returns null.The method makes a direct ldap lookup. No cache is used.
It is recommended to use the method findUser instead of the method lookupLdapAttributes to use the internal caching mechanism.
- Parameters:
aUID- - user id- Returns:
- ItemCollection - containing the user attributes or null if no entry was found
-
onEvent
public void onEvent(@Observes org.imixs.marty.profile.ProfileEvent event) This method reacts on CDI events of the type ProfileEvent and lookups the profile data in the ldap directory -
updateProfileLDAPData
This method updates a profile with ldap data.
-