public Collection<Class<?>> getObjectTypes() {
   List<DataTransferPipe> dataPipes = getDataPipes();
   Set<Class<?>> objectTypes = new HashSet<>();
   for (DataTransferPipe transferPipe : dataPipes) {
     if (transferPipe.getProducer() != null) {
       objectTypes.add(transferPipe.getProducer().getSourceObject().getClass());
     }
   }
   return objectTypes;
 }
Esempio n. 2
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;
    }
  }
 void selectConsumer(
     DataTransferNodeDescriptor consumer, DataTransferProcessorDescriptor processor) {
   this.consumer = consumer;
   this.processor = processor;
   if (consumer != null && processor != null) {
     if (!processorPropsHistory.containsKey(processor)) {
       processorPropsHistory.put(processor, new HashMap<>());
     }
   }
   // Configure pipes
   for (DataTransferPipe pipe : dataPipes) {
     if (consumer != null) {
       try {
         pipe.setConsumer((IDataTransferConsumer) consumer.createNode());
       } catch (DBException e) {
         log.error(e);
         pipe.setConsumer(null);
       }
     } else {
       pipe.setConsumer(null);
     }
   }
 }