Search in sources :

Example 41 with ServerInfo

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

the class MultiHostConnectionDialog method initTask.

public void initTask() {
    if (container == null)
        return;
    for (ConnectionTaskContainer con : container) {
        ServerInfo info = con.getServerInfo();
        TableItem item = new TableItem(table, SWT.NONE);
        item.setText(1, info.getServerName());
        TableEditor editor = new TableEditor(table);
        editor.grabHorizontal = editor.grabVertical = true;
        ProgressBar bar = new ProgressBar(table, SWT.NONE);
        editor.setEditor(bar, item, 2);
        con.setItem(item);
        item.setData(KEY_BAR, bar);
        item.setData(KEY_CONNECTION, con);
    }
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) TableItem(org.eclipse.swt.widgets.TableItem) TableEditor(org.eclipse.swt.custom.TableEditor) ProgressBar(org.eclipse.swt.widgets.ProgressBar)

Example 42 with ServerInfo

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

the class MultiHostEditDialog method cloneMultiEditHostInfo.

/**
	 * cloneMultiEditHostInfo
	 * @param cubridServer
	 * @return
	 */
public CubridServer cloneMultiEditHostInfo(CubridServer cubridServer) {
    CubridServer newCubridServer = new CubridServer(cubridServer.getId(), cubridServer.getLabel(), null, null);
    ServerInfo newServerInfo = new ServerInfo();
    ServerInfo oldCubridServer = cubridServer.getServerInfo();
    newCubridServer.setAutoSavePassword(cubridServer.isAutoSavePassword());
    newServerInfo.setServerName(oldCubridServer.getServerName());
    newServerInfo.setHostAddress(cubridServer.getHostAddress());
    newServerInfo.setHostMonPort(oldCubridServer.getHostMonPort());
    newServerInfo.setJdbcDriverVersion(oldCubridServer.getJdbcDriverVersion());
    newServerInfo.setUserName(oldCubridServer.getUserName());
    if (cubridServer.isAutoSavePassword()) {
        newServerInfo.setUserPassword(oldCubridServer.getUserPassword());
    }
    newCubridServer.setServerInfo(newServerInfo);
    return newCubridServer;
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) CubridServer(com.cubrid.common.ui.spi.model.CubridServer)

Example 43 with ServerInfo

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

the class NewMultiHostConnectionDialog method editHost.

public void editHost(FailedHostServerInfo multiHostConnectionFailedServerInfo) {
    // get selected dbdata
    if (multiHostConnectionFailedServerInfo == null || multiHostConnectionFailedServerInfo.getCubridServer().isConnected()) {
        return;
    }
    HostDialog dialog = new HostDialog(getShell(), false, false);
    ServerInfo oldServerInfo = multiHostConnectionFailedServerInfo.getCubridServer().getServerInfo();
    dialog.setServer(multiHostConnectionFailedServerInfo.getCubridServer());
    if (dialog.open() != HostDialog.CONNECT_ID) {
        return;
    }
    ServerInfo serverInfo = dialog.getServerInfo();
    if (!serverInfo.getServerName().equals(multiHostConnectionFailedServerInfo.getCubridServer().getLabel())) {
        QueryOptions.removePref(multiHostConnectionFailedServerInfo.getCubridServer().getServerInfo());
        BrokerIntervalSettingManager.getInstance().removeAllBrokerIntervalSettingInServer(multiHostConnectionFailedServerInfo.getCubridServer().getLabel());
    }
    if (oldServerInfo.isConnected() && !oldServerInfo.equals(serverInfo)) {
        HostUtils.processHostDisconnected(multiHostConnectionFailedServerInfo.getCubridServer());
    }
    multiHostConnectionFailedServerInfo.getCubridServer().setId(serverInfo.getServerName());
    multiHostConnectionFailedServerInfo.getCubridServer().setLabel(serverInfo.getServerName());
    multiHostConnectionFailedServerInfo.getCubridServer().setServerInfo(serverInfo);
    multiHostConnectionFailedServerInfo.getCubridServer().setAutoSavePassword(dialog.isSavePassword());
    CMHostNodePersistManager.getInstance().addServer(serverInfo.getHostAddress(), serverInfo.getHostMonPort(), serverInfo.getUserName(), serverInfo);
    CubridNodeManager.getInstance().fireCubridNodeChanged(new CubridNodeChangedEvent(multiHostConnectionFailedServerInfo.getCubridServer(), CubridNodeChangedEventType.SERVER_CONNECTED));
    multiHostConnectionFailedServerInfo.getCubridServer().getLoader().setLoaded(false);
    CubridNavigatorView view = CubridNavigatorView.getNavigatorView(CubridHostNavigatorView.ID);
    TreeViewer treeViewer = view.getViewer();
    treeViewer.refresh(multiHostConnectionFailedServerInfo.getCubridServer(), true);
    treeViewer.expandToLevel(multiHostConnectionFailedServerInfo.getCubridServer(), 1);
    ActionManager.getInstance().fireSelectionChanged(treeViewer.getSelection());
    LayoutManager.getInstance().fireSelectionChanged(treeViewer.getSelection());
    multiHostConnectionFailedServerInfo.setErrConnectionMsg("");
    serverTable.refresh();
}
Also used : CubridNavigatorView(com.cubrid.common.ui.common.navigator.CubridNavigatorView) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) TreeViewer(org.eclipse.jface.viewers.TreeViewer) CubridNodeChangedEvent(com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)

Example 44 with ServerInfo

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

the class EditBrokerConfigEditor method init.

/**
	 * @see com.cubrid.common.ui.spi.part.CubridEditorPart#init(org.eclipse.ui.IEditorSite,
	 *      org.eclipse.ui.IEditorInput)
	 * @param site the editor site
	 * @param input the editor input
	 * @exception PartInitException if this editor was not initialized
	 *            successfully
	 */
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
    super.init(site, input);
    if (input instanceof ConfEditInput) {
        editorInput = (ConfEditInput) input;
        ServerInfo serverInfo = editorInput.getServerInfo();
        contents = ConfigParaHelp.performGetBrokerConf(serverInfo);
    }
}
Also used : ConfEditInput(com.cubrid.cubridmanager.ui.host.action.ConfEditInput) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo)

Example 45 with ServerInfo

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

the class EditCmConfigEditor method init.

/**
	 * @see com.cubrid.common.ui.spi.part.CubridEditorPart#init(org.eclipse.ui.IEditorSite,
	 *      org.eclipse.ui.IEditorInput)
	 * @param site the editor site
	 * @param input the editor input
	 * @exception PartInitException if this editor was not initialized
	 *            successfully
	 */
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
    super.init(site, input);
    if (input instanceof ConfEditInput) {
        editorInput = (ConfEditInput) input;
        ServerInfo serverInfo = editorInput.getServerInfo();
        contents = ConfigParaHelp.performGetCmConf(serverInfo);
    }
}
Also used : ConfEditInput(com.cubrid.cubridmanager.ui.host.action.ConfEditInput) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo)

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