Search in sources :

Example 6 with ClusterSchemaDialog

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

the class RepositoryExplorerDialog method editCluster.

public void editCluster(String clusterName) {
    try {
        ObjectId id = rep.getClusterID(clusterName);
        // Load the last version
        ClusterSchema cluster = rep.loadClusterSchema(id, rep.getSlaveServers(), null);
        ClusterSchemaDialog dd = new ClusterSchemaDialog(shell, cluster, rep.getSlaveServers());
        if (dd.open()) {
            rep.insertLogEntry("Updating cluster '" + cluster.getName() + "'");
            rep.save(cluster, Const.VERSION_COMMENT_EDIT_VERSION, null);
            if (!clusterName.equalsIgnoreCase(cluster.getName())) {
                refreshTree();
            }
        }
    } catch (KettleException e) {
        // CHECKSTYLE:LineLength:OFF
        new ErrorDialog(shell, BaseMessages.getString(PKG, "RepositoryExplorerDialog.Cluster.Edit.UnexpectedError.Title"), BaseMessages.getString(PKG, "RepositoryExplorerDialog.Cluster.Edit.UnexpectedError.Message") + clusterName + "]", e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) ObjectId(org.pentaho.di.repository.ObjectId) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) ClusterSchema(org.pentaho.di.cluster.ClusterSchema) ClusterSchemaDialog(org.pentaho.di.ui.cluster.dialog.ClusterSchemaDialog)

Aggregations

KettleException (org.pentaho.di.core.exception.KettleException)6 ClusterSchemaDialog (org.pentaho.di.ui.cluster.dialog.ClusterSchemaDialog)6 ClusterSchema (org.pentaho.di.cluster.ClusterSchema)5 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)5 ObjectId (org.pentaho.di.repository.ObjectId)4 MessageBox (org.eclipse.swt.widgets.MessageBox)3 RepositoryExplorer (org.pentaho.di.ui.repository.repositoryexplorer.RepositoryExplorer)1 UICluster (org.pentaho.di.ui.repository.repositoryexplorer.model.UICluster)1