String profileConfigurationName = null;
boolean isPofileCnfigurationRequested = false;
Set<String> propertySet = new HashSet<String>();
for (String claim : claims) {
ClaimMapping mapping = null;
try {
mapping = (ClaimMapping) claimManager.getClaimMapping(claim);
} catch (org.wso2.carbon.user.api.UserStoreException e) {
throw new UserStoreException(e);
}
// There can be cases some claim values being requested for claims
// we don't have.
if (mapping != null) {
propertySet.add(mapping.getMappedAttribute());
}
if (UserCoreConstants.PROFILE_CONFIGURATION.equals(claim)) {
isPofileCnfigurationRequested = true;
}
}
propertySet.add(UserCoreConstants.PROFILE_CONFIGURATION);
String[] properties = propertySet.toArray(new String[propertySet.size()]);
Map<String, String> uerProperties = this.getUserPropertyValues(userName, properties,
profileName);
profileConfigurationName = uerProperties.get(UserCoreConstants.PROFILE_CONFIGURATION);
if (profileConfigurationName == null) {
profileConfigurationName = UserCoreConstants.DEFAULT_PROFILE_CONFIGURATION;
}
ProfileConfiguration profileConfig;
try {
profileConfig = (ProfileConfiguration) profileManager.getProfileConfig(profileConfigurationName);
} catch (org.wso2.carbon.user.api.UserStoreException e) {
throw new UserStoreException(e);
}
List<String> hidden = null;
if (profileConfig != null) {
hidden = getMappingAttributeList(profileConfig.getHiddenClaims());
}
List<String> overridden = null;
if (profileConfig != null) {
overridden = getMappingAttributeList(profileConfig.getOverriddenClaims());
}
List<String> getAgain = new ArrayList<String>();
Map<String, String> finalValues = new HashMap<String, String>();
if (isPofileCnfigurationRequested) {
finalValues.put(UserCoreConstants.PROFILE_CONFIGURATION, profileConfigurationName);
}
for (String claim : claims) {
ClaimMapping mapping;
try {
mapping = (ClaimMapping) claimManager.getClaimMapping(claim);
} catch (org.wso2.carbon.user.api.UserStoreException e) {
throw new UserStoreException(e);
}
if (mapping != null) {
String property = mapping.getMappedAttribute();
String value = uerProperties.get(property);
if (hidden != null && hidden.contains(property)) {
continue;
}