import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import com.connection.Platform; import oracle.iam.identity.exception.UserSearchException; import oracle.iam.identity.usermgmt.api.UserManager; import oracle.iam.identity.usermgmt.api.UserManagerConstants; import oracle.iam.identity.usermgmt.vo.User; import oracle.iam.platform.authz.exception.AccessDeniedException; import oracle.iam.platform.entitymgr.vo.SearchCriteria; public class SearchUsers { public static void main(String args[]) throws UserSearchException, AccessDeniedException, ParseException{ UserManager userManager = (UserManager) Platform.getService(UserManager.class); Date date = new Date(); long DAY_IN_MS = 1000 * 60 * 60 * 24; Date date1 = new Date(date.getTime() - (6*DAY_IN_MS)); // Change value of 6 to how many days less you want. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String onlyDate = sdf.format(date1); System.out.println(" Date -> "+onlyDate); SearchCriteria criteria = new SearchCriteria(UserManagerConstants.AttributeName.USER_UPDATE.getId(), onlyDate, SearchCriteria.Operator.LESS_THAN); // Try with GREATER_THAN,GREATER_EQUAL,LESS_THAN,LESS_EQUAL,NOT_EQUAL,EQUAL //Note Equal and Not-EQUAL works for Date only not timestamp even if you pass TimeStamp. List<User> users = userManager.search(criteria, null, null); System.out.println("Size of users -> "+users.size()); for(User user: users){ System.out.println(user.getAttribute("usr_update")); } } }
Oracle Identity Manager (OIM R2PS2/PS3/12C) is a highly flexible and scalable enterprise identity administration system that provides operational and business efficiency by providing centralized administration & complete automation of identity and user provisioning events across enterprise as well as extranet applications.
OIM API To Search Users based on USER_UPDATE Column
Subscribe to:
Posts (Atom)
About OIM
Oracle Identity Management enables organizations to effectively manage the end - to - end life - cycle of user ide...
Popular Posts
-
OIM API's Sample Code : Videos: Massive Gaze Videos Connection Related API's : OIM DB Connection/ Data Source connection ...
-
Videos: Massive Gaze Videos 1. Basic OIM Information 2. MDS Export/Import 3. Steps For R2PS2 / R2PS3 Custom Pre-processor Ev...
-
Videos: Massive Gaze Videos 1. Query to get OIM Provsioned/provisioning Account details 2. Query to get usr keys For Rejected / ...
No comments:
Post a Comment