Search in sources :

Example 66 with ServerInfo

use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.

the class EditBackupPlanDialog method okPressed.

/**
	 * When press ok button,call it
	 */
public void okPressed() {
    // Gets the data of dialog
    int intLever = leverCombo.getSelectionIndex();
    if (intLever == 1 && !CommonUITool.openConfirmBox(Messages.msgLevelOneWarning)) {
        return;
    }
    if (intLever == 2 && !CommonUITool.openConfirmBox(Messages.msgLevelTwoWarning)) {
        return;
    }
    String newBackupid = idText.getText().trim();
    String newPath = pathText.getText().trim();
    String newPeriodType = periodGroup.getTextOfTypeCombo();
    String newPeriodDate = periodGroup.getDetailValue();
    String newTime = periodGroup.getTime();
    String newLever = Integer.toString(intLever);
    OnOffType newArchivedel = deleteButton.getSelection() ? OnOffType.ON : OnOffType.OFF;
    OnOffType newUpdatestatus = updateButton.getSelection() ? OnOffType.ON : OnOffType.OFF;
    String bkNum = null;
    OnOffType newStroreold = null;
    if (isBkNumSupports) {
        newStroreold = OnOffType.OFF;
        bkNum = String.valueOf(numKeepBackups.getSelection());
        if (StringUtil.isEmpty(bkNum)) {
            bkNum = "0";
        }
    } else {
        newStroreold = storeButton.getSelection() ? OnOffType.ON : OnOffType.OFF;
        bkNum = "0";
    }
    OnOffType newOnoff = onlineButton.getSelection() ? OnOffType.ON : OnOffType.OFF;
    YesNoType newZip = useCompressButton.getSelection() ? YesNoType.Y : YesNoType.N;
    YesNoType newCheck = checkingButton.getSelection() ? YesNoType.Y : YesNoType.N;
    String newMt = Integer.valueOf(numThreadspinner.getSelection()).toString();
    // Sets the object of backupPlanInfo
    backupPlanInfo.setBackupid(newBackupid);
    backupPlanInfo.setPath(newPath);
    backupPlanInfo.setPeriod_type(newPeriodType);
    backupPlanInfo.setPeriod_date(newPeriodDate);
    backupPlanInfo.setTime(newTime);
    backupPlanInfo.setLevel(newLever);
    backupPlanInfo.setArchivedel(newArchivedel.getText());
    backupPlanInfo.setUpdatestatus(newUpdatestatus.getText());
    backupPlanInfo.setStoreold(newStroreold.getText());
    backupPlanInfo.setOnoff(newOnoff.getText());
    backupPlanInfo.setZip(newZip.getText());
    backupPlanInfo.setCheck(newCheck.getText());
    backupPlanInfo.setMt(newMt);
    backupPlanInfo.setBknum(bkNum);
    // Executes the task
    ServerInfo serverInfo = database.getServer().getServerInfo();
    BackupPlanTask backupPlanTask = new BackupPlanTask(opBackupInfo, serverInfo);
    backupPlanTask.setDbname(database.getName());
    backupPlanTask.setBackupid(newBackupid);
    backupPlanTask.setPath(newPath);
    backupPlanTask.setPeriodType(newPeriodType);
    backupPlanTask.setPeriodDate(newPeriodDate);
    backupPlanTask.setTime(newTime);
    backupPlanTask.setLevel(newLever);
    backupPlanTask.setArchivedel(newArchivedel);
    backupPlanTask.setUpdatestatus(newUpdatestatus);
    backupPlanTask.setStoreold(newStroreold);
    backupPlanTask.setOnoff(newOnoff);
    backupPlanTask.setZip(newZip);
    backupPlanTask.setCheck(newCheck);
    backupPlanTask.setMt(newMt);
    backupPlanTask.setBknum(bkNum);
    String taskName = Messages.bind(Messages.editBackupPlanTaskName, newBackupid);
    TaskExecutor taskExecutor = new CommonTaskExec(taskName);
    taskExecutor.addTask(backupPlanTask);
    new ExecTaskWithProgress(taskExecutor).exec();
    if (taskExecutor.isSuccess()) {
        super.okPressed();
    }
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) OnOffType(com.cubrid.cubridmanager.core.common.model.OnOffType) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) BackupPlanTask(com.cubrid.cubridmanager.core.cubrid.jobauto.task.BackupPlanTask) YesNoType(com.cubrid.cubridmanager.core.utils.ModelUtil.YesNoType)

Example 67 with ServerInfo

use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.

the class ImportHAConfigAction method isSupported.

