Class IdInfoFetcherImpl
- java.lang.Object
-
- io.mosip.authentication.common.service.impl.IdInfoFetcherImpl
-
- All Implemented Interfaces:
IdInfoFetcher
@Service public class IdInfoFetcherImpl extends Object implements IdInfoFetcher
Helper class to fetch identity values from request.- Author:
- Dinesh Karuppiah.T, Nagarjuna
-
-
Constructor Summary
Constructors Constructor Description IdInfoFetcherImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckLanguageType(String languageFromInput, String languageFromEntity)Check language type.Set<String>getAvailableDynamicAttributesNames(RequestDTO request)Gets the available dynamic attributes names.Map<String,Map.Entry<String,List<IdentityInfoDTO>>>getCbeffValues(Map<String,List<IdentityInfoDTO>> idEntity, CbeffDocType[] types, MatchType matchType)Gets the cbeff values.DemoMatcherUtilgetDemoMatcherUtil()Get the demo matcher utilDemoNormalizergetDemoNormalizer()Gets the demo normalizer.org.springframework.core.env.EnvironmentgetEnvironment()Gets the environment.Map<String,List<IdentityInfoDTO>>getIdentityInfo(MatchType matchType, String idName, RequestDTO identity)Gets the identity info.Map<String,String>getIdentityRequestInfo(MatchType matchType, RequestDTO identity, String language)Gets the identity request info.Map<String,String>getIdentityRequestInfo(MatchType matchType, String idName, RequestDTO identity, String language)Fetch Identity info based on Match type and Identity.Optional<String>getLanguageName(String languageCode)Gets the language name.MappingConfiggetMappingConfig()Gets the mapping config.TriFunctionWithBusinessException<Map<String,String>,Map<String,String>,Map<String,Object>,Double>getMatchFunction(AuthType authType)Gets the match function.Optional<Integer>getMatchingThreshold(String key)Gets the matching threshold.ComparePasswordFunctiongetMatchPasswordFunction()List<String>getSystemSupportedLanguageCodes()Gets the system supported languages.List<String>getTemplatesDefaultLanguageCodes()Gets the template default language codesMasterDataFetchergetTitleFetcher()Gets the title fetcher.Optional<String>getTypeForIdName(String idName, IdMapping[] idMappings)Gets the type for id name.List<String>getUserPreferredLanguages(Map<String,List<IdentityInfoDTO>> idInfo)Gets the user preferred languagesValidateOtpFunctiongetValidateOTPFunction()Gets the validate OTP function.
-
-
-
Method Detail
-
getDemoNormalizer
public DemoNormalizer getDemoNormalizer()
Gets the demo normalizer.- Specified by:
getDemoNormalizerin interfaceIdInfoFetcher- Returns:
- the demo normalizer
-
getLanguageName
public Optional<String> getLanguageName(String languageCode)
Gets the language name.- Specified by:
getLanguageNamein interfaceIdInfoFetcher- Parameters:
languageCode- the language code- Returns:
- the language name
-
getIdentityRequestInfo
public Map<String,String> getIdentityRequestInfo(MatchType matchType, RequestDTO identity, String language)
Gets the identity request info.- Specified by:
getIdentityRequestInfoin interfaceIdInfoFetcher- Parameters:
matchType- the match typeidentity- the identitylanguage- the language- Returns:
- the identity request info
-
getIdentityRequestInfo
public Map<String,String> getIdentityRequestInfo(MatchType matchType, String idName, RequestDTO identity, String language)
Fetch Identity info based on Match type and Identity.- Specified by:
getIdentityRequestInfoin interfaceIdInfoFetcher- Parameters:
matchType- the match typeidName- the id nameidentity- the identitylanguage- the language- Returns:
- Map
-
getIdentityInfo
public Map<String,List<IdentityInfoDTO>> getIdentityInfo(MatchType matchType, String idName, RequestDTO identity)
Gets the identity info.- Specified by:
getIdentityInfoin interfaceIdInfoFetcher- Parameters:
matchType- the match typeidName- the id nameidentity- the identity- Returns:
- the identity info
-
checkLanguageType
public boolean checkLanguageType(String languageFromInput, String languageFromEntity)
Check language type.- Specified by:
checkLanguageTypein interfaceIdInfoFetcher- Parameters:
languageFromInput- the language for match typelanguageFromEntity- the language from req- Returns:
- true, if successful
-
getValidateOTPFunction
public ValidateOtpFunction getValidateOTPFunction()
Gets the validate OTP function.- Specified by:
getValidateOTPFunctionin interfaceIdInfoFetcher- Returns:
- the validate OTP function
-
getCbeffValues
public Map<String,Map.Entry<String,List<IdentityInfoDTO>>> getCbeffValues(Map<String,List<IdentityInfoDTO>> idEntity, CbeffDocType[] types, MatchType matchType) throws IdAuthenticationBusinessException
Gets the cbeff values.- Specified by:
getCbeffValuesin interfaceIdInfoFetcher- Parameters:
idEntity- the id entitytypes- the typesmatchType- the match type- Returns:
- the cbeff values
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
getEnvironment
public org.springframework.core.env.Environment getEnvironment()
Gets the environment.- Specified by:
getEnvironmentin interfaceIdInfoFetcher- Returns:
- the environment
-
getTitleFetcher
public MasterDataFetcher getTitleFetcher()
Gets the title fetcher.- Specified by:
getTitleFetcherin interfaceIdInfoFetcher- Returns:
- the title fetcher
-
getMatchingThreshold
public Optional<Integer> getMatchingThreshold(String key)
Gets the matching threshold.- Specified by:
getMatchingThresholdin interfaceIdInfoFetcher- Parameters:
key- the key- Returns:
- the matching threshold
-
getTypeForIdName
public Optional<String> getTypeForIdName(String idName, IdMapping[] idMappings)
Gets the type for id name.- Specified by:
getTypeForIdNamein interfaceIdInfoFetcher- Parameters:
idName- the id nameidMappings- the id mappings- Returns:
- the type for id name
-
getMatchFunction
public TriFunctionWithBusinessException<Map<String,String>,Map<String,String>,Map<String,Object>,Double> getMatchFunction(AuthType authType)
Gets the match function.- Specified by:
getMatchFunctionin interfaceIdInfoFetcher- Parameters:
authType- the auth type- Returns:
- the match function
-
getMappingConfig
public MappingConfig getMappingConfig()
Gets the mapping config.- Specified by:
getMappingConfigin interfaceIdInfoFetcher- Returns:
- the mapping config
-
getAvailableDynamicAttributesNames
public Set<String> getAvailableDynamicAttributesNames(RequestDTO request)
Gets the available dynamic attributes names.- Specified by:
getAvailableDynamicAttributesNamesin interfaceIdInfoFetcher- Parameters:
request- the request- Returns:
- the available dynamic attributes names
-
getDemoMatcherUtil
public DemoMatcherUtil getDemoMatcherUtil()
Get the demo matcher util- Specified by:
getDemoMatcherUtilin interfaceIdInfoFetcher- Returns:
- demoMatcherUtil
-
getTemplatesDefaultLanguageCodes
public List<String> getTemplatesDefaultLanguageCodes()
Gets the template default language codes- Specified by:
getTemplatesDefaultLanguageCodesin interfaceIdInfoFetcher
-
getSystemSupportedLanguageCodes
public List<String> getSystemSupportedLanguageCodes()
Gets the system supported languages. Combination of mandatory and optional languages.- Specified by:
getSystemSupportedLanguageCodesin interfaceIdInfoFetcher
-
getUserPreferredLanguages
public List<String> getUserPreferredLanguages(Map<String,List<IdentityInfoDTO>> idInfo)
Gets the user preferred languages- Specified by:
getUserPreferredLanguagesin interfaceIdInfoFetcher
-
getMatchPasswordFunction
public ComparePasswordFunction getMatchPasswordFunction()
- Specified by:
getMatchPasswordFunctionin interfaceIdInfoFetcher
-
-