HAPPY NEW YEAR 2017

Identity And Access Management - Rajiv Dewan

IT Resource Parameters API Source Code

Here's the method to print data from IT Resource:

 /**
     * @param itResourceName   IT Resource Name
     * @param itResourceInstanceOperationsIntf
     * @throws Exception
     */

    private void printITResourceData(String itResourceName, tcITResourceInstanceOperationsIntf itResourceInstanceOperationsIntf) throws Exception {
        System.out.println("Printing IT Resource Data :: " + itResourceName);
        HashMap itresMap = new HashMap();
        itresMap.put("IT Resources.Name", itResourceName);
        tcResultSet findITResourceResult = itResourceInstanceOperationsIntf
                .findITResourceInstances(itresMap);
        int findITResourceResultCount = findITResourceResult.getRowCount();
        System.out.println("findITResourceResultCount :: " + findITResourceResultCount);
        for (int i = 0; i < findITResourceResultCount; i++) {
            findITResourceResult.goToRow(i);
            long itResourceKey = findITResourceResult.getLongValue("IT Resources.Key");
            System.out.println("itResourceKey :: " + itResourceKey);
            tcResultSet itResourceParameters = itResourceInstanceOperationsIntf.getITResourceInstanceParameters(itResourceKey);
            for (int j = 0; j < itResourceParameters.getRowCount(); j++) {
                itResourceParameters.goToRow(j);
                String name = itResourceParameters.getStringValue("IT Resources Type Parameter.Name");
                String value = itResourceParameters.getStringValue("IT Resources Type Parameter Value.Value");
                System.out.println(name + " --> " + value);
            }
        }
        System.out.println("COMPLETED");
    }

No comments:

Post a Comment