Example usage for java.util.logging Logger log

List of usage examples for java.util.logging Logger log

Introduction

In this page you can find the example usage for java.util.logging Logger log.

Prototype

public void log(Level level, Throwable thrown, Supplier<String> msgSupplier) 

Source Link

Document

Log a lazily constructed message, with associated Throwable information.

Usage

From source file:edu.emory.cci.aiw.i2b2etl.dest.I2b2QueryResultsHandler.java

/**
 * Builds most of the concept tree, truncates the data tables, opens a
 * connection to the i2b2 project database, and does some other prep. This
 * method is called before the first call to
 * {@link #handleQueryResult(String, java.util.List, java.util.Map, java.util.Map, java.util.Map)}.
 *
 * @throws QueryResultsHandlerProcessingException
 *//*  w w  w  .  j a  va  2  s  .  c  o  m*/
@Override
public void start(Collection<PropositionDefinition> propDefs) throws QueryResultsHandlerProcessingException {
    Logger logger = I2b2ETLUtil.logger();
    try {
        this.conceptDimensionHandler = new ConceptDimensionHandler(dataConnectionSpec);
        this.modifierDimensionHandler = new ModifierDimensionHandler(dataConnectionSpec);
        this.cache = new KnowledgeSourceCacheFactory().getInstance(this.knowledgeSource, propDefs, true);
        this.metadata = new MetadataFactory().getInstance(this.qrhId, this.cache, knowledgeSource,
                collectUserPropositionDefinitions(), this.conceptsSection.getFolderSpecs(), settings, this.data,
                this.metadataConnectionSpec);
        this.providerDimensionFactory = new ProviderDimensionFactory(this.metadata, this.settings,
                this.dataConnectionSpec);
        this.patientDimensionFactory = new PatientDimensionFactory(this.metadata, this.settings, this.data,
                this.dataConnectionSpec);
        this.visitDimensionFactory = new VisitDimensionFactory(this.metadata, this.settings, this.data,
                this.dataConnectionSpec);
        DataRemoverFactory f = new DataRemoverFactory();
        if (this.query.getQueryMode() == QueryMode.REPLACE) {
            f.getInstance(this.dataRemoveMethod).doRemoveData();
        }
        f.getInstance(this.metaRemoveMethod).doRemoveMetadata();
        this.factHandlers = new ArrayList<>();
        addPropositionFactHandlers();
        executePreHook();
        // disable indexes on observation_fact to speed up inserts
        disableObservationFactIndexes();
        // create i2b2 temporary tables using stored procedures
        truncateTempTables();
        this.dataSchemaConnection = openDataDatabaseConnection();

        if (this.settings.getManageCTotalNum()) {
            try (Connection conn = openMetadataDatabaseConnection()) {
                try (Statement stmt = conn.createStatement();
                        ResultSet rs = stmt.executeQuery("SELECT DISTINCT C_TABLE_NAME FROM TABLE_ACCESS")) {
                    while (rs.next()) {
                        String tableName = rs.getString(1);
                        try (CallableStatement mappingCall = conn
                                .prepareCall("{ call EUREKA.EK_CLEAR_C_TOTALNUM(?) }")) {
                            logger.log(Level.INFO, "Clearing C_TOTALNUM for query {0}", this.query.getName());
                            mappingCall.setString(1, tableName);
                            mappingCall.execute();
                            //commit and rollback are called by stored procedure.
                        }
                    }
                }
            }
        }
        logger.log(Level.INFO, "Populating observation facts table for query {0}", this.query.getName());
    } catch (KnowledgeSourceReadException | SQLException | OntologyBuildException ex) {
        throw new QueryResultsHandlerProcessingException("Error during i2b2 load", ex);
    }
}

From source file:com.grameenfoundation.ictc.controllers.FarmManagementPlanController.java

