예제 #1
0
  private boolean transferData(DBRProgressMonitor monitor, DataTransferPipe transferPipe) {
    IDataTransferProducer producer = transferPipe.getProducer();
    IDataTransferConsumer consumer = transferPipe.getConsumer();

    IDataTransferSettings consumerSettings = settings.getNodeSettings(consumer);

    setName(
        NLS.bind(
            CoreMessages.data_transfer_wizard_job_container_name,
            CommonUtils.truncateString(producer.getSourceObject().getName(), 200)));

    IDataTransferSettings nodeSettings = settings.getNodeSettings(producer);
    try {
      // consumer.initTransfer(producer.getSourceObject(), consumerSettings, );

      producer.transferData(monitor, consumer, nodeSettings);
      consumer.finishTransfer(monitor, false);
      return true;
    } catch (Exception e) {
      new DataTransferErrorJob(e).schedule();
      return false;
    }
  }
예제 #2
0
 @Override
 protected IStatus run(DBRProgressMonitor monitor) {
   boolean hasErrors = false;
   long startTime = System.currentTimeMillis();
   for (; ; ) {
     DataTransferPipe transferPipe = settings.acquireDataPipe(monitor);
     if (transferPipe == null) {
       break;
     }
     if (!transferData(monitor, transferPipe)) {
       hasErrors = true;
     }
   }
   showResult(System.currentTimeMillis() - startTime, hasErrors);
   return Status.OK_STATUS;
 }