Package cz.metacentrum.perun.core.impl
Class ExtSourceSql
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.ExtSourceSql
- All Implemented Interfaces:
ExtSourceSimpleApi
,Serializable
,Comparable<PerunBean>
- Direct Known Subclasses:
ExtSourceSqlComplex
- Author:
- Michal Prochazka michalp@ics.muni.cz
- See Also:
-
Field Summary
Fields inherited from class cz.metacentrum.perun.core.impl.ExtSourceImpl
perunBl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
If extSource needs to be closed, this method must be called.findSubjectsLogins
(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 DataSource
getGroupSubjects
(Map<String, String> groupAttributes) Get the list of the subjects in the external group.getSubjectByLogin
(String login) Finds subject from the external source by the primary login used in external source.getSubjectGroups
(Map<String, String> groupAttributes) Get the list of the subject groups in the external source.Get the list of subjects from the external source.groupQuery
(String query) Get subject groups from an external sourcequerySource
(String query, String searchString, int maxResults) Methods inherited from class cz.metacentrum.perun.core.impl.ExtSourceImpl
getAttributes
Methods inherited from class cz.metacentrum.perun.core.api.ExtSource
compareTo, equals, getBeanName, getName, getType, hashCode, serializeToString, setName, setType, toString
Methods inherited from class cz.metacentrum.perun.core.api.Auditable
getCreatedAt, getCreatedBy, getCreatedByUid, getModifiedAt, getModifiedBy, getModifiedByUid, setCreatedAt, setCreatedBy, setCreatedByUid, setModifiedAt, setModifiedBy, setModifiedByUid
-
Field Details
-
DBPOOL
- See Also:
-
USER
- See Also:
-
URL
- See Also:
-
-
Constructor Details
-
ExtSourceSql
public ExtSourceSql()
-
-
Method Details
-
close
public void close()Description copied from interface:ExtSourceSimpleApi
If extSource needs to be closed, this method must be called.- Specified by:
close
in interfaceExtSourceSimpleApi
-
findSubjectsLogins
Description copied from interface:ExtSourceSimpleApi
Finds 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:
findSubjectsLogins
in 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:ExtSourceSimpleApi
Finds 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:
findSubjectsLogins
in interfaceExtSourceSimpleApi
- Parameters:
searchString
-- Returns:
- list of maps, which contains attr_name->attr_value but only for login definition eg. login;MichalS
-
getDataSource
-
getGroupSubjects
public List<Map<String,String>> getGroupSubjects(Map<String, String> groupAttributes) throws InternalErrorExceptionDescription copied from interface:ExtSourceSimpleApi
Get the list of the subjects in the external group.- Specified by:
getGroupSubjects
in interfaceExtSourceSimpleApi
- Parameters:
groupAttributes
- map of attributes used for quering the external source- Returns:
- list of maps, which contains attr_name->attr_value, e.g. firstName->Michal
- Throws:
InternalErrorException
-
getSubjectByLogin
Description copied from interface:ExtSourceSimpleApi
Finds subject from the external source by the primary login used in external source.- Specified by:
getSubjectByLogin
in 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> groupAttributes) throws InternalErrorException, ExtSourceUnsupportedOperationExceptionDescription copied from interface:ExtSourceSimpleApi
Get the list of the subject groups in the external source.- Specified by:
getSubjectGroups
in interfaceExtSourceSimpleApi
- Parameters:
groupAttributes
- map of attributes used for quering the external source- Returns:
- list of maps, which contains attr name and attr value
- Throws:
InternalErrorException
ExtSourceUnsupportedOperationException
-
getUsersSubjects
public List<Map<String,String>> getUsersSubjects() throws InternalErrorException, ExtSourceUnsupportedOperationExceptionDescription copied from interface:ExtSourceSimpleApi
Get the list of subjects from the external source.- Specified by:
getUsersSubjects
in interfaceExtSourceSimpleApi
- Returns:
- list of maps, which contains attr_name->attr_value, e.g. firstName->Michal
- Throws:
InternalErrorException
ExtSourceUnsupportedOperationException
-
groupQuery
Get subject groups from an external source- Parameters:
query
- to select subject groups- Returns:
- list of subjects
-
querySource
protected List<Map<String,String>> querySource(String query, String searchString, int maxResults) throws InternalErrorException - Throws:
InternalErrorException
-