use of com.iplanet.am.sdk.AMHashMap in project OpenAM by OpenRock.
the class OpenAMScopeValidator method getTimestamps.
private AMHashMap getTimestamps(String username, String realm, String modifyTimestamp, String createTimestamp) throws IdRepoException, SSOException {
final SSOToken token = AccessController.doPrivileged(AdminTokenAction.getInstance());
final AMIdentityRepository amIdRepo = new AMIdentityRepository(token, realm);
final IdSearchControl searchConfig = new IdSearchControl();
searchConfig.setReturnAttributes(new HashSet<String>(Arrays.asList(modifyTimestamp, createTimestamp)));
searchConfig.setMaxResults(0);
final IdSearchResults searchResults = amIdRepo.searchIdentities(IdType.USER, username, searchConfig);
final Iterator searchResultsItr = searchResults.getResultAttributes().values().iterator();
if (searchResultsItr.hasNext()) {
return (AMHashMap) searchResultsItr.next();
} else {
logger.warning("Error retrieving timestamps from datastore");
throw new IdRepoException();
}
}
Aggregations