Filter to get identities that have been refreshed in a given period of time

Hi all,

Can someone help me with a filter to find identities that have been refreshed within a giver period of time?

Thanks in advance

Hi @rishavghoshacc ,

  • lastRefresh Attribute: This attribute holds the timestamp of the last refresh for each identity.
    Please refer the logic below.
List identityName = new ArrayList();
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
Date startDate = calendar.getTime();
Filter filter = Filter.ge("lastRefresh",startDate);
  QueryOptions qo = new QueryOptions();
  qo.addFilter(filter);
  
Iterator it = context.search(Identity.class,qo);
while(it.nasNext()){
Identity id = it.next();
identityName.add(id.getName())
}
return identityName;