OIM API To create Role/Roles

package com.massiveGaze.role;

import com.massiveGaze.connection.Platform;

import oracle.iam.identity.rolemgmt.api.RoleManager;
import oracle.iam.identity.rolemgmt.vo.Role;

public class CreateRoles {

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  new CreateRoles(). createRolesinOIM();
 }
 public void createRolesinOIM(){
  
   try{
             RoleManager rm = Platform.getService(RoleManager.class);
             for (int i=2;i<3;i++){
                 Role r = new Role("test"+i);
                 r.setName("test"+i);
                 r.setDisplayName("test"+i);
                 r.setDescription("Load roles..!");
                 rm.create(r);
                 System.out.println(i);
             }
         }catch (Exception e){
             e.printStackTrace();
         }
 }
 public static String createRole(){
  String roleKey="";
   try{
             RoleManager rm = Platform.getService(RoleManager.class);          
                 Role r = new Role("TestRole");
                 r.setName("TestRole");
                 r.setDisplayName("TestRole");
                 r.setDescription("Load roles..!");
                 rm.create(r);
                 //System.out.println(i);
           
         }catch (Exception e){
             e.printStackTrace();
         }
   return roleKey;
 }

}

No comments:

Post a Comment

About OIM

Oracle Identity Management enables organizations to effectively manage the end - to - end life - cycle of user ide...

Popular Posts