use of org.talend.repository.hadoopcluster.configurator.IRetrieveConfsJobService in project tbd-studio-se by Talend.
the class HadoopImportRemoteOptionPage method addListener.
private void addListener() {
selectClusterButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
try {
IRetrieveConfsJobService retrieveJobServer = connectionForm.getRetrieveJobService();
if (retrieveJobServer != null) {
retrieveJobServer.setDistributionVersion(distriVersion);
retrieveJobServer.setSelectedCluster(getSelectedCluster());
confsService = (IRetrieveConfsService) retrieveJobServer;
} else if (configurator != null) {
HadoopCluster cluster = configurator.getCluster(getSelectedCluster());
confsService = new RetrieveRemoteConfsService(cluster);
}
if (confsService != null) {
servicesTableComp.setServices(confsService.getAllServices());
}
} catch (Exception ex) {
ExceptionHandler.process(ex);
}
}
});
}
use of org.talend.repository.hadoopcluster.configurator.IRetrieveConfsJobService in project tbd-studio-se by Talend.
the class HadoopImportRemoteOptionPage method propertyChange.
@Override
public void propertyChange(PropertyChangeEvent evt) {
setErrorMessage(null);
Exception exception = null;
String propertyName = evt.getPropertyName();
Object newValue = evt.getNewValue();
if (IPropertyConstants.PROPERTY_CONNECT.equals(propertyName)) {
if (newValue instanceof HadoopConfigurator) {
configurator = (HadoopConfigurator) newValue;
try {
List<String> clusters = configurator.getAllClusters();
bindCombo(clusters);
} catch (Exception e) {
exception = e;
}
} else if (newValue instanceof Exception) {
exception = (Exception) newValue;
}
}
if (IPropertyConstants.PROPERTY_RETRIEVE_JOB.equals(propertyName)) {
if (newValue instanceof IRetrieveConfsJobService) {
IRetrieveConfsJobService retrieveConfigJobService = (IRetrieveConfsJobService) newValue;
List<String> clusters = retrieveConfigJobService.getAllClusterName();
bindCombo(clusters);
} else if (newValue instanceof Exception) {
exception = (Exception) newValue;
}
}
if (exception != null) {
// $NON-NLS-1$
setErrorMessage(Messages.getString("HadoopImportRemoteOptionPage.connectionFailed"));
ExceptionHandler.process(exception);
}
}
use of org.talend.repository.hadoopcluster.configurator.IRetrieveConfsJobService in project tbd-studio-se by Talend.
the class AbstractConnectionForm method createRetieveMetaFields.
protected boolean createRetieveMetaFields(Composite parent) {
IRetrieveConfsJobService service = this.findRetrieveJobService();
if (service != null) {
// If find the service
retrieveButton = new Button(parent, SWT.CHECK);
GridData retrieveData = new GridData();
retrieveData.horizontalSpan = 1;
retrieveButton.setLayoutData(retrieveData);
retrieveButton.setText(Messages.getString("HadoopImportRemoteOptionPage.retrieve.check"));
retrieveButton.setSelection(false);
retrieveButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
serverCombo.getControl().setEnabled(retrieveButton.getSelection());
}
});
serverCombo = new ComboViewer(parent);
serverCombo.setContentProvider(new ArrayContentProvider());
serverCombo.setLabelProvider(new LabelProvider());
GridData jobServerData = new GridData(GridData.FILL_HORIZONTAL);
jobServerData.horizontalSpan = 1;
serverCombo.getControl().setLayoutData(jobServerData);
serverCombo.getControl().setEnabled(false);
serverCombo.setInput(service.getAllJobServerLabel());
serverCombo.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
retrieveJobService = null;
}
});
return true;
}
return false;
}
Aggregations