Package cz.metacentrum.perun.core.impl
Class ExtSourceLdap
java.lang.Object
cz.metacentrum.perun.core.api.PerunBean
cz.metacentrum.perun.core.api.Auditable
cz.metacentrum.perun.core.api.ExtSource
cz.metacentrum.perun.core.impl.ExtSourceImpl
cz.metacentrum.perun.core.impl.ExtSourceLdap
- All Implemented Interfaces:
ExtSourceApi,ExtSourceSimpleApi,Serializable,Comparable<PerunBean>
- Direct Known Subclasses:
ExtSourceEGISSO
Ext source implementation for LDAP.
- Author:
- Michal Prochazka michalp@ics.muni.cz, Pavel Zlámal invalid input: '<'zlamal@cesnet.cz>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DirContextprotected Stringprotected static final org.slf4j.LoggerFields inherited from class cz.metacentrum.perun.core.impl.ExtSourceImpl
perunBl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()If extSource needs to be closed, this method must be called.findSubjects(String searchString) Finds all subjects with attributes in the external source, that contains searchString.findSubjects(String searchString, int maxResults) Finds all subjects with attributes in the external source, that contains searchString limited by the maxResultsfindSubjectsLogins(String searchString) Finds all subjects logins in the external source, that contains searchString.findSubjectsLogins(String searchString, int maxResults) Finds all subjects logins in the external source, that contains searchString, limited by the maxResults.protected DirContextgetGroupSubjects(Map<String, String> attributes) Get the list of the subjects in the external group.protected StringgetLdapAttributeValue(Attributes attributes, String ldapAttrNameRaw) getSubjectAttributes(Attributes attributes) getSubjectByLogin(String login) Finds subject from the external source by the primary login used in external source.getSubjectGroups(Map<String, String> attributes) Get the list of the subject groups in the external source.Get the list of subjects from the external source.protected voidquerySource(String query, String base, int maxResults) Query LDAP using query in defined base.Methods inherited from class cz.metacentrum.perun.core.impl.ExtSourceImpl
getAttributesMethods inherited from class cz.metacentrum.perun.core.api.ExtSource
compareTo, equals, getBeanName, getName, getType, hashCode, serializeToString, setName, setType, toStringMethods inherited from class cz.metacentrum.perun.core.api.Auditable
getCreatedAt, getCreatedBy, getCreatedByUid, getModifiedAt, getModifiedBy, getModifiedByUid, setCreatedAt, setCreatedBy, setCreatedByUid, setModifiedAt, setModifiedBy, setModifiedByUid
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
mapping
-
dirContext
-
filteredQuery
-
-
Constructor Details
-
ExtSourceLdap
public ExtSourceLdap()
-
-
Method Details
-
close
public void close()Description copied from interface:ExtSourceSimpleApiIf extSource needs to be closed, this method must be called.- Specified by:
closein interfaceExtSourceSimpleApi
-
findSubjects
Description copied from interface:ExtSourceApiFinds all subjects with attributes in the external source, that contains searchString.This method is used for getting all logins of subjects in external source with all possible attributes.
- Specified by:
findSubjectsin interfaceExtSourceApi- Parameters:
searchString-- Returns:
- list of maps, which contains attr_name->attr_value (for all extSource attributes)
-
findSubjects
Description copied from interface:ExtSourceApiFinds all subjects with attributes in the external source, that contains searchString limited by the maxResultsThis method is used for getting all logins of subjects in external source with all possible attributes.
- Specified by:
findSubjectsin interfaceExtSourceApi- Parameters:
searchString-maxResults- define max number of returned results, 0 means unlimited- Returns:
- list of maps, which contains attr_name->attr_value (for all extSource attributes)
-
findSubjectsLogins
Description copied from interface:ExtSourceSimpleApiFinds all subjects logins in the external source, that contains searchString, limited by the maxResults.This method is used for getting all logins of subjects in external source and then use them to searching in external source for other subjects attributes
- Specified by:
findSubjectsLoginsin interfaceExtSourceSimpleApi- Parameters:
searchString-maxResults- limit returned results- Returns:
- list of maps, which contains attr_name->attr_value but only for login definition eg. login;MichalS
-
findSubjectsLogins
Description copied from interface:ExtSourceSimpleApiFinds all subjects logins in the external source, that contains searchString.This method is used for getting all logins of subjects in external source and then use them to searching in external source for other subjects attributes.
- Specified by:
findSubjectsLoginsin interfaceExtSourceSimpleApi- Parameters:
searchString-- Returns:
- list of maps, which contains attr_name->attr_value but only for login definition eg. login;MichalS
-
getContext
-
getGroupSubjects
Description copied from interface:ExtSourceSimpleApiGet the list of the subjects in the external group.- Specified by:
getGroupSubjectsin interfaceExtSourceSimpleApi- Parameters:
attributes- map of attributes used for quering the external source- Returns:
- list of maps, which contains attr_name->attr_value, e.g. firstName->Michal
-
getLdapAttributeValue
-
getSubjectAttributes
-
getSubjectByLogin
Description copied from interface:ExtSourceSimpleApiFinds subject from the external source by the primary login used in external source.- Specified by:
getSubjectByLoginin interfaceExtSourceSimpleApi- Parameters:
login- login used in the external source- Returns:
- map which contains attr_name -> attr_value, e.g. firstName->Michal
- Throws:
SubjectNotExistsException- if the subject cannot be found
-
getSubjectGroups
public List<Map<String,String>> getSubjectGroups(Map<String, String> attributes) throws ExtSourceUnsupportedOperationExceptionDescription copied from interface:ExtSourceSimpleApiGet the list of the subject groups in the external source.- Specified by:
getSubjectGroupsin interfaceExtSourceSimpleApi- Parameters:
attributes- map of attributes used for quering the external source- Returns:
- list of maps, which contains attr name and attr value
- Throws:
ExtSourceUnsupportedOperationException
-
getUsersSubjects
Description copied from interface:ExtSourceSimpleApiGet the list of subjects from the external source.- Specified by:
getUsersSubjectsin interfaceExtSourceSimpleApi- Returns:
- list of maps, which contains attr_name->attr_value, e.g. firstName->Michal
-
initContext
protected void initContext() -
querySource
Query LDAP using query in defined base. Results can be limited to the maxResults.- Parameters:
query-base-maxResults-- Returns:
- List of Map of the LDAP attribute names and theirs values
- Throws:
InternalErrorException
-