Пример #1
0
 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);
   }
 }
Пример #2
0
  @Override
  public void postInit() {
    tripFormatter.init();
    visitFormatter.init();

    //		visitFormatter.getSubParsers().add(cusFormatter);
  }
Пример #3
0
  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();
    }
  }