Search in sources :

Example 1 with ShardsTaskFactory

use of com.cubrid.cubridmanager.core.shard.task.ShardsTaskFactory in project cubrid-manager by CUBRID.

the class ShardParameterPropertyPage method performOk.

/**
	 * Save the page content
	 * 
	 * @return <code>true</code> if it saved successfully;<code>false</code>
	 *         otherwise
	 */
public boolean performOk() {
    shardParameterPanel.save();
    ShardsTaskFactory taskFactory = new ShardsTaskFactory(this.serverInfo, this.shards);
    taskFactory.addUpdateFile(this.shard, oldShardName);
    CommonTaskExec taskExec = new CommonTaskExec(Messages.msgOperating);
    taskExec.setTask(taskFactory.generateTasks());
    new ExecTaskWithProgress(taskExec).exec();
    if (taskExec.isSuccess()) {
        CommonUITool.openInformationBox(Messages.titleSuccess, Messages.restartShardBrokerMsg);
        return true;
    } else {
        CommonUITool.openErrorBox(Messages.msgOperationFailed);
        return false;
    }
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) ShardsTaskFactory(com.cubrid.cubridmanager.core.shard.task.ShardsTaskFactory) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)

Example 2 with ShardsTaskFactory

use of com.cubrid.cubridmanager.core.shard.task.ShardsTaskFactory in project cubrid-manager by CUBRID.

the class AddShardWizard method performFinish.

/**
	 * Called when user clicks Finish
	 * 
	 * @return boolean
	 */
public boolean performFinish() {
    ShardsTaskFactory taskFactory = new ShardsTaskFactory(this.server.getServerInfo(), this.shards);
    taskFactory.addUpdateFile(this.shard, null);
    CommonTaskExec taskExec = new CommonTaskExec(Messages.msgUploading);
    taskExec.setTask(taskFactory.generateTasks());
    new ExecTaskWithProgress(taskExec).exec();
    if (taskExec.isSuccess()) {
        close();
        return true;
    } else {
        CommonUITool.openErrorBox(Messages.errAddShardBroker);
        return false;
    }
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) ShardsTaskFactory(com.cubrid.cubridmanager.core.shard.task.ShardsTaskFactory) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)

Aggregations

CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)2 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)2 ShardsTaskFactory (com.cubrid.cubridmanager.core.shard.task.ShardsTaskFactory)2