protected void handleVisitQuery(QueryResult query, File target) throws Exception { String source = null; for (SObject so : query.getRecords()) { source = visitFormatter.format((VisitReportC) so); this.write(target, source); } }
@Override public void postInit() { tripFormatter.init(); visitFormatter.init(); // visitFormatter.getSubParsers().add(cusFormatter); }
public void doReceive(SfSqlConfig config, Job job) { File target = new File(job.getAbsolutePath()); String queryString = null; QueryResult query = null; try { queryString = tripFormatter.genSfSQL(config); logger.info(queryString); query = this.soap.query(queryString, this.sh, null, null, null); this.handleTripQuery(query, target); while (!query.getDone()) { query = this.soap.queryMore(query.getQueryLocator(), this.sh, null); this.handleTripQuery(query, target); } queryString = visitFormatter.genSfSQL(config); logger.info(queryString); query = this.soap.query(queryString, this.sh, null, null, null); this.handleVisitQuery(query, target); while (!query.getDone()) { query = this.soap.queryMore(query.getQueryLocator(), this.sh, null); this.handleVisitQuery(query, target); } } catch (Exception e) { e.printStackTrace(); } }