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 TypeMethodDescriptionvoid
addExtSource
(PerunSession sess, Group group, ExtSource source) Associate external source definition with the GROUP.void
addExtSource
(PerunSession sess, Vo vo, ExtSource source) Associate external source definition with the VO.void
addExtSources
(PerunSession sess, Group group, List<ExtSource> sources) Associate external source definitions with the group.void
addExtSources
(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.void
deleteExtSource
(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.void
Loads ext source definitions from the configuration file and updates entries stored in the DB.void
removeExtSource
(PerunSession sess, Group group, ExtSource source) Remove association of the external source from the GROUP.void
removeExtSource
(PerunSession sess, Vo vo, ExtSource source) Remove association of the external source from the VO.void
removeExtSources
(PerunSession sess, Group group, List<ExtSource> sources) Remove associations of external sources from the GROUP.void
removeExtSources
(PerunSession sess, Vo vo, List<ExtSource> sources) Remove associations of external sources from the VO.void
setExtSourcesManagerBl
(ExtSourcesManagerBl extSourcesManagerBl) Sets the extSourcesManagerBl for this instance.void
setPerunBl
(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:ExtSourcesManager
Associate external source definition with the VO.- Specified by:
addExtSource
in interfaceExtSourcesManager
- Throws:
PrivilegeException
VoNotExistsException
ExtSourceNotExistsException
ExtSourceAlreadyAssignedException
-
addExtSource
public void addExtSource(PerunSession sess, Group group, ExtSource source) throws PrivilegeException, GroupNotExistsException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException, ExtSourceNotAssignedException, VoNotExistsException Description copied from interface:ExtSourcesManager
Associate 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:ExtSourcesManager
Associate external source definitions with the VO.- Specified by:
addExtSources
in interfaceExtSourcesManager
- Parameters:
sess
- sessvo
- vosources
- list of sources to associate- Throws:
PrivilegeException
VoNotExistsException
ExtSourceNotExistsException
ExtSourceAlreadyAssignedException
-
addExtSources
public void addExtSources(PerunSession sess, Group group, List<ExtSource> sources) throws PrivilegeException, GroupNotExistsException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException Description copied from interface:ExtSourcesManager
Associate external source definitions with the group.- Specified by:
addExtSources
in interfaceExtSourcesManager
- Parameters:
sess
- sessgroup
- groupsources
- list of sources to associate- Throws:
PrivilegeException
GroupNotExistsException
ExtSourceNotExistsException
ExtSourceAlreadyAssignedException
-
checkOrCreateExtSource
public ExtSource checkOrCreateExtSource(PerunSession sess, String extSourceName, String extSourceType) Description copied from interface:ExtSourcesManager
Checks whether the ExtSource exists, if not, then the ExtSource is created.- Specified by:
checkOrCreateExtSource
in 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:ExtSourcesManager
Creates an external source.- Specified by:
createExtSource
in interfaceExtSourcesManager
- Returns:
- ExtSource object with newly associated ID.
- Throws:
ExtSourceExistsException
PrivilegeException
-
deleteExtSource
public void deleteExtSource(PerunSession sess, ExtSource extSource) throws ExtSourceNotExistsException, PrivilegeException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManager
Deletes an external source.- Specified by:
deleteExtSource
in interfaceExtSourcesManager
- Throws:
ExtSourceAlreadyRemovedException
- when 0 rows are affected by deleting from DBExtSourceNotExistsException
PrivilegeException
-
getAttributes
public Map<String,String> getAttributes(PerunSession sess, ExtSource extSource) throws PrivilegeException, ExtSourceNotExistsException Description copied from interface:ExtSourcesManager
Gets attributes for external source. Must be Perun Admin.- Specified by:
getAttributes
in interfaceExtSourcesManager
- Parameters:
sess
- Current SessionextSource
- External Source- Returns:
- Map of attributes for external source
- Throws:
PrivilegeException
ExtSourceNotExistsException
-
getCandidate
public Candidate getCandidate(PerunSession sess, ExtSource source, String login) throws PrivilegeException, ExtSourceNotExistsException, CandidateNotExistsException, ExtSourceUnsupportedOperationException Description copied from interface:ExtSourcesManager
Get the candidate from the ExtSource defined by the extsource login.- Specified by:
getCandidate
in interfaceExtSourcesManager
- Returns:
- a Candidate object
- Throws:
PrivilegeException
ExtSourceNotExistsException
CandidateNotExistsException
ExtSourceUnsupportedOperationException
-
getCandidate
public Candidate getCandidate(PerunSession perunSession, Map<String, String> subjectData, ExtSource source) throws PrivilegeException, ExtSourceNotExistsExceptionDescription copied from interface:ExtSourcesManager
Get the candidate from subjectData where at least login must exists.IMPORTANT: expected, that these subjectData was get from the ExtSource before using.
- Specified by:
getCandidate
in interfaceExtSourcesManager
- Returns:
- a Candidate object
- Throws:
PrivilegeException
ExtSourceNotExistsException
-
getExtSourceById
public ExtSource getExtSourceById(PerunSession sess, int id) throws ExtSourceNotExistsException, PrivilegeException Description copied from interface:ExtSourcesManager
Searches for the external source with specified id.- Specified by:
getExtSourceById
in interfaceExtSourcesManager
- Returns:
- External source with specified id
- Throws:
ExtSourceNotExistsException
PrivilegeException
-
getExtSourceByName
public ExtSource getExtSourceByName(PerunSession sess, String name) throws ExtSourceNotExistsException, PrivilegeException Description copied from interface:ExtSourcesManager
Searches for the external source using specified name.- Specified by:
getExtSourceByName
in interfaceExtSourcesManager
- Returns:
- External source with specified name
- Throws:
ExtSourceNotExistsException
PrivilegeException
-
getExtSources
Description copied from interface:ExtSourcesManager
Get list of all external sources.- Specified by:
getExtSources
in 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:ExtSourcesManager
Get list of external sources associated with the GROUP.- Specified by:
getGroupExtSources
in interfaceExtSourcesManager
- Returns:
- list of external sources associated with the VO
- Throws:
PrivilegeException
GroupNotExistsException
-
getInvalidUsers
public List<User> getInvalidUsers(PerunSession sess, ExtSource source) throws PrivilegeException, ExtSourceNotExistsException Description copied from interface:ExtSourcesManager
Returns list of users stored by this ExtSource, which are not valid.- Specified by:
getInvalidUsers
in interfaceExtSourcesManager
- Returns:
- list of users, who is not in the extSource anymore
- Throws:
PrivilegeException
ExtSourceNotExistsException
-
getPerunBl
-
getVoExtSources
public List<ExtSource> getVoExtSources(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ExtSourcesManager
Get list of external sources associated with the VO.- Specified by:
getVoExtSources
in interfaceExtSourcesManager
- Returns:
- list of external sources associated with the VO
- Throws:
PrivilegeException
VoNotExistsException
-
loadExtSourcesDefinitions
Description copied from interface:ExtSourcesManager
Loads ext source definitions from the configuration file and updates entries stored in the DB.- Specified by:
loadExtSourcesDefinitions
in interfaceExtSourcesManager
- Throws:
PrivilegeException
-
removeExtSource
public void removeExtSource(PerunSession sess, Vo vo, ExtSource source) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManager
Remove association of the external source from the VO.- Specified by:
removeExtSource
in interfaceExtSourcesManager
- Throws:
ExtSourceAlreadyRemovedException
- when 0 rows affected by removing from DBPrivilegeException
VoNotExistsException
ExtSourceNotExistsException
ExtSourceNotAssignedException
-
removeExtSource
public void removeExtSource(PerunSession sess, Group group, ExtSource source) throws PrivilegeException, GroupNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManager
Remove association of the external source from the GROUP.- Specified by:
removeExtSource
in interfaceExtSourcesManager
- Throws:
ExtSourceAlreadyRemovedException
- when 0 rows affected by removing from DBPrivilegeException
GroupNotExistsException
ExtSourceNotExistsException
ExtSourceNotAssignedException
-
removeExtSources
public void removeExtSources(PerunSession sess, Vo vo, List<ExtSource> sources) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Description copied from interface:ExtSourcesManager
Remove associations of external sources from the VO.- Specified by:
removeExtSources
in interfaceExtSourcesManager
- Parameters:
sess
-vo
-sources
-- Throws:
PrivilegeException
VoNotExistsException
ExtSourceNotExistsException
ExtSourceNotAssignedException
ExtSourceAlreadyRemovedException
- 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:ExtSourcesManager
Remove associations of external sources from the GROUP.- Specified by:
removeExtSources
in interfaceExtSourcesManager
- Parameters:
sess
-group
-sources
-- Throws:
PrivilegeException
GroupNotExistsException
ExtSourceNotExistsException
ExtSourceNotAssignedException
ExtSourceAlreadyRemovedException
- 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.
-