OIM API To SearchAccountsForUser


  1. package com.oimacademy.NeedEvaluate;
  2. import java.util.HashMap;
  3. import java.util.HashSet;
  4. import java.util.Map;
  5. import java.util.Set;
  6. import oracle.iam.platform.entitymgr.vo.SearchCriteria;
  7. import oracle.iam.provisioning.api.ProvisioningConstants;
  8. import oracle.iam.provisioning.api.ProvisioningServiceInternal;
  9. import oracle.iam.provisioning.impl.ProvisioningServiceInternalImpl;
  10. import com.oimacademy.connection.Platform;
  11. public class SearchAccountsForUser {
  12.  private static ProvisioningServiceInternal provisioningServiceInt=Platform.getService(ProvisioningServiceInternal.class);
  13.  public static void main(String[] args) {
  14.    Set<String> userKeys = new HashSet<String>();
  15.     userKeys.add("14");
  16.    Map<String, String> controls = new HashMap<String, String>();
  17.    controls.put("Auditable", "false");
  18.    SearchCriteria userSearchCriteria = new SearchCriteria(ProvisioningConstants.AccountSearchAttribute.USER_ID.getId(), userKeys, SearchCriteria.Operator.IN);
  19.    SearchCriteria appInstSearchCriteria = new SearchCriteria(ProvisioningConstants.AccountSearchAttribute.APPINST_ID.getId(), "62", SearchCriteria.Operator.EQUAL);
  20.    SearchCriteria sc = new SearchCriteria(userSearchCriteria, appInstSearchCriteria, SearchCriteria.Operator.AND);   
  21.    provisioningServiceInt.searchAccounts(sc, controls);
  22.  }
  23. }

No comments:

Post a Comment