Search in sources :

Example 1 with SlaveServerStatus

use of org.pentaho.di.www.SlaveServerStatus in project pentaho-kettle by pentaho.

the class SpoonSlave method refreshView.

private synchronized void refreshView() {
    if (wTree.isDisposed()) {
        return;
    }
    if (refreshBusy) {
        return;
    }
    refreshBusy = true;
    if (log.isDetailed()) {
        log.logDetailed("Refresh");
    }
    transParentItem.removeAll();
    jobParentItem.removeAll();
    wText.setText("");
    // Determine the transformations on the slave servers
    try {
        slaveServerStatus = slaveServer.getStatus();
    } catch (Exception e) {
        slaveServerStatus = new SlaveServerStatus("Error contacting server");
        slaveServerStatus.setErrorDescription(Const.getStackTracker(e));
        if (log.isDebug()) {
            log.logDebug(slaveServerStatus.getErrorDescription());
        }
        wText.setText(setExceptionMessage(e));
    }
    List<SlaveServerTransStatus> transStatusList = slaveServerStatus.getTransStatusList();
    for (SlaveServerTransStatus transStatus : transStatusList) {
        TreeItem transItem = new TreeItem(transParentItem, SWT.NONE);
        transItem.setText(0, transStatus.getTransName());
        transItem.setText(9, transStatus.getStatusDescription());
        transItem.setText(13, Const.NVL(transStatus.getId(), ""));
        transItem.setText(14, Const.NVL(XMLHandler.date2string(transStatus.getLogDate()), ""));
        transItem.setImage(GUIResource.getInstance().getImageTransGraph());
        transItem.setData("transStatus", transStatus);
    }
    for (int i = 0; i < slaveServerStatus.getJobStatusList().size(); i++) {
        SlaveServerJobStatus jobStatus = slaveServerStatus.getJobStatusList().get(i);
        TreeItem jobItem = new TreeItem(jobParentItem, SWT.NONE);
        jobItem.setText(0, jobStatus.getJobName());
        jobItem.setText(9, jobStatus.getStatusDescription());
        jobItem.setText(13, Const.NVL(jobStatus.getId(), ""));
        jobItem.setText(14, Const.NVL(XMLHandler.date2string(jobStatus.getLogDate()), ""));
        jobItem.setImage(GUIResource.getInstance().getImageJobGraph());
        jobItem.setData("jobStatus", jobStatus);
    }
    TreeMemory.setExpandedFromMemory(wTree, STRING_SLAVE_LOG_TREE_NAME + slaveServer.toString());
    TreeUtil.setOptimalWidthOnColumns(wTree);
    refreshBusy = false;
}
Also used : SlaveServerStatus(org.pentaho.di.www.SlaveServerStatus) SlaveServerJobStatus(org.pentaho.di.www.SlaveServerJobStatus) TreeItem(org.eclipse.swt.widgets.TreeItem) SlaveServerTransStatus(org.pentaho.di.www.SlaveServerTransStatus)

Aggregations

TreeItem (org.eclipse.swt.widgets.TreeItem)1 SlaveServerJobStatus (org.pentaho.di.www.SlaveServerJobStatus)1 SlaveServerStatus (org.pentaho.di.www.SlaveServerStatus)1 SlaveServerTransStatus (org.pentaho.di.www.SlaveServerTransStatus)1