Thursday, 29 March 2018

OIM API - Code Snippet to get the Resource Object Name by the Application Instance Name.

 public String getResourceObjectName(String appInstName){
        final String logp = CN + " ::
getResourceObjectName() - ";
        logger.info(logp + "START");

        ApplicationInstanceService appService = Platform.getService(ApplicationInstanceService.class);
        ApplicationInstance appInst;
        try{
            appInst = appService.findApplicationInstanceByName(appInstName);
            String resourceObjectName = appInst.getObjectName();

            logger.info(logp + "Resource Object Name :" + resourceObjectName);
           
        }catch(ApplicationInstanceNotFoundException e){
            LOGGER.error(logp + "Exception while getting Resource Object Name " + e, e);
        }catch(GenericAppInstanceServiceException e){
            LOGGER.error(logp + "Exception while getting Resource Object Name " + e, e);
        }

        logger.info(logp + "END");
        return resourceObjectName;
 }


Happy Learning!!!

No comments:

Post a Comment