use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceBean in project tbd-studio-se by Talend.
the class CheckHadoopServicesDialog method getServiceBeans.
private List<HadoopServiceBean> getServiceBeans() {
List<HadoopServiceBean> checkedServiceBeans = new ArrayList<HadoopServiceBean>(CheckedServiceRegistryReader.getInstance().getCheckedServiceBeans());
Iterator<HadoopServiceBean> beansIterator = checkedServiceBeans.iterator();
while (beansIterator.hasNext()) {
HadoopServiceBean serviceBean = beansIterator.next();
serviceBean.setChecked(false);
serviceBean.setErrorMsg(null);
HadoopServiceProperties serviceProperties = serviceTypeToProperties.get(serviceBean.getServiceType());
if (serviceProperties != null) {
serviceBean.setServiceProperties(serviceProperties);
} else {
beansIterator.remove();
}
}
return checkedServiceBeans;
}
use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceBean in project tbd-studio-se by Talend.
the class CheckedServiceRegistryReader method readElement.
@Override
protected boolean readElement(final IConfigurationElement element) {
if (ROOT_ELEMENT_NAME.equals(element.getName())) {
final List<String> serviceTypes = new ArrayList<String>();
SafeRunner.run(new RegistryReader.RegistrySafeRunnable() {
@Override
public void run() throws Exception {
String serviceName = element.getAttribute(SERVICE_NAME_ELEMENT_NAME);
String serviceType = element.getAttribute(SERVICE_TYPE_ELEMENT_NAME);
String timeout = element.getAttribute(TIMEOUT_ELEMENT_NAME);
if (serviceTypes.contains(serviceType)) {
return;
}
ICheckedServiceProvider checkedServiceProvider = (ICheckedServiceProvider) element.createExecutableExtension(CHECKED_SERVICE_PROVIDER_ELEMENT_NAME);
HadoopServiceBean serviceBean = new HadoopServiceBean();
serviceBean.setServiceName(serviceName);
serviceBean.setServiceType(EHadoopServiceType.valueOf(serviceType));
serviceBean.setTimeout(getTimeout(timeout));
serviceBean.setCheckedServiceProvider(checkedServiceProvider);
serviceBeans.add(serviceBean);
serviceTypes.add(serviceType);
}
});
return true;
}
return false;
}
use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceBean in project tbd-studio-se by Talend.
the class CheckHadoopServicesDialog method createAndExecCheckRunnables.
private void createAndExecCheckRunnables(TableItem tableItem) {
Composite progressComp = new Composite(table, SWT.NONE);
progressComp.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout progressLayout = new GridLayout(2, false);
progressLayout.marginWidth = 0;
progressLayout.marginHeight = 0;
progressComp.setLayout(progressLayout);
progressComp.setBackground(progressComp.getParent().getBackground());
progressComps.add(progressComp);
final HadoopServiceBean serviceBean = (HadoopServiceBean) tableItem.getData();
ProgressBar progressBar = createProgressBar(progressComp, serviceBean);
createStatusLink(progressComp, serviceBean);
createTableEditor(progressComp, tableItem);
checkExecutor.execute(spawnShowProgressRunnable(serviceBean, progressBar));
checkExecutor.execute(spawnCheckedServiceRunnable(serviceBean));
}
use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceBean in project tbd-studio-se by Talend.
the class CheckHadoopServicesDialog method createStatusLink.
private Link createStatusLink(Composite parent, HadoopServiceBean serviceBean) {
Link statusLink = new Link(parent, SWT.NONE);
statusLink.setBackground(statusLink.getParent().getBackground());
statusLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Link link = (Link) e.getSource();
HadoopServiceBean service = (HadoopServiceBean) serviceToStatus.getKey(link);
switchToExceptionsTab(service);
}
});
serviceToStatus.put(serviceBean, statusLink);
return statusLink;
}
use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceBean in project tbd-studio-se by Talend.
the class CheckHadoopServicesDialog method createServicesFields.
private void createServicesFields(Composite parent) {
servicesComposite = new Composite(parent, SWT.NONE);
servicesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
servicesComposite.setLayout(new GridLayout());
tableViewer = new TableViewer(servicesComposite, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
tableViewer.setContentProvider(ArrayContentProvider.getInstance());
table = tableViewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
TableViewerColumn serviceColumn = createTableViewerColumn(tableViewer, Messages.getString("CheckHadoopServicesDialog.table.service"), 0, 180, // $NON-NLS-1$
true);
serviceColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
HadoopServiceBean serviceBean = (HadoopServiceBean) element;
return serviceBean.getServiceName();
}
});
TableViewerColumn progressColumn = createTableViewerColumn(tableViewer, Messages.getString("CheckHadoopServicesDialog.table.progress"), 1, 350, // $NON-NLS-1$
false);
progressColumn.setLabelProvider(new ColumnLabelProvider());
// $NON-NLS-1$
createTabItem(servicesComposite, Messages.getString("CheckHadoopServicesDialog.tab.services.title"), SWT.NONE, null);
}
Aggregations