/**
	 * 
	 * Return whether this action support this object,if not support,this action
	 * will be disabled
	 * 
	 * @param obj the Object
	 * @return <code>true</code> if support this obj;<code>false</code>
	 *         otherwise
	 */
public boolean isSupported(Object obj) {
    if (obj instanceof CubridServer) {
        CubridServer server = (CubridServer) obj;
        ServerInfo serverInfo = server.getServerInfo();
        if (!CompatibleUtil.isSupportNewHAConfFile(serverInfo)) {
            return false;
        }
        ServerUserInfo userInfo = server.getServerInfo().getLoginedUserInfo();
        if (userInfo == null || CasAuthType.AUTH_ADMIN != userInfo.getCasAuth()) {
            return false;
        }
        return true;
    }
    return false;
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ServerUserInfo(com.cubrid.cubridmanager.core.common.model.ServerUserInfo) CubridServer(com.cubrid.common.ui.spi.model.CubridServer)

Example 68 with ServerInfo

use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.

the class EasyHAAction method isSupported.

/**
	 * 
	 * Return whether this action support this object,if not support,this action
	 * will be disabled
	 * 
	 * @param obj the Object
	 * @return <code>true</code> if support this obj;<code>false</code>
	 *         otherwise
	 */
public boolean isSupported(Object obj) {
    if (obj instanceof CubridServer) {
        CubridServer server = (CubridServer) obj;
        ServerInfo serverInfo = server.getServerInfo();
        if (!CompatibleUtil.isSupportNewHAConfFile(serverInfo)) {
            return false;
        }
        ServerUserInfo userInfo = serverInfo.getLoginedUserInfo();
        if (userInfo == null || CasAuthType.AUTH_ADMIN != userInfo.getCasAuth()) {
            return false;
        }
        return true;
    }
    return false;
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ServerUserInfo(com.cubrid.cubridmanager.core.common.model.ServerUserInfo) CubridServer(com.cubrid.common.ui.spi.model.CubridServer)

Example 69 with ServerInfo

use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.

the class AddHostAction method getServerNode.

/**
	 * Create a new server node.
	 * 
	 * @param dialog the add server dialog.
	 * @return CubridServer.
	 */
private CubridServer getServerNode(HostDialog dialog) {
    ServerInfo serverInfo = dialog.getServerInfo();
    CubridServer server = new CubridServer(serverInfo.getServerName(), serverInfo.getServerName(), "icons/navigator/host.png", "icons/navigator/host_connected.png");
    server.setServerInfo(serverInfo);
    server.setLoader(new CubridServerLoader());
    server.setAutoSavePassword(dialog.isSavePassword());
    return server;
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) CubridServer(com.cubrid.common.ui.spi.model.CubridServer) CubridServerLoader(com.cubrid.cubridmanager.ui.spi.model.loader.CubridServerLoader)

Example 70 with ServerInfo

use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.

the class EditHAConfigAction method isSupported.

/**
	 * 
	 * Return whether this action support this object,if not support,this action
	 * will be disabled
	 * 
	 * @param obj the Object
	 * @return <code>true</code> if support this obj;<code>false</code>
	 *         otherwise
	 */
public boolean isSupported(Object obj) {
    if (obj instanceof CubridServer) {
        CubridServer server = (CubridServer) obj;
        ServerInfo serverInfo = server.getServerInfo();
        if (!CompatibleUtil.isSupportNewHAConfFile(serverInfo)) {
            return false;
        }
        ServerUserInfo userInfo = serverInfo.getLoginedUserInfo();
        if (userInfo == null || CasAuthType.AUTH_ADMIN != userInfo.getCasAuth()) {
            return false;
        }
        return true;
    }
    return false;
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ServerUserInfo(com.cubrid.cubridmanager.core.common.model.ServerUserInfo) CubridServer(com.cubrid.common.ui.spi.model.CubridServer)

Aggregations

ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)255 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)40 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)40 CubridServer (com.cubrid.common.ui.spi.model.CubridServer)39 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)37 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)35 ArrayList (java.util.ArrayList)30 EnvInfo (com.cubrid.cubridmanager.core.common.model.EnvInfo)29 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)28 TreeViewer (org.eclipse.jface.viewers.TreeViewer)27 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)24 CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)24 MonitoringTask (com.cubrid.cubridmanager.core.common.task.MonitoringTask)24 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)21 SelectionEvent (org.eclipse.swt.events.SelectionEvent)20 GridData (org.eclipse.swt.layout.GridData)17 GridLayout (org.eclipse.swt.layout.GridLayout)17 DbUserInfo (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo)16 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)16 ITask (com.cubrid.common.core.task.ITask)15