use of org.jkiss.dbeaver.tools.transfer.IDataTransferSettings in project dbeaver by serge-rider.
the class DataTransferJob method transferData.
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;
}
}
use of org.jkiss.dbeaver.tools.transfer.IDataTransferSettings in project dbeaver by serge-rider.
the class DataTransferPageFinal method activatePage.
@Override
public void activatePage() {
resultTable.removeAll();
DataTransferSettings settings = getWizard().getSettings();
List<DataTransferPipe> dataPipes = settings.getDataPipes();
for (DataTransferPipe pipe : dataPipes) {
IDataTransferSettings consumerSettings = settings.getNodeSettings(pipe.getConsumer());
IDataTransferProcessor processor = null;
if (settings.getProcessor() != null) {
// Processor is optional
try {
processor = settings.getProcessor().getInstance();
} catch (Throwable e) {
log.error("Can't create processor", e);
continue;
}
}
pipe.getConsumer().initTransfer(pipe.getProducer().getSourceObject(), consumerSettings, processor, processor == null ? null : settings.getProcessorProperties());
TableItem item = new TableItem(resultTable, SWT.NONE);
item.setText(0, DBUtils.getObjectFullName(pipe.getProducer().getSourceObject(), DBPEvaluationContext.UI));
if (settings.getProducer() != null && settings.getProducer().getIcon() != null) {
item.setImage(0, DBeaverIcons.getImage(settings.getProducer().getIcon()));
}
item.setText(1, pipe.getConsumer().getTargetName());
if (settings.getProcessor() != null && settings.getProcessor().getIcon() != null) {
item.setImage(1, DBeaverIcons.getImage(settings.getProcessor().getIcon()));
} else if (settings.getConsumer() != null && settings.getConsumer().getIcon() != null) {
item.setImage(1, DBeaverIcons.getImage(settings.getConsumer().getIcon()));
}
}
activated = true;
UIUtils.packColumns(resultTable, true);
updatePageCompletion();
}
use of org.jkiss.dbeaver.tools.transfer.IDataTransferSettings in project dbeaver by dbeaver.
the class DataTransferJob method transferData.
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;
}
}
use of org.jkiss.dbeaver.tools.transfer.IDataTransferSettings in project dbeaver by dbeaver.
the class DataTransferPageFinal method activatePage.
@Override
public void activatePage() {
resultTable.removeAll();
DataTransferSettings settings = getWizard().getSettings();
List<DataTransferPipe> dataPipes = settings.getDataPipes();
for (DataTransferPipe pipe : dataPipes) {
IDataTransferSettings consumerSettings = settings.getNodeSettings(pipe.getConsumer());
IDataTransferProcessor processor = null;
if (settings.getProcessor() != null) {
// Processor is optional
try {
processor = settings.getProcessor().getInstance();
} catch (Throwable e) {
log.error("Can't create processor", e);
continue;
}
}
pipe.getConsumer().initTransfer(pipe.getProducer().getSourceObject(), consumerSettings, processor, processor == null ? null : settings.getProcessorProperties());
TableItem item = new TableItem(resultTable, SWT.NONE);
item.setText(0, DBUtils.getObjectFullName(pipe.getProducer().getSourceObject(), DBPEvaluationContext.UI));
if (settings.getProducer() != null && settings.getProducer().getIcon() != null) {
item.setImage(0, DBeaverIcons.getImage(settings.getProducer().getIcon()));
}
item.setText(1, pipe.getConsumer().getTargetName());
if (settings.getProcessor() != null && settings.getProcessor().getIcon() != null) {
item.setImage(1, DBeaverIcons.getImage(settings.getProcessor().getIcon()));
} else if (settings.getConsumer() != null && settings.getConsumer().getIcon() != null) {
item.setImage(1, DBeaverIcons.getImage(settings.getConsumer().getIcon()));
}
}
activated = true;
UIUtils.packColumns(resultTable, true);
updatePageCompletion();
}
Aggregations