/**
 * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 * methods./*from w  ww  . j a v  a  2 s  .  c  om*/
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    Logger log = Logger.getLogger(FarmManagementPlanController.class.getName());
    BiodataModel biodataModel = new BiodataModel();
    String theString = IOUtils.toString(request.getInputStream(), "UTF-8");
    System.out.println("Salesforce data/n " + theString);
    Transaction tx;
    tx = ICTCDBUtil.getInstance().getGraphDB().beginTx();
    org.neo4j.graphdb.Node farmManagementPlanParent;
    try (PrintWriter out = response.getWriter()) {

        System.out.println(" " + request.getContentType());

        DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        InputSource is = new InputSource();
        is.setCharacterStream(new StringReader(theString));
        System.out.println("After parsing XML");
        Document doc = db.parse(is);
        System.out.println("Should be normalised now");
        doc.getDocumentElement().normalize();

        Element ele = doc.getDocumentElement();
        //System.out.println("Root element :" + doc.getDocumentElement());
        Node node = doc.getDocumentElement();

        System.out.println("Root element " + doc.getDocumentElement());

        //get fields from objects
        NodeList sObject = doc.getElementsByTagName("sObject");
        // String farmerID = getXmlNodeValue("sf:Farmer_name__c",ele);

        for (int j = 0; j < sObject.getLength(); j++) {

            Node rowNode = sObject.item(j);
            //  Map<String,String> m = (Map<String,String>) rowNode.getAttributes();
            String salesforceObj = rowNode.getAttributes().getNamedItem("xsi:type").getNodeValue();
            System.out.println(salesforceObj);
            String farmerID = getXmlNodeValue("sf:Farmer_name__c", ele);
            System.out.println("farmerid " + farmerID);
            org.neo4j.graphdb.Node FMPNode = ICTCDBUtil.getInstance().getGraphDB()
                    .createNode(Labels.FARM_MANAGEMENT_PLAN);
            for (int k = 0; k < rowNode.getChildNodes().getLength(); k++) {

                //System.out.println("node: " + rowNode.getChildNodes().item(k).getNodeName() + ": " + rowNode.getChildNodes().item(k).getTextContent());
                if (rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")) {
                    System.out
                            .println("id : " + getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()));
                    FMPNode.setProperty(getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()),
                            rowNode.getChildNodes().item(k).getTextContent());
                }

                if (!rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")
                        && !rowNode.getChildNodes().item(k).getNodeName().equals("#text")) {

                    System.out.println(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()));
                    FMPNode.setProperty(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()),
                            rowNode.getChildNodes().item(k).getTextContent());

                }
            }

            farmManagementPlanParent = ParentNode.FMPlanParentNode();
            farmManagementPlanParent.createRelationshipTo(FMPNode, ICTCRelationshipTypes.FARM_MANAGEMENT_PLAN);

            log.log(Level.INFO, "new node created {0}", FMPNode.getId());
            Biodata b = biodataModel.getBiodata("Id", farmerID);

            biodataModel.BiodataToFMP(b.getId(), FMPNode);

            tx.success();

            out.println(sendAck());

        }

    } catch (ParserConfigurationException ex) {
        Logger.getLogger(FarmManagementPlanController.class.getName()).log(Level.SEVERE, null, ex);
        tx.failure();
    } catch (SAXException ex) {
        tx.failure();
        Logger.getLogger(FarmManagementPlanController.class.getName()).log(Level.SEVERE, null, ex);
    } finally {

        tx.finish();
    }
}

From source file:com.grameenfoundation.ictc.controllers.SaleforceIntegrationController.java

