use of org.orcid.core.salesforce.cache.MemberDetailsCacheKey in project ORCID-Source by ORCID.
the class SalesForceManagerImpl method retrieveDetails.
@Override
public MemberDetails retrieveDetails(String memberId) {
List<Member> members = retrieveMembers();
Optional<Member> match = members.stream().filter(e -> {
String id = e.getId();
String legacyId = id.substring(0, 15);
return memberId.equalsIgnoreCase(id) || memberId.equals(legacyId);
}).findFirst();
if (match.isPresent()) {
Member salesForceMember = match.get();
MemberDetails details = (MemberDetails) salesForceMemberDetailsCache.get(new MemberDetailsCacheKey(memberId, salesForceMember.getConsortiumLeadId(), releaseName)).getObjectValue();
details.setMember(salesForceMember);
details.setSubMembers(findSubMembers(memberId));
return details;
}
throw new IllegalArgumentException("No member details found for " + memberId);
}
Aggregations