}
protected void populateClaimValues(String userIdentifier, SAMLAttributeCallback callback)
throws IdentityProviderException {
UserStoreManager connector = null;
RahasData rahasData = null;
if (log.isDebugEnabled()) {
log.debug("Populating claim values");
}
if (requestedClaims.isEmpty()) {
return;
}
try {
connector = IdentityTenantUtil.getRealm(null, userIdentifier).getUserStoreManager();
} catch (Exception e) {
log.error("Error while instantiating IdentityUserStore", e);
throw new IdentityProviderException("Error while instantiating IdentityUserStore", e);
}
// get the column names for the URIs
Iterator<RequestedClaimData> ite = requestedClaims.values().iterator();
List<String> claimList = new ArrayList<String>();
rahasData = callback.getData();
while (ite.hasNext()) {
RequestedClaimData claim = (RequestedClaimData) ite.next();
if (claim != null && !claim.getUri().equals(IdentityConstants.CLAIM_PPID)) {
claimList.add(claim.getUri());
}
}
String[] claimArray = new String[claimList.size()];
String userId = userIdentifier;
Map<String, String> mapValues = null;
try {
mapValues = connector.getUserClaimValues(userId, claimList.toArray(claimArray), null);
ite = requestedClaims.values().iterator();
while (ite.hasNext()) {
SAMLAttribute attribute = null;
Attribute saml2Attribute = null;
RequestedClaimData claimData = ite.next();
claimData.setValue(mapValues.get(claimData.getUri()));
if (claimData.getValue() != null) {
if (RahasConstants.TOK_TYPE_SAML_20.equals(rahasData.getTokenType())) {
saml2Attribute = getSAML2Attribute(supportedClaims.get(claimData.getUri())
.getDisplayTag(), claimData.getValue(), claimData.getUri());
callback.addAttributes(saml2Attribute);
} else {
attribute = new SAMLAttribute(supportedClaims.get(claimData.getUri())