Package cz.metacentrum.perun.core.blImpl
Class ExtSourcesManagerBlImpl
java.lang.Object
cz.metacentrum.perun.core.blImpl.ExtSourcesManagerBlImpl
- All Implemented Interfaces:
- ExtSourcesManagerBl
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddExtSource(PerunSession sess, Group group, ExtSource source) Associate external source definition with the GROUP.voidaddExtSource(PerunSession sess, Vo vo, ExtSource source) Associate external source definition with the VO.voidaddExtSources(PerunSession perunSession, Group group, List<ExtSource> sources) Associate external source definitions with the GROUP.voidaddExtSources(PerunSession perunSession, Vo vo, List<ExtSource> sources) Associate external source definitions with the VO.voidcheckExtSourceAssignedToVo(PerunSession sess, ExtSource extSource, int voId) Check if extSource is assigned to vo or not.voidcheckExtSourceExists(PerunSession sess, ExtSource extSource) checkOrCreateExtSource(PerunSession sess, String extSourceName, String extSourceType) Checks whether the ExtSource exists, if not, then the ExtSource is created.createExtSource(PerunSession sess, ExtSource extSource, Map<String, String> attributes) Creates an external source.voiddeleteExtSource(PerunSession sess, ExtSource extSource) Deletes an external source.voiddestroy()Destroy manager.generateCandidateGroup(PerunSession perunSession, Map<String, String> groupSubjectData, ExtSource source, String loginPrefix) Generate a candidate group from a group subject data.generateCandidateGroups(PerunSession perunSession, List<Map<String, String>> subjectsData, ExtSource source, String loginPrefix) Generate candidate groups from a group subject data.getAttributes(ExtSource extSource) Gets attributes for external source.getCandidate(PerunSession sess, ExtSource source, String login) Get the candidate from the ExtSource.getCandidate(PerunSession perunSession, Map<String, String> subjectData, ExtSource source, String login) Get the candidate from subjectData where at least login must exists.getDataSource(String poolName) Returns a database connection pool.getExtSourceById(PerunSession sess, int id) Searches for the external source with specified id.getExtSourceByName(PerunSession sess, String name) Searches for the external source using specified name.getExtSources(PerunSession sess) Get list of all external sources.Gets the extSourcesManagerImpl for this instance.getGroupExtSources(PerunSession sess, Group group) Get list of external sources associated with the GROUP.getInvalidUsers(PerunSession sess, ExtSource source) Returns list of users stored by this ExtSource, which are not valid.getVoExtSources(PerunSession sess, Vo vo) Get list of external sources associated with the VO.voidinitialize(PerunSession sess) Initialize manager.voidLoads ext source definitions from the configuration file and updates entries stored in the DB.voidremoveExtSource(PerunSession sess, Group group, ExtSource source) Remove association of the external source from the GROUP.voidremoveExtSource(PerunSession sess, Vo vo, ExtSource source) Remove association of the external source from the VO.voidremoveExtSources(PerunSession sess, Group group, List<ExtSource> sources) Remove associations of external sources from the GROUP.voidremoveExtSources(PerunSession sess, Vo vo, List<ExtSource> sources) Remove associations of external sources from the VO.voidsetPerunBl(PerunBl perunBl) 
- 
Constructor Details- 
ExtSourcesManagerBlImpl
 
- 
- 
Method Details- 
addExtSourcepublic void addExtSource(PerunSession sess, Vo vo, ExtSource source) throws ExtSourceAlreadyAssignedException Description copied from interface:ExtSourcesManagerBlAssociate external source definition with the VO.- Specified by:
- addExtSourcein interface- ExtSourcesManagerBl
- Parameters:
- sess-
- vo-
- source-
- Throws:
- ExtSourceAlreadyAssignedException
 
- 
addExtSourcepublic void addExtSource(PerunSession sess, Group group, ExtSource source) throws ExtSourceAlreadyAssignedException Description copied from interface:ExtSourcesManagerBlAssociate external source definition with the GROUP.- Specified by:
- addExtSourcein interface- ExtSourcesManagerBl
- Parameters:
- sess-
- group-
- source-
- Throws:
- ExtSourceAlreadyAssignedException
 
- 
addExtSourcespublic void addExtSources(PerunSession perunSession, Vo vo, List<ExtSource> sources) throws ExtSourceAlreadyAssignedException Description copied from interface:ExtSourcesManagerBlAssociate external source definitions with the VO.- Specified by:
- addExtSourcesin interface- ExtSourcesManagerBl
- Parameters:
- perunSession- sess
- vo- vo
- sources- list of sources to associate
- Throws:
- ExtSourceAlreadyAssignedException
 
- 
addExtSourcespublic void addExtSources(PerunSession perunSession, Group group, List<ExtSource> sources) throws ExtSourceAlreadyAssignedException Description copied from interface:ExtSourcesManagerBlAssociate external source definitions with the GROUP.- Specified by:
- addExtSourcesin interface- ExtSourcesManagerBl
- Parameters:
- perunSession- sess
- group- group
- sources- list of sources to associate
- Throws:
- ExtSourceAlreadyAssignedException
 
