* @throws IdentityException
*/
public InfoCardDO[] getInfoCardsForUser(String userId) throws IdentityException {
List<InfoCardDO> cards = null;
Association[] assoc = null;
InfoCardDO infoCard = null;
if (log.isDebugEnabled()) {
log.debug("Retrieving information cards for user " + userId);
}
cards = new ArrayList<InfoCardDO>();
try {
if (registry.resourceExists(RegistryConstants.PROFILES_PATH + userId)) {
assoc = registry.getAssociations(RegistryConstants.PROFILES_PATH + userId,
IdentityRegistryResources.ASSOCIATION_USER_INFOCARD);
for (Association association : assoc) {
infoCard = resourceToObject(registry.get(association.getDestinationPath()));
infoCard.setUserId(userId);
cards.add(infoCard);
}
}
} catch (RegistryException e) {
log.error("Error occured while retreiving infromation cards for" + userId, e);