Announcement Announcement Module
No announcement yet.
ldaptemplate search using timestamp Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ldaptemplate search using timestamp

    I was trying to write a ldaptemplate search that would return all uid's that have been a member of a role for a number of days. Ex: Return all users that have been a member of role 'inactive' for '30' days.

    I have the role part working but I'm not sure how to check the timestamp attribute that contains the number days in role and see if they've been in it for 30 days.

    expiredTime = currentdate + 30 days.

    List<String> list ="",
    "(&(objectClass=person)" +
    "(&(member=cn=inactive,ou=roles,dc=h,dc=com)" +
    new AbstractContextMapper() {
    protected Object
    doMapFromContext(DirContextOperations ctx) {
    return ctx.getStringAttribute("uid");

    Can this be done in an '' without first returning the 'RoleChangedTime', adding 30 days to this timestamp value and then comparing it to the current date?