- 
checkExtSourceAssignedToVopublic void checkExtSourceAssignedToVo(PerunSession sess, ExtSource extSource, int voId) throws ExtSourceNotAssignedException, VoNotExistsException Description copied from interface:ExtSourcesManagerBlCheck if extSource is assigned to vo or not. Throw exception if not.- Specified by:
- checkExtSourceAssignedToVoin interface- ExtSourcesManagerBl
- Parameters:
- sess-
- extSource-
- voId-
- Throws:
- ExtSourceNotAssignedException
- VoNotExistsException
 
- 
checkExtSourceExistspublic void checkExtSourceExists(PerunSession sess, ExtSource extSource) throws InternalErrorException, ExtSourceNotExistsException - Specified by:
- checkExtSourceExistsin interface- ExtSourcesManagerBl
- Throws:
- InternalErrorException
- ExtSourceNotExistsException
 
- 
checkOrCreateExtSourcepublic ExtSource checkOrCreateExtSource(PerunSession sess, String extSourceName, String extSourceType) Description copied from interface:ExtSourcesManagerBlChecks whether the ExtSource exists, if not, then the ExtSource is created.- Specified by:
- checkOrCreateExtSourcein interface- ExtSourcesManagerBl
- Parameters:
- sess-
- extSourceName-
- extSourceType-
- Returns:
- existing or newly created extSource is returned
 
- 
createExtSourcepublic ExtSource createExtSource(PerunSession sess, ExtSource extSource, Map<String, String> attributes) throws ExtSourceExistsExceptionDescription copied from interface:ExtSourcesManagerBlCreates an external source.- Specified by:
- createExtSourcein interface- ExtSourcesManagerBl
- Parameters:
- sess-
- extSource-
- attributes-
- Returns:
- ExtSource object with newly associated ID.
- Throws:
- ExtSourceExistsException
 
- 
deleteExtSourcepublic void deleteExtSource(PerunSession sess, ExtSource extSource) throws ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerBlDeletes an external source.- Specified by:
- deleteExtSourcein interface- ExtSourcesManagerBl
- Parameters:
- sess-
- extSource-
- Throws:
- ExtSourceAlreadyRemovedException- if there are 0 rows affected by delete in DB
 
- 
destroypublic void destroy()Description copied from interface:ExtSourcesManagerBlDestroy manager. Clean resources.- Specified by:
- destroyin interface- ExtSourcesManagerBl
 
- 
generateCandidateGrouppublic CandidateGroup generateCandidateGroup(PerunSession perunSession, Map<String, String> groupSubjectData, ExtSource source, String loginPrefix) Description copied from interface:ExtSourcesManagerBlGenerate a candidate group from a group subject data.IMPORTANT: expected, that these subjectData was get from the ExtSource before using. - Specified by:
- generateCandidateGroupin interface- ExtSourcesManagerBl
- Parameters:
- perunSession-
- groupSubjectData-
- source-
- loginPrefix- login prefix to change group login and parent group login by it
- Returns:
- Candidate group object
 
- 
generateCandidateGroupspublic List<CandidateGroup> generateCandidateGroups(PerunSession perunSession, List<Map<String, String>> subjectsData, ExtSource source, String loginPrefix) Description copied from interface:ExtSourcesManagerBlGenerate candidate groups from a group subject data.IMPORTANT: expected, that these subjectData was get from the ExtSource before using. - Specified by:
- generateCandidateGroupsin interface- ExtSourcesManagerBl
- Parameters:
- perunSession-
- subjectsData-
- source-
- loginPrefix- login prefix to change group login and parent group login by it
- Returns:
- Candidate group objects
 
- 
getAttributesDescription copied from interface:ExtSourcesManagerBlGets attributes for external source.- Specified by:
- getAttributesin interface- ExtSourcesManagerBl
- Parameters:
- extSource- External Source
- Returns:
- Map of attributes for external source
 
- 
getCandidatepublic CandidateSync getCandidate(PerunSession sess, ExtSource source, String login) throws CandidateNotExistsException, ExtSourceUnsupportedOperationException Description copied from interface:ExtSourcesManagerBlGet the candidate from the ExtSource. Login of the candidate will be used to gain data from the ExtSource.- Specified by:
- getCandidatein interface- ExtSourcesManagerBl
- Parameters:
- sess- Perun session
- source- External source which will be used to get data about the candidate
- login- Login of the candidate
- Returns:
- a Candidate object
- Throws:
- CandidateNotExistsException
- ExtSourceUnsupportedOperationException
 
- 
getCandidatepublic CandidateSync getCandidate(PerunSession perunSession, Map<String, String> subjectData, ExtSource source, String login) Description copied from interface:ExtSourcesManagerBlGet the candidate from subjectData where at least login must exists.IMPORTANT: expected, that these subjectData was get from the ExtSource before using. - Specified by:
- getCandidatein interface- ExtSourcesManagerBl
- Parameters:
- perunSession- Perun session
- subjectData-
- source- External source which will be used to get data about the candidate
- login- Login of the candidate
- Returns:
- a Candidate object
 