/**
 * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 * methods./*from   ww  w.  j  a va  2s .c  om*/
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    Logger log = Logger.getLogger(SaleforceIntegrationController.class.getName());
    response.setContentType("text/xml;charset=UTF-8");
    BiodataModel biodataModel = new BiodataModel();
    try (PrintWriter out = response.getWriter()) {
        /* TODO output your page here. You may use following sample code. */

        String theString = IOUtils.toString(request.getInputStream(), "UTF-8");
        System.out.println("Salesforce data/n " + theString);
        //gets request input stream
        InputStream in = request.getInputStream();
        InputSource input = null;
        Transaction tx;
        tx = ICTCDBUtil.getInstance().getGraphDB().beginTx();
        org.neo4j.graphdb.Node FarmerParent;

        try {

            System.out.println(" " + request.getContentType());

            DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            InputSource is = new InputSource();
            is.setCharacterStream(new StringReader(theString));
            System.out.println("After parsing XML");
            Document doc = db.parse(is);
            System.out.println("Should be normalised now");
            doc.getDocumentElement().normalize();

            Element ele = doc.getDocumentElement();
            //System.out.println("Root element :" + doc.getDocumentElement());
            Node node = doc.getDocumentElement();

            System.out.println("Root element " + doc.getDocumentElement());

            //get fields from objects
            NodeList sObject = doc.getElementsByTagName("sObject");

            for (int j = 0; j < sObject.getLength(); j++) {

                Node rowNode = sObject.item(j);
                //  Map<String,String> m = (Map<String,String>) rowNode.getAttributes();
                String salesforceObj = rowNode.getAttributes().getNamedItem("xsi:type").getNodeValue();
                System.out.println(salesforceObj);

                if (salesforceObj.equalsIgnoreCase("sf:Farmer_Biodata__c")) {
                    org.neo4j.graphdb.Node biodataNode = ICTCDBUtil.getInstance().getGraphDB()
                            .createNode(Labels.FARMER);
                    for (int k = 0; k < rowNode.getChildNodes().getLength(); k++) {

                        // System.out.println("node: " + rowNode.getChildNodes().item(k).getNodeName() + ": " + rowNode.getChildNodes().item(k).getTextContent());
                        if (rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")) {
                            System.out.println(
                                    "id : " + getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()));
                            biodataNode.setProperty(
                                    getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());
                        }

                        if (!rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")
                                && !rowNode.getChildNodes().item(k).getNodeName().equals("#text")) {

                            System.out
                                    .println(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()));
                            biodataNode.setProperty(
                                    getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());

                        }
                    }

                    FarmerParent = ParentNode.FarmerParentNode();
                    FarmerParent.createRelationshipTo(biodataNode, ICTCRelationshipTypes.FARMER);

                    log.log(Level.INFO, "new node created {0}", biodataNode.getId());
                    tx.success();

                    out.println(sendAck());
                } else if (salesforceObj.equals("sf:Harvest__c")) {
                    org.neo4j.graphdb.Node HarvestParent;
                    org.neo4j.graphdb.Node harvestNode = ICTCDBUtil.getInstance().getGraphDB()
                            .createNode(Labels.HARVEST);

                    String farmerID = getXmlNodeValue("sf:Farmer_Biodata__c", ele);
                    System.out.println("farmerid " + farmerID);
                    for (int k = 0; k < rowNode.getChildNodes().getLength(); k++) {

                        //System.out.println("node: " + rowNode.getChildNodes().item(k).getNodeName() + ": " + rowNode.getChildNodes().item(k).getTextContent());
                        if (rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")) {
                            System.out.println(
                                    "id : " + getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()));
                            harvestNode.setProperty(
                                    getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());
                        }

                        if (!rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")
                                && !rowNode.getChildNodes().item(k).getNodeName().equals("#text") && !rowNode
                                        .getChildNodes().item(k).getNodeName().equals("sf:Farmer_Biodata__c")) {

                            System.out
                                    .println(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()));
                            harvestNode.setProperty(
                                    getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());

                        }
                    }

                    HarvestParent = ParentNode.HarvestParentNode();
                    HarvestParent.createRelationshipTo(harvestNode, ICTCRelationshipTypes.HARVEST);

                    log.log(Level.INFO, "new node created {0}", harvestNode.getId());

                    Biodata b = biodataModel.getBiodata("Id", farmerID);

                    biodataModel.BiodataToHarvest(b.getId(), harvestNode);

                    tx.success();

                    out.println(sendAck());
                } else if (salesforceObj.equals("sf:FarmManagement__c")) {
                    org.neo4j.graphdb.Node FarmManagementParent;
                    org.neo4j.graphdb.Node FarmManagementNode = ICTCDBUtil.getInstance().getGraphDB()
                            .createNode(Labels.FARM_MANAGEMENT);

                    String farmerID = getXmlNodeValue("sf:Farmer_Biodata__c", ele);
                    System.out.println("farmerid " + farmerID);
                    for (int k = 0; k < rowNode.getChildNodes().getLength(); k++) {

                        //System.out.println("node: " + rowNode.getChildNodes().item(k).getNodeName() + ": " + rowNode.getChildNodes().item(k).getTextContent());
                        if (rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")) {
                            System.out.println(
                                    "id : " + getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()));
                            FarmManagementNode.setProperty(
                                    getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());
                        }

                        if (!rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")
                                && !rowNode.getChildNodes().item(k).getNodeName().equals("#text") && !rowNode
                                        .getChildNodes().item(k).getNodeName().equals("sf:Farmer_Biodata__c")) {

                            System.out
                                    .println(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()));
                            FarmManagementNode.setProperty(
                                    getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());

                        }
                    }

                    FarmManagementParent = ParentNode.FMParentNode();
                    FarmManagementParent.createRelationshipTo(FarmManagementNode,
                            ICTCRelationshipTypes.FARM_MANAGEMENT);

                    log.log(Level.INFO, "new node created {0}", FarmManagementNode.getId());

                    Biodata b = biodataModel.getBiodata("Id", farmerID);

                    biodataModel.BiodataToFarmManagement(b.getId(), FarmManagementNode);

                    tx.success();

                    out.println(sendAck());
                } else if (salesforceObj.equals("sf:FarmOperations__c")) {
                    org.neo4j.graphdb.Node FarmOperationParent;
                    org.neo4j.graphdb.Node FarmOperationNode = ICTCDBUtil.getInstance().getGraphDB()
                            .createNode(Labels.FARM_OPERATION);

                    String farmerID = getXmlNodeValue("sf:Farmer_Biodata__c", ele);
                    System.out.println("farmerid " + farmerID);
                    for (int k = 0; k < rowNode.getChildNodes().getLength(); k++) {

                        //System.out.println("node: " + rowNode.getChildNodes().item(k).getNodeName() + ": " + rowNode.getChildNodes().item(k).getTextContent());
                        if (rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")) {
                            System.out.println(
                                    "id : " + getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()));
                            FarmOperationNode.setProperty(
                                    getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());
                        }

                        if (!rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")
                                && !rowNode.getChildNodes().item(k).getNodeName().equals("#text") && !rowNode
                                        .getChildNodes().item(k).getNodeName().equals("sf:Farmer_Biodata__c")) {

                            System.out
                                    .println(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()));
                            FarmOperationNode.setProperty(
                                    getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());

                        }
                    }

                    FarmOperationParent = ParentNode.OperationsParentNode();
                    FarmOperationParent.createRelationshipTo(FarmOperationNode,
                            ICTCRelationshipTypes.FARM_OPERATION);

                    log.log(Level.INFO, "new node created {0}", FarmOperationNode.getId());

                    Biodata b = biodataModel.getBiodata("Id", farmerID);

                    biodataModel.BiodataToOperations(b.getId(), FarmOperationNode);

                    tx.success();

                    out.println(sendAck());
                } else if (salesforceObj.equals("sf:Marketing__c")) {
                    org.neo4j.graphdb.Node MarketingParent;
                    org.neo4j.graphdb.Node MarketingNode = ICTCDBUtil.getInstance().getGraphDB()
                            .createNode(Labels.MARKETING);

                    String farmerID = getXmlNodeValue("sf:Farmer_Biodata__c", ele);
                    System.out.println("farmerid " + farmerID);
                    for (int k = 0; k < rowNode.getChildNodes().getLength(); k++) {

                        //System.out.println("node: " + rowNode.getChildNodes().item(k).getNodeName() + ": " + rowNode.getChildNodes().item(k).getTextContent());
                        if (rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")) {
                            System.out.println(
                                    "id : " + getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()));
                            MarketingNode.setProperty(
                                    getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());
                        }

                        if (!rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")
                                && !rowNode.getChildNodes().item(k).getNodeName().equals("#text") && !rowNode
                                        .getChildNodes().item(k).getNodeName().equals("sf:Farmer_Biodata__c")) {

                            System.out
                                    .println(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()));
                            MarketingNode.setProperty(
                                    getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());

                        }
                    }

                    MarketingParent = ParentNode.MarketingParentNode();
                    MarketingParent.createRelationshipTo(MarketingNode, ICTCRelationshipTypes.MARKETING);

                    log.log(Level.INFO, "new node created {0}", MarketingNode.getId());

                    Biodata b = biodataModel.getBiodata("Id", farmerID);

                    biodataModel.BiodataToMarketing(b.getId(), MarketingNode);

                    tx.success();

                    out.println(sendAck());
                } else if (salesforceObj.equals("sf:PostHarvest__c")) {
                    org.neo4j.graphdb.Node PostHarvestParent;
                    org.neo4j.graphdb.Node PostHarvestNode = ICTCDBUtil.getInstance().getGraphDB()
                            .createNode(Labels.POSTHARVEST);

                    String farmerID = getXmlNodeValue("sf:Farmer_Biodata__c", ele);
                    System.out.println("farmerid " + farmerID);
                    for (int k = 0; k < rowNode.getChildNodes().getLength(); k++) {

                        // System.out.println("node: " + rowNode.getChildNodes().item(k).getNodeName() + ": " + rowNode.getChildNodes().item(k).getTextContent());
                        if (rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")) {
                            System.out.println(
                                    "id : " + getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()));
                            PostHarvestNode.setProperty(
                                    getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());
                        }

                        if (!rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")
                                && !rowNode.getChildNodes().item(k).getNodeName().equals("#text") && !rowNode
                                        .getChildNodes().item(k).getNodeName().equals("sf:Farmer_Biodata__c")) {

                            System.out
                                    .println(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()));
                            PostHarvestNode.setProperty(
                                    getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());

                        }
                    }

                    PostHarvestParent = ParentNode.PostHarvestParentNode();
                    PostHarvestParent.createRelationshipTo(PostHarvestNode, ICTCRelationshipTypes.POST_HARVEST);

                    log.log(Level.INFO, "new node created {0}", PostHarvestNode.getId());

                    Biodata b = biodataModel.getBiodata("Id", farmerID);

                    biodataModel.BiodataToPostHarvest(b.getId(), PostHarvestNode);

                    tx.success();

                    out.println(sendAck());
                } else if (salesforceObj.equals("sf:Storage__c")) {
                    org.neo4j.graphdb.Node StorageParent;
                    org.neo4j.graphdb.Node StorageNode = ICTCDBUtil.getInstance().getGraphDB()
                            .createNode(Labels.STORAGE);

                    String farmerID = getXmlNodeValue("sf:Farmer_Biodata__c", ele);
                    System.out.println("farmerid " + farmerID);
                    for (int k = 0; k < rowNode.getChildNodes().getLength(); k++) {

                        System.out.println("node: " + rowNode.getChildNodes().item(k).getNodeName() + ": "
                                + rowNode.getChildNodes().item(k).getTextContent());
                        if (rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")) {
                            System.out.println(
                                    "id : " + getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()));
                            StorageNode.setProperty(
                                    getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());
                        }

                        if (!rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")
                                && !rowNode.getChildNodes().item(k).getNodeName().equals("#text") && !rowNode
                                        .getChildNodes().item(k).getNodeName().equals("sf:Farmer_Biodata__c")) {

                            System.out
                                    .println(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()));
                            StorageNode.setProperty(
                                    getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());

                        }
                    }

                    StorageParent = ParentNode.StorageParentNode();
                    StorageParent.createRelationshipTo(StorageNode, ICTCRelationshipTypes.STORAGE);

                    log.log(Level.INFO, "new node created {0}", StorageNode.getId());

                    Biodata b = biodataModel.getBiodata("Id", farmerID);

                    biodataModel.BiodataToStorage(b.getId(), StorageNode);

                    tx.success();

                    out.println(sendAck());
                }

                else if (salesforceObj.equals("sf:TechnicalNeeds__c")) {
                    org.neo4j.graphdb.Node TNParent;
                    org.neo4j.graphdb.Node TNNode = ICTCDBUtil.getInstance().getGraphDB()
                            .createNode(Labels.TECHNICAL_NEEDS);

                    String farmerID = getXmlNodeValue("sf:Farmer_Biodata__c", ele);
                    System.out.println("farmerid " + farmerID);
                    for (int k = 0; k < rowNode.getChildNodes().getLength(); k++) {

                        System.out.println("node: " + rowNode.getChildNodes().item(k).getNodeName() + ": "
                                + rowNode.getChildNodes().item(k).getTextContent());
                        if (rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")) {
                            System.out.println(
                                    "id : " + getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()));
                            TNNode.setProperty(getObjectFieldId(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());
                        }

                        if (!rowNode.getChildNodes().item(k).getNodeName().equals("sf:Id")
                                && !rowNode.getChildNodes().item(k).getNodeName().equals("#text") && !rowNode
                                        .getChildNodes().item(k).getNodeName().equals("sf:Farmer_Biodata__c")) {

                            System.out
                                    .println(getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()));
                            TNNode.setProperty(
                                    getObjectFieldName(rowNode.getChildNodes().item(k).getNodeName()),
                                    rowNode.getChildNodes().item(k).getTextContent());

                        }
                    }

                    TNParent = ParentNode.TechNeedParentNode();
                    TNParent.createRelationshipTo(TNNode, ICTCRelationshipTypes.TECHNICAL_NEED);

                    log.log(Level.INFO, "new node created {0}", TNNode.getId());

                    Biodata b = biodataModel.getBiodata("Id", farmerID);

                    biodataModel.BiodataToTechNeeds(b.getId(), TNNode);

                    tx.success();

                    out.println(sendAck());
                }

            }

        } catch (Exception ex) {
            Logger.getLogger(SaleforceIntegrationController.class.getName()).log(Level.SEVERE, null, ex);
            tx.failure();
        } finally {
            tx.finish();
        }

    }
}