Search in sources :

Example 6 with SlaveServerDialog

use of org.pentaho.di.ui.cluster.dialog.SlaveServerDialog in project pentaho-kettle by pentaho.

the class RepositoryExplorerDialog method newSlaveServer.

public void newSlaveServer() {
    try {
        SlaveServer slaveServer = new SlaveServer();
        SlaveServerDialog dd = new SlaveServerDialog(shell, slaveServer, rep.getSlaveServers());
        if (dd.open()) {
            // See if this slave server already exists...
            ObjectId idSlave = rep.getSlaveID(slaveServer.getName());
            if (idSlave == null) {
                rep.insertLogEntry("Creating new slave server '" + slaveServer.getName() + "'");
                rep.save(slaveServer, Const.VERSION_COMMENT_INITIAL_VERSION, null);
            } else {
                MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
                mb.setMessage(BaseMessages.getString(PKG, "RepositoryExplorerDialog.Slave.Create.AlreadyExists.Message"));
                mb.setText(BaseMessages.getString(PKG, "RepositoryExplorerDialog.Slave.Create.AlreadyExists.Title"));
                mb.open();
            }
            // Refresh tree...
            refreshTree();
        }
    } catch (KettleException e) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "RepositoryExplorerDialog.Connection.Create.UnexpectedError.Title"), BaseMessages.getString(PKG, "RepositoryExplorerDialog.Connection.Create.UnexpectedError.Message"), e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) ObjectId(org.pentaho.di.repository.ObjectId) SlaveServerDialog(org.pentaho.di.ui.cluster.dialog.SlaveServerDialog) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) SlaveServer(org.pentaho.di.cluster.SlaveServer) MessageBox(org.eclipse.swt.widgets.MessageBox)

Aggregations

KettleException (org.pentaho.di.core.exception.KettleException)6 SlaveServerDialog (org.pentaho.di.ui.cluster.dialog.SlaveServerDialog)6 SlaveServer (org.pentaho.di.cluster.SlaveServer)5 ObjectId (org.pentaho.di.repository.ObjectId)4 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)4 MessageBox (org.eclipse.swt.widgets.MessageBox)3 UISlave (org.pentaho.di.ui.repository.repositoryexplorer.model.UISlave)1