- 
getDataSourceDescription copied from interface:ExtSourcesManagerBlReturns a database connection pool.- Specified by:
- getDataSourcein interface- ExtSourcesManagerBl
- Parameters:
- poolName- named defined in perun-extSources.xml
- Returns:
- database connection pool
 
- 
getExtSourceByIdpublic ExtSource getExtSourceById(PerunSession sess, int id) throws InternalErrorException, ExtSourceNotExistsException Description copied from interface:ExtSourcesManagerBlSearches for the external source with specified id.- Specified by:
- getExtSourceByIdin interface- ExtSourcesManagerBl
- Parameters:
- sess-
- id-
- Returns:
- External source with specified id
- Throws:
- InternalErrorException
- ExtSourceNotExistsException
 
- 
getExtSourceByNamepublic ExtSource getExtSourceByName(PerunSession sess, String name) throws InternalErrorException, ExtSourceNotExistsException Description copied from interface:ExtSourcesManagerBlSearches for the external source using specified name.- Specified by:
- getExtSourceByNamein interface- ExtSourcesManagerBl
- Parameters:
- sess-
- name-
- Returns:
- External source with specified name
- Throws:
- InternalErrorException
- ExtSourceNotExistsException
 
- 
getExtSourcesDescription copied from interface:ExtSourcesManagerBlGet list of all external sources.- Specified by:
- getExtSourcesin interface- ExtSourcesManagerBl
- Parameters:
- sess-
- Returns:
- list of external source
- Throws:
- InternalErrorException
 
- 
getExtSourcesManagerImplGets the extSourcesManagerImpl for this instance.- Returns:
- extSourceManagerImpl
 
- 
getGroupExtSourcespublic List<ExtSource> getGroupExtSources(PerunSession sess, Group group) throws InternalErrorException Description copied from interface:ExtSourcesManagerBlGet list of external sources associated with the GROUP.- Specified by:
- getGroupExtSourcesin interface- ExtSourcesManagerBl
- Parameters:
- sess-
- group-
- Returns:
- list of external sources associated with the VO
- Throws:
- InternalErrorException
 
- 
getInvalidUsersDescription copied from interface:ExtSourcesManagerBlReturns list of users stored by this ExtSource, which are not valid.- Specified by:
- getInvalidUsersin interface- ExtSourcesManagerBl
- Parameters:
- sess-
- source-
- Returns:
- list of users, who is not in the extSource anymore
 
- 
getPerunBl
- 
getVoExtSourcesDescription copied from interface:ExtSourcesManagerBlGet list of external sources associated with the VO.- Specified by:
- getVoExtSourcesin interface- ExtSourcesManagerBl
- Parameters:
- sess-
- vo-
- Returns:
- list of external sources associated with the VO
- Throws:
- InternalErrorException
 
- 
initializeDescription copied from interface:ExtSourcesManagerBlInitialize manager.- Specified by:
- initializein interface- ExtSourcesManagerBl
 
- 
loadExtSourcesDefinitionsDescription copied from interface:ExtSourcesManagerBlLoads ext source definitions from the configuration file and updates entries stored in the DB.- Specified by:
- loadExtSourcesDefinitionsin interface- ExtSourcesManagerBl
- Parameters:
- sess-
 
- 
removeExtSourcepublic void removeExtSource(PerunSession sess, Vo vo, ExtSource source) throws ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerBlRemove association of the external source from the VO.- Specified by:
- removeExtSourcein interface- ExtSourcesManagerBl
- Parameters:
- sess-
- vo-
- source-
- Throws:
- ExtSourceNotAssignedException
- ExtSourceAlreadyRemovedException- if there are 0 rows affected by delete from DB
 
- 
removeExtSourcepublic void removeExtSource(PerunSession sess, Group group, ExtSource source) throws ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerBlRemove association of the external source from the GROUP.- Specified by:
- removeExtSourcein interface- ExtSourcesManagerBl
- Parameters:
- sess-
- group-
- source-
- Throws:
- ExtSourceNotAssignedException
- ExtSourceAlreadyRemovedException- when 0 rows affected by removing from DB
 
- 
removeExtSourcespublic void removeExtSources(PerunSession sess, Vo vo, List<ExtSource> sources) throws ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerBlRemove associations of external sources from the VO.- Specified by:
- removeExtSourcesin interface- ExtSourcesManagerBl
- Parameters:
- sess-
- vo-
- sources-
- Throws:
- ExtSourceNotAssignedException
- ExtSourceAlreadyRemovedException- when 0 rows affected by removing from DB
 
- 
removeExtSourcespublic void removeExtSources(PerunSession sess, Group group, List<ExtSource> sources) throws ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerBlRemove associations of external sources from the GROUP.- Specified by:
- removeExtSourcesin interface- ExtSourcesManagerBl
- Parameters:
- sess-
- group-
- sources-
- Throws:
- ExtSourceNotAssignedException
- ExtSourceAlreadyRemovedException- when 0 rows affected by removing from DB
 
- 
setPerunBl
 
-