OIM Update Organizations Details API


  1. package com.oimacademy.orgs;
  2. import java.util.HashMap;
  3. import oracle.iam.identity.orgmgmt.api.OrganizationManager;
  4. import oracle.iam.identity.orgmgmt.api.OrganizationManagerConstants;
  5. import oracle.iam.identity.orgmgmt.vo.Organization;
  6. import oracle.iam.platform.OIMClient;
  7. import com.oimacademy.connection.OIMConnection;
  8. import com.oimacademy.password.PasswordPolicy;
  9. public class UpdateOrganizations {
  10.  protected static OIMClient platform = OIMConnection.getConnection();
  11.  protected static OrganizationManager m_orgManagerService =(OrganizationManager) platform.getService(OrganizationManager.class);
  12.  public static String updateOrgPasswordPolicy(String orgKey) throws Exception {
  13.      String result =null;
  14.      HashMap<String, Object> updateAttributes = new HashMap<String, Object>();
  15.      updateAttributes.put(OrganizationManagerConstants.AttributeName.ORG_PASSWORD_POLICY_KEY.getId(),PasswordPolicy.passwordPolicyCreate());
  16.   //updateAttributes.put(OrganizationManagerConstants.AttributeName.ORG_PASSWORD_POLICY_NAME.getId(), "PasswordPolicy90");
  17.      result= m_orgManagerService.modify(new Organization(orgKey,updateAttributes));   
  18.      System.out.println("updateOrgPasswordPolicy with result -> "+result);
  19.      return orgKey;
  20.    }  
  21. }

No comments:

Post a Comment