Search in sources :

Example 76 with ExecTaskWithProgress

use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress in project cubrid-manager by CUBRID.

the class CubridWorkbenchContrItem method connectHost.

/**
	 * Connect host
	 *
	 * @param serverInfo ServerInfo
	 * @param showErrMsg boolean
	 * @return boolean
	 */
public static boolean connectHost(ServerInfo serverInfo, boolean showErrMsg) {
    String password = serverInfo == null ? null : serverInfo.getUserPassword();
    if (password == null || password.trim().length() == 0) {
        return false;
    }
    Map<String, String> jdbcVersionMap = CubridJdbcManager.getInstance().getLoadedJdbc();
    if (jdbcVersionMap == null || jdbcVersionMap.get(serverInfo.getJdbcDriverVersion()) == null) {
        return false;
    }
    TaskExecutor taskExcutor = new ConnectHostExecutor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), serverInfo, showErrMsg);
    new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
    boolean isConnected = taskExcutor.isSuccess();
    if (isConnected) {
        // if preference use dashboard, when connect successful,open host dashboard
        if (GeneralPreference.isUseHostDashboard() && serverInfo.isConnected()) {
            openHostDashboard(serverInfo);
        }
    //			if (serverInfo.isCheckCertStatus()
    //					&& CertStatus.DEFAULT.equals(serverInfo.getCertStatus())) {
    //				GenCertDialog dialog = new GenCertDialog(
    //						PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), serverInfo);
    //				dialog.open();
    //			}
    }
    return isConnected;
}
Also used : TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) LoginDatabaseTaskExecutor(com.cubrid.cubridmanager.ui.cubrid.database.dialog.LoginDatabaseTaskExecutor) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) ConnectHostExecutor(com.cubrid.cubridmanager.ui.host.dialog.ConnectHostExecutor)

Example 77 with ExecTaskWithProgress

use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress 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 78 with ExecTaskWithProgress

use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress in project cubrid-manager by CUBRID.

the class ConfigParaHelp method performGetHAConf.

/**
	 * Perform the task of get ha.conf
	 * 
	 * @param serverInfo the CubridServer
	 * @return the List<String>
	 */
public static List<String> performGetHAConf(ServerInfo serverInfo) {
    List<String> confContent = new ArrayList<String>();
    CommonTaskExec taskExcutor = new CommonTaskExec(com.cubrid.cubridmanager.ui.host.Messages.getHaConfTaskRunning);
    GetHAConfParameterTask getHAConfParameterTask = new GetHAConfParameterTask(serverInfo);
    taskExcutor.addTask(getHAConfParameterTask);
    new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
    if (taskExcutor.isSuccess()) {
        confContent = getHAConfParameterTask.getConfContents();
    }
    return confContent;
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) ArrayList(java.util.ArrayList) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) GetHAConfParameterTask(com.cubrid.cubridmanager.core.common.task.GetHAConfParameterTask)

Example 79 with ExecTaskWithProgress

use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress in project cubrid-manager by CUBRID.

the class ConfigParaHelp method performGetCmConf.

/**
	 * Perform the task of get cm.conf
	 * 
	 * @param serverInfo the CubridServer
	 * @return the List<String>
	 */
public static List<String> performGetCmConf(ServerInfo serverInfo) {
    List<String> confContent = new ArrayList<String>();
    CommonTaskExec taskExcutor = new CommonTaskExec(com.cubrid.cubridmanager.ui.host.Messages.getCmConfTaskRunning);
    GetCMConfParameterTask getCMConfParameterTask = new GetCMConfParameterTask(serverInfo);
    taskExcutor.addTask(getCMConfParameterTask);
    new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
    if (taskExcutor.isSuccess()) {
        confContent = getCMConfParameterTask.getConfContents();
    }
    return confContent;
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) GetCMConfParameterTask(com.cubrid.cubridmanager.core.common.task.GetCMConfParameterTask) ArrayList(java.util.ArrayList) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)

Example 80 with ExecTaskWithProgress

use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress in project cubrid-manager by CUBRID.

the class ConfigParaHelp method performGetCubridConf.

/**
	 * Perform the task of get cubrid.conf
	 * 
	 * @param serverInfo the CubridServer
	 * @return the List<String>
	 */
public static List<String> performGetCubridConf(ServerInfo serverInfo) {
    List<String> confContent = new ArrayList<String>();
    CommonTaskExec taskExcutor = new CommonTaskExec(com.cubrid.cubridmanager.ui.host.Messages.getCubridConfTaskRunning);
    GetCubridConfParameterTask getCubridConfParameterTask = new GetCubridConfParameterTask(serverInfo);
    taskExcutor.addTask(getCubridConfParameterTask);
    new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
    if (taskExcutor.isSuccess()) {
        confContent = getCubridConfParameterTask.getConfContents();
    }
    return confContent;
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) ArrayList(java.util.ArrayList) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) GetCubridConfParameterTask(com.cubrid.cubridmanager.core.common.task.GetCubridConfParameterTask)

Aggregations

ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)155 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)124 CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)106 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)40 TreeViewer (org.eclipse.jface.viewers.TreeViewer)39 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)37 ITask (com.cubrid.common.core.task.ITask)35 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)30 ArrayList (java.util.ArrayList)29 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)26 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)25 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)23 Shell (org.eclipse.swt.widgets.Shell)15 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)14 HashMap (java.util.HashMap)13 Map (java.util.Map)13 ISelectionProvider (org.eclipse.jface.viewers.ISelectionProvider)13 DefaultCubridNode (com.cubrid.common.ui.spi.model.DefaultCubridNode)12 IEditorPart (org.eclipse.ui.IEditorPart)12 LogInfo (com.cubrid.cubridmanager.core.logs.model.LogInfo)11