Package cz.metacentrum.perun.core.entry
Class ExtSourcesManagerEntry
java.lang.Object
cz.metacentrum.perun.core.entry.ExtSourcesManagerEntry
- All Implemented Interfaces:
ExtSourcesManager
ExtSourcesManager entry logic.
- Author:
- Slavek Licehammer glory@ics.muni.cz
-
Field Summary
Fields inherited from interface cz.metacentrum.perun.core.api.ExtSourcesManager
CONFIGURATIONFILE, EXTSOURCE_IDP, EXTSOURCE_INTERNAL, EXTSOURCE_KERBEROS, EXTSOURCE_LDAP, EXTSOURCE_NAME_INTERNAL, EXTSOURCE_NAME_LOCAL, EXTSOURCE_NAME_PERUN, EXTSOURCE_REMS, EXTSOURCE_SQL, EXTSOURCE_SYNCHRONIZATION_ENABLED_ATTRNAME, EXTSOURCE_X509 -
Constructor Summary
Constructors -
Method Summary
Modifier 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 sess, Group group, List<ExtSource> sources) Associate external source definitions with the group.voidaddExtSources(PerunSession sess, Vo vo, List<ExtSource> sources) Associate external source definitions with the VO.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.getAttributes(PerunSession sess, ExtSource extSource) Gets attributes for external source.getCandidate(PerunSession sess, ExtSource source, String login) Get the candidate from the ExtSource defined by the extsource login.getCandidate(PerunSession perunSession, Map<String, String> subjectData, ExtSource source) Get the candidate from subjectData where at least login must exists.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 extSourcesManagerBl 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.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.voidsetExtSourcesManagerBl(ExtSourcesManagerBl extSourcesManagerBl) Sets the extSourcesManagerBl for this instance.voidsetPerunBl(PerunBl perunBl) Sets the perunBl for this instance.
-
Constructor Details
-
ExtSourcesManagerEntry
-
ExtSourcesManagerEntry
public ExtSourcesManagerEntry()
-
-
Method Details
-
addExtSource
public void addExtSource(PerunSession sess, Vo vo, ExtSource source) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException Description copied from interface:ExtSourcesManagerAssociate external source definition with the VO.- Specified by:
addExtSourcein interfaceExtSourcesManager- Throws:
PrivilegeExceptionVoNotExistsExceptionExtSourceNotExistsExceptionExtSourceAlreadyAssignedException
-
addExtSource
public void addExtSource(PerunSession sess, Group group, ExtSource source) throws PrivilegeException, GroupNotExistsException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException, ExtSourceNotAssignedException, VoNotExistsException Description copied from interface:ExtSourcesManagerAssociate external source definition with the GROUP. -
addExtSources
public void addExtSources(PerunSession sess, Vo vo, List<ExtSource> sources) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException Description copied from interface:ExtSourcesManagerAssociate external source definitions with the VO.- Specified by:
addExtSourcesin interfaceExtSourcesManager- Parameters:
sess- sessvo- vosources- list of sources to associate- Throws:
PrivilegeExceptionVoNotExistsExceptionExtSourceNotExistsExceptionExtSourceAlreadyAssignedException
-
addExtSources
public void addExtSources(PerunSession sess, Group group, List<ExtSource> sources) throws PrivilegeException, GroupNotExistsException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException Description copied from interface:ExtSourcesManagerAssociate external source definitions with the group.- Specified by:
addExtSourcesin interfaceExtSourcesManager- Parameters:
sess- sessgroup- groupsources- list of sources to associate- Throws:
PrivilegeExceptionGroupNotExistsExceptionExtSourceNotExistsExceptionExtSourceAlreadyAssignedException
-
checkOrCreateExtSource
public ExtSource checkOrCreateExtSource(PerunSession sess, String extSourceName, String extSourceType) Description copied from interface:ExtSourcesManagerChecks whether the ExtSource exists, if not, then the ExtSource is created.- Specified by:
checkOrCreateExtSourcein interfaceExtSourcesManager- Returns:
- existing or newly created extSource is returned
-
createExtSource
public ExtSource createExtSource(PerunSession sess, ExtSource extSource, Map<String, String> attributes) throws ExtSourceExistsException, PrivilegeExceptionDescription copied from interface:ExtSourcesManagerCreates an external source.- Specified by:
createExtSourcein interfaceExtSourcesManager- Returns:
- ExtSource object with newly associated ID.
- Throws:
ExtSourceExistsExceptionPrivilegeException
-
deleteExtSource
public void deleteExtSource(PerunSession sess, ExtSource extSource) throws ExtSourceNotExistsException, PrivilegeException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerDeletes an external source.- Specified by:
deleteExtSourcein interfaceExtSourcesManager- Throws:
ExtSourceAlreadyRemovedException- when 0 rows are affected by deleting from DBExtSourceNotExistsExceptionPrivilegeException
-
getAttributes
public Map<String,String> getAttributes(PerunSession sess, ExtSource extSource) throws PrivilegeException, ExtSourceNotExistsException Description copied from interface:ExtSourcesManagerGets attributes for external source. Must be Perun Admin.- Specified by:
getAttributesin interfaceExtSourcesManager- Parameters:
sess- Current SessionextSource- External Source- Returns:
- Map of attributes for external source
- Throws:
PrivilegeExceptionExtSourceNotExistsException
-
getCandidate
public Candidate getCandidate(PerunSession sess, ExtSource source, String login) throws PrivilegeException, ExtSourceNotExistsException, CandidateNotExistsException, ExtSourceUnsupportedOperationException Description copied from interface:ExtSourcesManagerGet the candidate from the ExtSource defined by the extsource login.- Specified by:
getCandidatein interfaceExtSourcesManager- Returns:
- a Candidate object
- Throws:
PrivilegeExceptionExtSourceNotExistsExceptionCandidateNotExistsExceptionExtSourceUnsupportedOperationException
-
getCandidate
public Candidate getCandidate(PerunSession perunSession, Map<String, String> subjectData, ExtSource source) throws PrivilegeException, ExtSourceNotExistsExceptionDescription copied from interface:ExtSourcesManagerGet 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 interfaceExtSourcesManager- Returns:
- a Candidate object
- Throws:
PrivilegeExceptionExtSourceNotExistsException
-
getExtSourceById
public ExtSource getExtSourceById(PerunSession sess, int id) throws ExtSourceNotExistsException, PrivilegeException Description copied from interface:ExtSourcesManagerSearches for the external source with specified id.- Specified by:
getExtSourceByIdin interfaceExtSourcesManager- Returns:
- External source with specified id
- Throws:
ExtSourceNotExistsExceptionPrivilegeException
-
getExtSourceByName
public ExtSource getExtSourceByName(PerunSession sess, String name) throws ExtSourceNotExistsException, PrivilegeException Description copied from interface:ExtSourcesManagerSearches for the external source using specified name.- Specified by:
getExtSourceByNamein interfaceExtSourcesManager- Returns:
- External source with specified name
- Throws:
ExtSourceNotExistsExceptionPrivilegeException
-
getExtSources
Description copied from interface:ExtSourcesManagerGet list of all external sources.- Specified by:
getExtSourcesin interfaceExtSourcesManager- Returns:
- list of external source
- Throws:
PrivilegeException
-
getExtSourcesManagerBl
Gets the extSourcesManagerBl for this instance.- Returns:
- extSourceManagerImpl
-
getExtSourcesManagerImpl
-
getGroupExtSources
public List<ExtSource> getGroupExtSources(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:ExtSourcesManagerGet list of external sources associated with the GROUP.- Specified by:
getGroupExtSourcesin interfaceExtSourcesManager- Returns:
- list of external sources associated with the VO
- Throws:
PrivilegeExceptionGroupNotExistsException
-
getInvalidUsers
public List<User> getInvalidUsers(PerunSession sess, ExtSource source) throws PrivilegeException, ExtSourceNotExistsException Description copied from interface:ExtSourcesManagerReturns list of users stored by this ExtSource, which are not valid.- Specified by:
getInvalidUsersin interfaceExtSourcesManager- Returns:
- list of users, who is not in the extSource anymore
- Throws:
PrivilegeExceptionExtSourceNotExistsException
-
getPerunBl
-
getVoExtSources
public List<ExtSource> getVoExtSources(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ExtSourcesManagerGet list of external sources associated with the VO.- Specified by:
getVoExtSourcesin interfaceExtSourcesManager- Returns:
- list of external sources associated with the VO
- Throws:
PrivilegeExceptionVoNotExistsException
-
loadExtSourcesDefinitions
Description copied from interface:ExtSourcesManagerLoads ext source definitions from the configuration file and updates entries stored in the DB.- Specified by:
loadExtSourcesDefinitionsin interfaceExtSourcesManager- Throws:
PrivilegeException
-
removeExtSource
public void removeExtSource(PerunSession sess, Vo vo, ExtSource source) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerRemove association of the external source from the VO.- Specified by:
removeExtSourcein interfaceExtSourcesManager- Throws:
ExtSourceAlreadyRemovedException- when 0 rows affected by removing from DBPrivilegeExceptionVoNotExistsExceptionExtSourceNotExistsExceptionExtSourceNotAssignedException
-
removeExtSource
public void removeExtSource(PerunSession sess, Group group, ExtSource source) throws PrivilegeException, GroupNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerRemove association of the external source from the GROUP.- Specified by:
removeExtSourcein interfaceExtSourcesManager- Throws:
ExtSourceAlreadyRemovedException- when 0 rows affected by removing from DBPrivilegeExceptionGroupNotExistsExceptionExtSourceNotExistsExceptionExtSourceNotAssignedException
-
removeExtSources
public void removeExtSources(PerunSession sess, Vo vo, List<ExtSource> sources) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerRemove associations of external sources from the VO.- Specified by:
removeExtSourcesin interfaceExtSourcesManager- Parameters:
sess-vo-sources-- Throws:
PrivilegeExceptionVoNotExistsExceptionExtSourceNotExistsExceptionExtSourceNotAssignedExceptionExtSourceAlreadyRemovedException- when 0 rows affected by removing from DB
-
removeExtSources
public void removeExtSources(PerunSession sess, Group group, List<ExtSource> sources) throws PrivilegeException, GroupNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManagerRemove associations of external sources from the GROUP.- Specified by:
removeExtSourcesin interfaceExtSourcesManager- Parameters:
sess-group-sources-- Throws:
PrivilegeExceptionGroupNotExistsExceptionExtSourceNotExistsExceptionExtSourceNotAssignedExceptionExtSourceAlreadyRemovedException- when 0 rows affected by removing from DB
-
setExtSourcesManagerBl
Sets the extSourcesManagerBl for this instance.- Parameters:
extSourcesManagerBl- The extSourcesManagerBl.
-
setPerunBl
Sets the perunBl for this instance.- Parameters:
perunBl- The perunBl.
-