Package cz.metacentrum.perun.core.bl
Interface ExtSourcesManagerBl
- All Known Implementing Classes:
ExtSourcesManagerBlImpl
public interface ExtSourcesManagerBl
- Author:
- Michal Prochazka invalid input: '<'michalp@ics.muni.cz>
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtSource(PerunSession perunSession, Group group, ExtSource source) Associate external source definition with the GROUP.voidaddExtSource(PerunSession perunSession, 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 perunSession, String extSourceName, String extSourceType) Checks whether the ExtSource exists, if not, then the ExtSource is created.createExtSource(PerunSession perunSession, ExtSource extSource, Map<String, String> attributes) Creates an external source.voiddeleteExtSource(PerunSession perunSession, 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>> groupSubjectsData, ExtSource source, String loginPrefix) Generate candidate groups from a group subject data.getAttributes(ExtSource extSource) Gets attributes for external source.getCandidate(PerunSession perunSession, 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 perunSession, int id) Searches for the external source with specified id.getExtSourceByName(PerunSession perunSession, String name) Searches for the external source using specified name.getExtSources(PerunSession perunSession) Get list of all external sources.getGroupExtSources(PerunSession perunSession, Group group) Get list of external sources associated with the GROUP.getInvalidUsers(PerunSession perunSession, ExtSource source) Returns list of users stored by this ExtSource, which are not valid.getVoExtSources(PerunSession perunSession, 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 perunSession, Group group, ExtSource source) Remove association of the external source from the GROUP.voidremoveExtSource(PerunSession perunSession, Vo vo, ExtSource source) Remove association of the external source from the VO.voidremoveExtSources(PerunSession perunSession, Group group, List<ExtSource> sources) Remove associations of external sources from the GROUP.voidremoveExtSources(PerunSession perunSession, Vo vo, List<ExtSource> sources) Remove associations of external sources from the VO.
-
Method Details
-
addExtSource
void addExtSource(PerunSession perunSession, Vo vo, ExtSource source) throws ExtSourceAlreadyAssignedException Associate external source definition with the VO.- Parameters:
perunSession-vo-source-- Throws:
InternalErrorExceptionExtSourceAlreadyAssignedException
-
addExtSource
void addExtSource(PerunSession perunSession, Group group, ExtSource source) throws ExtSourceAlreadyAssignedException Associate external source definition with the GROUP.- Parameters:
perunSession-group-source-- Throws:
InternalErrorExceptionExtSourceAlreadyAssignedException
-
addExtSources
void addExtSources(PerunSession perunSession, Vo vo, List<ExtSource> sources) throws ExtSourceAlreadyAssignedException Associate external source definitions with the VO.- Parameters:
perunSession- sessvo- vosources- list of sources to associate- Throws:
ExtSourceAlreadyAssignedException
-
addExtSources
void addExtSources(PerunSession perunSession, Group group, List<ExtSource> sources) throws ExtSourceAlreadyAssignedException Associate external source definitions with the GROUP.- Parameters:
perunSession- sessgroup- groupsources- list of sources to associate- Throws:
ExtSourceAlreadyAssignedException
-
checkExtSourceAssignedToVo
void checkExtSourceAssignedToVo(PerunSession sess, ExtSource extSource, int voId) throws ExtSourceNotAssignedException, VoNotExistsException Check if extSource is assigned to vo or not. Throw exception if not.- Parameters:
sess-extSource-voId-- Throws:
InternalErrorExceptionExtSourceNotAssignedExceptionVoNotExistsException
-
checkExtSourceExists
void checkExtSourceExists(PerunSession sess, ExtSource extSource) throws ExtSourceNotExistsException - Throws:
ExtSourceNotExistsException
-
checkOrCreateExtSource
ExtSource checkOrCreateExtSource(PerunSession perunSession, String extSourceName, String extSourceType) Checks whether the ExtSource exists, if not, then the ExtSource is created.- Parameters:
perunSession-extSourceName-extSourceType-- Returns:
- existing or newly created extSource is returned
- Throws:
InternalErrorException
-
createExtSource
ExtSource createExtSource(PerunSession perunSession, ExtSource extSource, Map<String, String> attributes) throws ExtSourceExistsExceptionCreates an external source.- Parameters:
perunSession-extSource-attributes-- Returns:
- ExtSource object with newly associated ID.
- Throws:
InternalErrorExceptionExtSourceExistsException
-
deleteExtSource
void deleteExtSource(PerunSession perunSession, ExtSource extSource) throws ExtSourceAlreadyRemovedException Deletes an external source.- Parameters:
perunSession-extSource-- Throws:
InternalErrorExceptionExtSourceAlreadyRemovedException- if there are 0 rows affected by delete in DB
-
destroy
void destroy()Destroy manager. Clean resources. -
generateCandidateGroup
CandidateGroup generateCandidateGroup(PerunSession perunSession, Map<String, String> groupSubjectData, ExtSource source, String loginPrefix) Generate a candidate group from a group subject data.IMPORTANT: expected, that these subjectData was get from the ExtSource before using.
- Parameters:
perunSession-groupSubjectData-source-loginPrefix- login prefix to change group login and parent group login by it- Returns:
- Candidate group object
- Throws:
InternalErrorException
-
generateCandidateGroups
List<CandidateGroup> generateCandidateGroups(PerunSession perunSession, List<Map<String, String>> groupSubjectsData, ExtSource source, String loginPrefix) Generate candidate groups from a group subject data.IMPORTANT: expected, that these subjectData was get from the ExtSource before using.
- Parameters:
perunSession-groupSubjectsData-source-loginPrefix- login prefix to change group login and parent group login by it- Returns:
- Candidate group objects
- Throws:
InternalErrorException
-
getAttributes
Gets attributes for external source.- Parameters:
extSource- External Source- Returns:
- Map of attributes for external source
- Throws:
InternalErrorException
-
getCandidate
CandidateSync getCandidate(PerunSession perunSession, ExtSource source, String login) throws CandidateNotExistsException, ExtSourceUnsupportedOperationException Get the candidate from the ExtSource. Login of the candidate will be used to gain data from the ExtSource.- Parameters:
perunSession- Perun sessionsource- External source which will be used to get data about the candidatelogin- Login of the candidate- Returns:
- a Candidate object
- Throws:
InternalErrorExceptionCandidateNotExistsExceptionExtSourceUnsupportedOperationException
-
getCandidate
CandidateSync getCandidate(PerunSession perunSession, Map<String, String> subjectData, ExtSource source, String login) Get the candidate from subjectData where at least login must exists.IMPORTANT: expected, that these subjectData was get from the ExtSource before using.
- Parameters:
perunSession- Perun sessionsubjectData-source- External source which will be used to get data about the candidatelogin- Login of the candidate- Returns:
- a Candidate object
- Throws:
InternalErrorException
-
getDataSource
Returns a database connection pool.- Parameters:
poolName- named defined in perun-extSources.xml- Returns:
- database connection pool
-
getExtSourceById
Searches for the external source with specified id.- Parameters:
perunSession-id-- Returns:
- External source with specified id
- Throws:
InternalErrorExceptionExtSourceNotExistsException
-
getExtSourceByName
ExtSource getExtSourceByName(PerunSession perunSession, String name) throws ExtSourceNotExistsException Searches for the external source using specified name.- Parameters:
perunSession-name-- Returns:
- External source with specified name
- Throws:
InternalErrorExceptionExtSourceNotExistsException
-
getExtSources
Get list of all external sources.- Parameters:
perunSession-- Returns:
- list of external source
- Throws:
InternalErrorException
-
getGroupExtSources
Get list of external sources associated with the GROUP.- Parameters:
perunSession-group-- Returns:
- list of external sources associated with the VO
- Throws:
InternalErrorException
-
getInvalidUsers
Returns list of users stored by this ExtSource, which are not valid.- Parameters:
perunSession-source-- Returns:
- list of users, who is not in the extSource anymore
- Throws:
InternalErrorException
-
getVoExtSources
Get list of external sources associated with the VO.- Parameters:
perunSession-vo-- Returns:
- list of external sources associated with the VO
- Throws:
InternalErrorException
-
initialize
Initialize manager. -
loadExtSourcesDefinitions
Loads ext source definitions from the configuration file and updates entries stored in the DB.- Parameters:
sess-
-
removeExtSource
void removeExtSource(PerunSession perunSession, Vo vo, ExtSource source) throws ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Remove association of the external source from the VO.- Parameters:
perunSession-vo-source-- Throws:
InternalErrorExceptionExtSourceNotAssignedExceptionExtSourceAlreadyRemovedException- if there are 0 rows affected by delete from DB
-
removeExtSource
void removeExtSource(PerunSession perunSession, Group group, ExtSource source) throws ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Remove association of the external source from the GROUP.- Parameters:
perunSession-group-source-- Throws:
InternalErrorExceptionExtSourceAlreadyRemovedException- when 0 rows affected by removing from DBExtSourceNotAssignedException
-
removeExtSources
void removeExtSources(PerunSession perunSession, Vo vo, List<ExtSource> sources) throws ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Remove associations of external sources from the VO.- Parameters:
perunSession-vo-sources-- Throws:
InternalErrorExceptionExtSourceAlreadyRemovedException- when 0 rows affected by removing from DBExtSourceNotAssignedException
-
removeExtSources
void removeExtSources(PerunSession perunSession, Group group, List<ExtSource> sources) throws ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Remove associations of external sources from the GROUP.- Parameters:
perunSession-group-sources-- Throws:
InternalErrorExceptionExtSourceAlreadyRemovedException- when 0 rows affected by removing from DBExtSourceNotAssignedException
-