/**
  * Returns user claims
  *
  * @return
  */
 public UserIdentityClaimDTO[] getUserIdentityRecoveryData() {
   Map<String, String> tempMap = new HashMap<String, String>();
   // reading them to a temporary map
   for (Map.Entry<String, String> entry : userIdentityDataMap.entrySet()) {
     // only if not a security question uri or an identity claim uri
     if (!entry.getKey().contains(UserCoreConstants.ClaimTypeURIs.CHALLENGE_QUESTION_URI)
         && !entry.getKey().contains(UserCoreConstants.ClaimTypeURIs.IDENTITY_CLAIM_URI)) {
       tempMap.put(entry.getKey(), entry.getValue());
     }
   }
   // no user claim found
   if (tempMap.size() == 0) {
     return null;
   }
   // creating claim dtos
   UserIdentityClaimDTO[] identityRecoveryData = new UserIdentityClaimDTO[tempMap.size()];
   int i = 0;
   for (Map.Entry<String, String> entry : tempMap.entrySet()) {
     UserIdentityClaimDTO dto = new UserIdentityClaimDTO();
     dto.setClaimUri(entry.getKey());
     dto.setClaimValue(entry.getValue());
     identityRecoveryData[i] = dto;
     i++;
   }
   return identityRecoveryData;
 }
 /**
  * Returns all user identity claims
  *
  * @return
  */
 public UserIdentityClaimDTO[] getUserSequeiryQuestions() {
   Map<String, String> tempMap = new HashMap<String, String>();
   // reading them to a temporary map
   for (Map.Entry<String, String> entry : userIdentityDataMap.entrySet()) {
     // only if a security question uri
     if (entry.getKey().contains(UserCoreConstants.ClaimTypeURIs.CHALLENGE_QUESTION_URI)) {
       tempMap.put(entry.getKey(), entry.getValue());
     }
   }
   // no security questions found
   if (tempMap.size() == 0) {
     return null;
   }
   // creating claim dtos
   UserIdentityClaimDTO[] securityQuestions = new UserIdentityClaimDTO[tempMap.size()];
   int i = 0;
   for (Map.Entry<String, String> entry : tempMap.entrySet()) {
     UserIdentityClaimDTO dto = new UserIdentityClaimDTO();
     dto.setClaimUri(entry.getKey());
     dto.setClaimValue(entry.getValue());
     securityQuestions[i] = dto;
     i++;
   }
   return securityQuestions;
 }
 /**
  * Update the security question
  *
  * @param securityQuestions
  */
 public void updateUserSequeiryQuestions(UserIdentityClaimDTO[] securityQuestions) {
   for (UserIdentityClaimDTO dto : securityQuestions) {
     // if the uri and the value is not null and if its only a security
     // question claim then update
     if (dto.getClaimUri() != null
         && dto.getClaimValue() != null
         && dto.getClaimUri().contains(UserCoreConstants.ClaimTypeURIs.CHALLENGE_QUESTION_URI)) {
       userIdentityDataMap.put(dto.getClaimUri(), dto.getClaimValue());
     }
   }
 }
 /** @param userIdentityRecoveryData */
 public void updateUserIdentityRecoveryData(UserIdentityClaimDTO[] userIdentityRecoveryData) {
   for (UserIdentityClaimDTO dto : userIdentityRecoveryData) {
     // if the uri and the value is not null and if not a security
     // question or an identity claim
     if (dto.getClaimUri() != null
         && dto.getClaimValue() != null
         && !dto.getClaimUri().contains(UserCoreConstants.ClaimTypeURIs.CHALLENGE_QUESTION_URI)
         && !dto.getClaimUri().contains(UserCoreConstants.ClaimTypeURIs.IDENTITY_CLAIM_URI)) {
       userIdentityDataMap.put(dto.getClaimUri(), dto.getClaimValue());
     }
   }
 }