OIM API to get System Configuration Data


  1. package com.oimacademy.test;
  2. import com.oimacademy.connection.Platform;
  3. import oracle.iam.conf.api.SystemConfigurationService;
  4. import oracle.iam.conf.vo.SystemProperty;
  5. public class GetSystemConfiguration {
  6.  public static void main(String args[]){
  7.   System.out.println("******** "+checkPropertyValue("XL.UserDeleteDelayPeriod"));
  8.  }
  9.  private static int checkPropertyValue(String property){
  10.         try{
  11.             SystemConfigurationService sysConfig = Platform.getService(SystemConfigurationService.class);
  12.             SystemProperty prop =sysConfig.getSystemProperty(property);            
  13.             int value = Integer.parseInt(prop.getPtyValue());
  14.             System.out.println(" Value : "+ value);
  15.                 return value;                                
  16.             }catch(Exception e){
  17.                 System.out.println("Error while checking Delay Delete User Property XL.UserDeleteDelayPeriod");       
  18.                 e.printStackTrace();
  19.             }        
  20.         return 0;
  21.     }
  22. }

No comments:

Post a Comment