Search Role Key based on Role Name in OIM11gR2-
==================================================================
public String searchRolekey(String roleName)
{
System.out.println("************Inside Fetch Role***************");
Thor.API.Operations.tcGroupOperationsIntf _groupService = oimClient.getService(Thor.API.Operations.tcGroupOperationsIntf.class);
HashMap<String, String> roleMap = new HashMap<String, String>();
System.out.println("*********Role Name is*********: "+roleName);
roleMap.put("Groups.Role Name", roleName);
String roleKey="";
tcResultSet roleResultSet = null;
try {
roleResultSet = _groupService.findGroups(roleMap);
//String[] CNameforRole=roleResultSet.getColumnNames();
groupKey = roleResultSet.getStringValue("Groups.Key");
System.out.println("********Role key is********: "+groupKey);
}
catch (tcColumnNotFoundException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (tcAPIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return roleKeyKey;
}
==================================================================
public String searchRolekey(String roleName)
{
System.out.println("************Inside Fetch Role***************");
Thor.API.Operations.tcGroupOperationsIntf _groupService = oimClient.getService(Thor.API.Operations.tcGroupOperationsIntf.class);
HashMap<String, String> roleMap = new HashMap<String, String>();
System.out.println("*********Role Name is*********: "+roleName);
roleMap.put("Groups.Role Name", roleName);
String roleKey="";
tcResultSet roleResultSet = null;
try {
roleResultSet = _groupService.findGroups(roleMap);
//String[] CNameforRole=roleResultSet.getColumnNames();
groupKey = roleResultSet.getStringValue("Groups.Key");
System.out.println("********Role key is********: "+groupKey);
}
catch (tcColumnNotFoundException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (tcAPIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return roleKeyKey;
}
No comments:
Post a Comment