Package cz.metacentrum.perun.core.impl
Class ExtSourceTCS
java.lang.Object
cz.metacentrum.perun.core.api.PerunBean
cz.metacentrum.perun.core.api.Auditable
cz.metacentrum.perun.core.api.ExtSource
cz.metacentrum.perun.core.impl.ExtSourceImpl
cz.metacentrum.perun.core.impl.ExtSourceTCS
- All Implemented Interfaces:
- ExtSourceApi,- ExtSourceSimpleApi,- Serializable,- Comparable<PerunBean>
Class ExtSource for TCS Synchronize certificates from defined address to Perun for existing users (skip not existing
 users)
- Author:
- Michal Stava stavamichal@gmail.com
- See Also:
- 
Field SummaryFields inherited from class cz.metacentrum.perun.core.impl.ExtSourceImplperunBl
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()If extSource needs to be closed, this method must be called.findSubjects(String searchString) Finds all subjects with attributes in the external source, that contains searchString.findSubjects(String searchString, int maxResults) Finds all subjects with attributes in the external source, that contains searchString limited by the maxResultsfindSubjectsLogins(String searchString) Finds all subjects logins in the external source, that contains searchString.findSubjectsLogins(String searchString, int maxResults) Finds all subjects logins in the external source, that contains searchString, limited by the maxResults.getGroupSubjects(Map<String, String> attributes) Get the list of the subjects in the external group.getSubjectByLogin(String login) Finds subject from the external source by the primary login used in external source.getSubjectGroups(Map<String, String> attributes) Get the list of the subject groups in the external source.Get the list of subjects from the external source.For every certificate from pem file (get from url address) parse only valid certificates.Methods inherited from class cz.metacentrum.perun.core.api.ExtSourcecompareTo, equals, getBeanName, getName, getType, hashCode, serializeToString, setName, setType, toStringMethods inherited from class cz.metacentrum.perun.core.api.AuditablegetCreatedAt, getCreatedBy, getCreatedByUid, getModifiedAt, getModifiedBy, getModifiedByUid, setCreatedAt, setCreatedBy, setCreatedByUid, setModifiedAt, setModifiedBy, setModifiedByUid
- 
Constructor Details- 
ExtSourceTCSpublic ExtSourceTCS()
 
- 
- 
Method Details- 
closeDescription copied from interface:ExtSourceSimpleApiIf extSource needs to be closed, this method must be called.- Specified by:
- closein interface- ExtSourceSimpleApi
- Throws:
- ExtSourceUnsupportedOperationException
 
- 
findSubjectspublic List<Map<String,String>> findSubjects(String searchString) throws ExtSourceUnsupportedOperationException Description copied from interface:ExtSourceApiFinds all subjects with attributes in the external source, that contains searchString.This method is used for getting all logins of subjects in external source with all possible attributes. - Specified by:
- findSubjectsin interface- ExtSourceApi
- Parameters:
- searchString-
- Returns:
- list of maps, which contains attr_name->attr_value (for all extSource attributes)
- Throws:
- ExtSourceUnsupportedOperationException
 
- 
findSubjectspublic List<Map<String,String>> findSubjects(String searchString, int maxResults) throws ExtSourceUnsupportedOperationException Description copied from interface:ExtSourceApiFinds all subjects with attributes in the external source, that contains searchString limited by the maxResultsThis method is used for getting all logins of subjects in external source with all possible attributes. - Specified by:
- findSubjectsin interface- ExtSourceApi
- Parameters:
- searchString-
- maxResults- define max number of returned results, 0 means unlimited
- Returns:
- list of maps, which contains attr_name->attr_value (for all extSource attributes)
- Throws:
- ExtSourceUnsupportedOperationException
 
- 
findSubjectsLoginspublic List<Map<String,String>> findSubjectsLogins(String searchString, int maxResults) throws ExtSourceUnsupportedOperationException Description copied from interface:ExtSourceSimpleApiFinds all subjects logins in the external source, that contains searchString, limited by the maxResults.This method is used for getting all logins of subjects in external source and then use them to searching in external source for other subjects attributes - Specified by:
- findSubjectsLoginsin interface- ExtSourceSimpleApi
- Parameters:
- searchString-
- maxResults- limit returned results
- Returns:
- list of maps, which contains attr_name->attr_value but only for login definition eg. login;MichalS
- Throws:
- ExtSourceUnsupportedOperationException
 
- 
findSubjectsLoginspublic List<Map<String,String>> findSubjectsLogins(String searchString) throws ExtSourceUnsupportedOperationException Description copied from interface:ExtSourceSimpleApiFinds all subjects logins in the external source, that contains searchString.This method is used for getting all logins of subjects in external source and then use them to searching in external source for other subjects attributes. - Specified by:
- findSubjectsLoginsin interface- ExtSourceSimpleApi
- Parameters:
- searchString-
- Returns:
- list of maps, which contains attr_name->attr_value but only for login definition eg. login;MichalS
- Throws:
- ExtSourceUnsupportedOperationException
 
- 
getAttributes- Overrides:
- getAttributesin class- ExtSourceImpl
 
- 
getGroupSubjectsDescription copied from interface:ExtSourceSimpleApiGet the list of the subjects in the external group.- Specified by:
- getGroupSubjectsin interface- ExtSourceSimpleApi
- Parameters:
- attributes- map of attributes used for quering the external source
- Returns:
- list of maps, which contains attr_name->attr_value, e.g. firstName->Michal
 
- 
getSubjectByLoginpublic Map<String,String> getSubjectByLogin(String login) throws ExtSourceUnsupportedOperationException Description copied from interface:ExtSourceSimpleApiFinds subject from the external source by the primary login used in external source.- Specified by:
- getSubjectByLoginin interface- ExtSourceSimpleApi
- Parameters:
- login- login used in the external source
- Returns:
- map which contains attr_name -> attr_value, e.g. firstName->Michal
- Throws:
- ExtSourceUnsupportedOperationException
 
- 
getSubjectGroupspublic List<Map<String,String>> getSubjectGroups(Map<String, String> attributes) throws ExtSourceUnsupportedOperationExceptionDescription copied from interface:ExtSourceSimpleApiGet the list of the subject groups in the external source.- Specified by:
- getSubjectGroupsin interface- ExtSourceSimpleApi
- Parameters:
- attributes- map of attributes used for quering the external source
- Returns:
- list of maps, which contains attr name and attr value
- Throws:
- ExtSourceUnsupportedOperationException
 
- 
getUsersSubjectsDescription copied from interface:ExtSourceSimpleApiGet the list of subjects from the external source.- Specified by:
- getUsersSubjectsin interface- ExtSourceSimpleApi
- Returns:
- list of maps, which contains attr_name->attr_value, e.g. firstName->Michal
 
- 
prepareStructureOfValidCertificatesprotected Map<String,Pair<org.bouncycastle.cert.X509CertificateHolder, prepareStructureOfValidCertificatesString>> (String url) For every certificate from pem file (get from url address) parse only valid certificates. Valid certificate means: - it is not expired - login of the owner can be parsed from certificate subject - every valid owner already exists in perun as User - if more than 1 certificate exists for same owner, choose the one with later expiration- Parameters:
- url- address of url to parse pem file from
- Returns:
- map of logins (in key) to pair of parsed certificate in the left part and certificate in base64 in the right part
- Throws:
- InternalErrorException- If there is any IO problem with parsing and processing the certificate
 
 
-