Package cz.metacentrum.perun.core.api
Interface ExtSourcesManager
- All Known Implementing Classes:
ExtSourcesManagerEntry
public interface ExtSourcesManager
- Author:
- Michal Prochazka invalid input: '<'michalp@ics.muni.cz>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
Name of the INTERNAL extSource, which is used for internal Perun components like Registrar etc.static final String
Name of the LOCAL extSource, which is used for users without any external authentication. extLogin is generated on the fly, usually it is time of the first access.static final String
Name of the default extSource which have every user in Perun.static final String
static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExtSource
(PerunSession perunSession, Group group, ExtSource source) Associate external source definition with the GROUP.void
addExtSource
(PerunSession perunSession, Vo vo, ExtSource source) Associate external source definition with the VO.void
addExtSources
(PerunSession perunSession, Group group, List<ExtSource> sources) Associate external source definitions with the group.void
addExtSources
(PerunSession perunSession, Vo vo, List<ExtSource> sources) Associate external source definitions with the VO.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.void
deleteExtSource
(PerunSession perunSession, ExtSource extSource) Deletes an external source.getAttributes
(PerunSession sess, ExtSource extSource) Gets attributes for external source.getCandidate
(PerunSession perunSession, 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 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.void
Loads ext source definitions from the configuration file and updates entries stored in the DB.void
removeExtSource
(PerunSession perunSession, Group group, ExtSource source) Remove association of the external source from the GROUP.void
removeExtSource
(PerunSession perunSession, Vo vo, ExtSource source) Remove association of the external source from the VO.void
removeExtSources
(PerunSession perunSession, Group group, List<ExtSource> sources) Remove associations of external sources from the GROUP.void
removeExtSources
(PerunSession perunSession, Vo vo, List<ExtSource> sources) Remove associations of external sources from the VO.
-
Field Details
-
EXTSOURCE_IDP
- See Also:
-
EXTSOURCE_SQL
- See Also:
-
EXTSOURCE_LDAP
- See Also:
-
EXTSOURCE_KERBEROS
- See Also:
-
EXTSOURCE_INTERNAL
- See Also:
-
EXTSOURCE_X509
- See Also:
-
EXTSOURCE_REMS
- See Also:
-
EXTSOURCE_NAME_LOCAL
Name of the LOCAL extSource, which is used for users without any external authentication. extLogin is generated on the fly, usually it is time of the first access.- See Also:
-
EXTSOURCE_NAME_INTERNAL
Name of the INTERNAL extSource, which is used for internal Perun components like Registrar etc.- See Also:
-
EXTSOURCE_NAME_PERUN
Name of the default extSource which have every user in Perun.- See Also:
-
CONFIGURATIONFILE
- See Also:
-
EXTSOURCE_SYNCHRONIZATION_ENABLED_ATTRNAME
- See Also:
-
-
Method Details
-
addExtSource
void addExtSource(PerunSession perunSession, Vo vo, ExtSource source) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException Associate external source definition with the VO. -
addExtSource
void addExtSource(PerunSession perunSession, Group group, ExtSource source) throws PrivilegeException, VoNotExistsException, GroupNotExistsException, ExtSourceNotAssignedException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException Associate external source definition with the GROUP. -
addExtSources
void addExtSources(PerunSession perunSession, Vo vo, List<ExtSource> sources) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException Associate external source definitions with the VO.- Parameters:
perunSession
- sessvo
- vosources
- list of sources to associate- Throws:
PrivilegeException
VoNotExistsException
ExtSourceNotExistsException
ExtSourceAlreadyAssignedException
-
addExtSources
void addExtSources(PerunSession perunSession, Group group, List<ExtSource> sources) throws PrivilegeException, VoNotExistsException, GroupNotExistsException, ExtSourceNotAssignedException, ExtSourceNotExistsException, ExtSourceAlreadyAssignedException Associate external source definitions with the group.- Parameters:
perunSession
- sessgroup
- groupsources
- list of sources to associate- Throws:
PrivilegeException
VoNotExistsException
GroupNotExistsException
ExtSourceNotExistsException
ExtSourceNotAssignedException
ExtSourceAlreadyAssignedException
-
checkOrCreateExtSource
ExtSource checkOrCreateExtSource(PerunSession perunSession, String extSourceName, String extSourceType) Checks whether the ExtSource exists, if not, then the ExtSource is created.- Returns:
- existing or newly created extSource is returned
-
createExtSource
ExtSource createExtSource(PerunSession perunSession, ExtSource extSource, Map<String, String> attributes) throws ExtSourceExistsException, PrivilegeExceptionCreates an external source.- Returns:
- ExtSource object with newly associated ID.
- Throws:
ExtSourceExistsException
PrivilegeException
-
deleteExtSource
void deleteExtSource(PerunSession perunSession, ExtSource extSource) throws ExtSourceNotExistsException, PrivilegeException, ExtSourceAlreadyRemovedException Deletes an external source.- Throws:
ExtSourceAlreadyRemovedException
- when 0 rows are affected by deleting from DBExtSourceNotExistsException
PrivilegeException
-
getAttributes
Map<String,String> getAttributes(PerunSession sess, ExtSource extSource) throws PrivilegeException, ExtSourceNotExistsException Gets attributes for external source. Must be Perun Admin.- Parameters:
sess
- Current SessionextSource
- External Source- Returns:
- Map of attributes for external source
- Throws:
PrivilegeException
ExtSourceNotExistsException
-
getCandidate
Candidate getCandidate(PerunSession perunSession, ExtSource source, String login) throws PrivilegeException, ExtSourceNotExistsException, CandidateNotExistsException, ExtSourceUnsupportedOperationException Get the candidate from the ExtSource defined by the extsource login.- Returns:
- a Candidate object
- Throws:
PrivilegeException
ExtSourceNotExistsException
CandidateNotExistsException
ExtSourceUnsupportedOperationException
-
getCandidate
Candidate getCandidate(PerunSession perunSession, Map<String, String> subjectData, ExtSource source) throws PrivilegeException, ExtSourceNotExistsExceptionGet the candidate from subjectData where at least login must exists.IMPORTANT: expected, that these subjectData was get from the ExtSource before using.
- Returns:
- a Candidate object
- Throws:
PrivilegeException
ExtSourceNotExistsException
-
getExtSourceById
ExtSource getExtSourceById(PerunSession perunSession, int id) throws ExtSourceNotExistsException, PrivilegeException Searches for the external source with specified id.- Returns:
- External source with specified id
- Throws:
ExtSourceNotExistsException
PrivilegeException
-
getExtSourceByName
ExtSource getExtSourceByName(PerunSession perunSession, String name) throws ExtSourceNotExistsException, PrivilegeException Searches for the external source using specified name.- Returns:
- External source with specified name
- Throws:
ExtSourceNotExistsException
PrivilegeException
-
getExtSources
Get list of all external sources.- Returns:
- list of external source
- Throws:
PrivilegeException
-
getGroupExtSources
List<ExtSource> getGroupExtSources(PerunSession perunSession, Group group) throws PrivilegeException, GroupNotExistsException Get list of external sources associated with the GROUP.- Returns:
- list of external sources associated with the VO
- Throws:
PrivilegeException
GroupNotExistsException
-
getInvalidUsers
List<User> getInvalidUsers(PerunSession perunSession, ExtSource source) throws PrivilegeException, ExtSourceNotExistsException Returns list of users stored by this ExtSource, which are not valid.- Returns:
- list of users, who is not in the extSource anymore
- Throws:
PrivilegeException
ExtSourceNotExistsException
-
getVoExtSources
List<ExtSource> getVoExtSources(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException Get list of external sources associated with the VO.- Returns:
- list of external sources associated with the VO
- Throws:
PrivilegeException
VoNotExistsException
-
loadExtSourcesDefinitions
Loads ext source definitions from the configuration file and updates entries stored in the DB.- Throws:
PrivilegeException
-
removeExtSource
void removeExtSource(PerunSession perunSession, Vo vo, ExtSource source) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Remove association of the external source from the VO.- Throws:
ExtSourceAlreadyRemovedException
- when 0 rows affected by removing from DBPrivilegeException
VoNotExistsException
ExtSourceNotExistsException
ExtSourceNotAssignedException
-
removeExtSource
void removeExtSource(PerunSession perunSession, Group group, ExtSource source) throws PrivilegeException, GroupNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Remove association of the external source from the GROUP.- Throws:
ExtSourceAlreadyRemovedException
- when 0 rows affected by removing from DBPrivilegeException
GroupNotExistsException
ExtSourceNotExistsException
ExtSourceNotAssignedException
-
removeExtSources
void removeExtSources(PerunSession perunSession, Vo vo, List<ExtSource> sources) throws PrivilegeException, VoNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Remove associations of external sources from the VO.- Parameters:
perunSession
-vo
-sources
-- Throws:
ExtSourceAlreadyRemovedException
- when 0 rows affected by removing from DBPrivilegeException
VoNotExistsException
ExtSourceNotExistsException
ExtSourceNotAssignedException
-
removeExtSources
void removeExtSources(PerunSession perunSession, Group group, List<ExtSource> sources) throws PrivilegeException, GroupNotExistsException, ExtSourceNotExistsException, ExtSourceNotAssignedException, ExtSourceAlreadyRemovedException Remove associations of external sources from the GROUP.- Parameters:
perunSession
-group
-sources
-- Throws:
ExtSourceAlreadyRemovedException
- when 0 rows affected by removing from DBPrivilegeException
GroupNotExistsException
ExtSourceNotExistsException
ExtSourceNotAssignedException
-