Wednesday, 20 June 2012

How to verify if a given lookup is present in OIM or not

   public static boolean lookupExists(String lookupName)
   {
        boolean lookupExists = false;
        tcLookupOperationsIntf lookupOpsIntf = null;
        tcResultSet lookupResSet = null;
        try
        {
           lookupOpsIntf=Platform.getService(tcLookupOperationsIntf.class);
           lookupResSet = lookupOpsIntf.getLookupValues(lookupName);
           lookupExists = true;
        }
        catch (tcInvalidLookupException invalidLookupEx)
        {
            //print Exception
            return false;
        }
        catch (Exception e)
        {
            //print Exception
        }
        finally
        {
            if (lookupOpsIntf != null)
            {
                lookupOpsIntf.close();
            }
           
        }
       
        return lookupExists;
    }

No comments:

Post a Comment