Interface ExtSourcesManagerImplApi
- All Known Implementing Classes:
ExtSourcesManagerImpl
public interface ExtSourcesManagerImplApi
- 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.voidcheckExtSourceExists(PerunSession perunSession, ExtSource extSource) Check if extSource exists in underlaying data source.createExtSource(PerunSession perunSession, ExtSource extSource, Map<String, String> attributes) Creates an external source.voiddeleteExtSource(PerunSession perunSession, ExtSource extSource) Deletes an external source.voiddestroy()Clean up allocated resources.booleanextSourceExists(PerunSession perunSession, ExtSource extSource) Check if extSource exists in underlaying data source.getAssociatedUsersIdsWithExtSource(PerunSession perunSession, ExtSource source) Get all users' id associate with the provided ExtSourcegetAttributes(ExtSource extSource) Gets attributes for external source.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.Returns all ExtSources with enabled synchronizationgetGroupExtSourcesIds(PerunSession perunSession, Group group) Get list of external sources ids associated with the GROUP.getVoExtSourcesIds(PerunSession perunSession, Vo vo) Get list of external sources ids associated to the VO.voidinitialize(PerunSession sess, PerunBl perunBl) Initialize managervoidLoads 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.voidupdateExtSource(PerunSession sess, ExtSource extSource, Map<String, String> attributes) Updates extSource definition.
-
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
-
checkExtSourceExists
void checkExtSourceExists(PerunSession perunSession, ExtSource extSource) throws ExtSourceNotExistsException Check if extSource exists in underlaying data source.- Parameters:
perunSession-extSource-- Throws:
InternalErrorExceptionExtSourceNotExistsException
-
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:
ExtSourceAlreadyRemovedException- if there are 0 rows affected by delete in DBInternalErrorException
-
destroy
void destroy()Clean up allocated resources. -
extSourceExists
Check if extSource exists in underlaying data source.- Parameters:
perunSession-extSource-- Returns:
- true if extSource exists in underlaying data source, false otherwise
- Throws:
InternalErrorException
-
getAssociatedUsersIdsWithExtSource
Get all users' id associate with the provided ExtSource- Parameters:
perunSession-source-- Returns:
- list of users' id associated with the provided ExtSource
- Throws:
InternalErrorException
-
getAttributes
Gets attributes for external source.- Parameters:
extSource- External Source- Returns:
- Map of attributes for external source
- 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 VO
- Throws:
InternalErrorException
-
getExtSourcesToSynchronize
Returns all ExtSources with enabled synchronization- Parameters:
sess- PerunSession- Returns:
- List of External Sources with enabled synchronization
- Throws:
InternalErrorException
-
getGroupExtSourcesIds
List<Integer> getGroupExtSourcesIds(PerunSession perunSession, Group group) throws InternalErrorException Get list of external sources ids associated with the GROUP.- Parameters:
perunSession-group-- Returns:
- list of external sources ids associated with the group
- Throws:
InternalErrorException
-
getVoExtSourcesIds
Get list of external sources ids associated to the VO.- Parameters:
perunSession-vo-- Returns:
- list of external sources ids 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 remove in 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
-
updateExtSource
void updateExtSource(PerunSession sess, ExtSource extSource, Map<String, String> attributes) throws ExtSourceNotExistsExceptionUpdates extSource definition. It should be called only internally, because extSources are defined in the external XML file. It shouldn't be called from upper layers !!!- Parameters:
sess-extSource-- Throws:
InternalErrorExceptionExtSourceNotExistsException
-