Search in sources :

Example 21 with ServerType

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

the class UserAuthGeneralInfoPage method initial.

/**
	 * 
	 * Initial the page content
	 */
private void initial() {
    ServerType serverType = server.getServerInfo().getServerType();
    if (userInfo == null || !userInfo.isAdmin()) {
        if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
            dbCreationAuthCombo.add(DbCreateAuthType.AUTH_NONE.getText());
        }
        if (serverType == ServerType.BOTH || serverType == ServerType.BROKER) {
            brokerAuthCombo.setItems(new String[] { CasAuthType.AUTH_NONE.getText(), CasAuthType.AUTH_MONITOR.getText(), CasAuthType.AUTH_ADMIN.getText() });
        }
        statusMonitorAuthCombo.setItems(new String[] { StatusMonitorAuthType.AUTH_NONE.getText(), StatusMonitorAuthType.AUTH_MONITOR.getText(), StatusMonitorAuthType.AUTH_ADMIN.getText() });
    } else if (userInfo.isAdmin()) {
        if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
            dbCreationAuthCombo.add(DbCreateAuthType.AUTH_ADMIN.getText());
        }
        if (serverType == ServerType.BOTH || serverType == ServerType.BROKER) {
            brokerAuthCombo.add(CasAuthType.AUTH_ADMIN.getText());
        }
        statusMonitorAuthCombo.add(StatusMonitorAuthType.AUTH_ADMIN.getText());
    }
    if (userInfo == null) {
        if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
            dbCreationAuthCombo.select(0);
        }
        if (serverType == ServerType.BOTH || serverType == ServerType.BROKER) {
            brokerAuthCombo.select(0);
        }
        statusMonitorAuthCombo.select(0);
    } else {
        userIdText.setText(userInfo.getUserName());
        userIdText.setEditable(false);
        String password = userInfo.getPassword() == null ? "" : userInfo.getPassword();
        passwordText.setText(password);
        passwordConfirmText.setText(password);
        if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
            dbCreationAuthCombo.setText(userInfo.getDbCreateAuthType().getText());
        }
        if (serverType == ServerType.BOTH || serverType == ServerType.BROKER) {
            brokerAuthCombo.setText(userInfo.getCasAuth().getText());
        }
        statusMonitorAuthCombo.setText(userInfo.getStatusMonitorAuth().getText());
    }
}
Also used : ServerType(com.cubrid.cubridmanager.core.common.model.ServerType)

Example 22 with ServerType

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

the class UserManagementWizard method addPages.

/**
	 * Add wizard pages
	 */
public void addPages() {
    generalInfoPage = new UserAuthGeneralInfoPage(server, userInfo, serverUserInfoList);
    addPage(generalInfoPage);
    ServerType serverType = server.getServerInfo().getServerType();
    if (serverType == ServerType.BROKER) {
        return;
    }
    if (userInfo == null || !userInfo.isAdmin()) {
        authDbInfoPage = new UserAuthDbInfoPage(server, userInfo);
        addPage(authDbInfoPage);
    }
}
Also used : ServerType(com.cubrid.cubridmanager.core.common.model.ServerType)

Example 23 with ServerType

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

the class CubridLogsFolderLoader method load.

/**
	 * 
	 * Load children object for parent
	 * 
	 * @param parent the parent node
	 * @param monitor the IProgressMonitor object
	 */
public void load(ICubridNode parent, final IProgressMonitor monitor) {
    synchronized (this) {
        if (isLoaded()) {
            return;
        }
        ServerType serverType = parent.getServer().getServerInfo().getServerType();
        // add broker logs folder to logs folder
        if (serverType == ServerType.BOTH || serverType == ServerType.BROKER) {
            String brokerLogsFolderId = parent.getId() + NODE_SEPARATOR + LOGS_BROKER_FOLDER_ID;
            ICubridNode brokerLogsFolder = parent.getChild(brokerLogsFolderId);
            if (brokerLogsFolder == null) {
                brokerLogsFolder = new DefaultCubridNode(brokerLogsFolderId, LOGS_BROKER_FOLDER_NAME, "icons/navigator/log_broker_group.png");
                brokerLogsFolder.setType(CubridNodeType.LOGS_BROKER_FOLDER);
                brokerLogsFolder.setContainer(true);
                ICubridNodeLoader loader = new CubridBrokerLogFolderLoader();
                loader.setLevel(getLevel());
                brokerLogsFolder.setLoader(loader);
                parent.addChild(brokerLogsFolder);
                if (getLevel() == DEFINITE_LEVEL) {
                    brokerLogsFolder.getChildren(monitor);
                }
            } else {
                if (brokerLogsFolder.getLoader() != null && brokerLogsFolder.getLoader().isLoaded()) {
                    brokerLogsFolder.getLoader().setLoaded(false);
                    brokerLogsFolder.getChildren(monitor);
                }
            }
        }
        // add manager logs folder to logs folder
        if (serverType == ServerType.BOTH || serverType == ServerType.DATABASE) {
            String managerLogsFolderId = parent.getId() + NODE_SEPARATOR + LOGS_MANAGER_FOLDER_ID;
            ICubridNode managerLogsFolder = parent.getChild(managerLogsFolderId);
            if (managerLogsFolder == null) {
                managerLogsFolder = new DefaultCubridNode(managerLogsFolderId, LOGS_MANAGER_FOLDER_NAME, "icons/navigator/log_manager_group.png");
                managerLogsFolder.setType(CubridNodeType.LOGS_MANAGER_FOLDER);
                managerLogsFolder.setContainer(true);
                parent.addChild(managerLogsFolder);
            }
            // add access and error log folder to manager logs folder
            String[] managerLogIdArr = { ACCESS_LOG_FOLDER_ID, ERROR_LOG_FOLDER_ID };
            String[] managerLogNameArr = { ACCESS_LOG_FOLDER_NAME, ERROR_LOG_FOLDER_NAME };
            String[] managerLogTypeArr = { CubridNodeType.LOGS_MANAGER_ACCESS_LOG, CubridNodeType.LOGS_MANAGER_ERROR_LOG };
            String[] iconsArr = { "icons/navigator/log_item.png", "icons/navigator/log_item.png" };
            for (int i = 0; i < managerLogNameArr.length; i++) {
                String id = parent.getId() + NODE_SEPARATOR + managerLogIdArr[i];
                ICubridNode logFolder = parent.getChild(id);
                if (logFolder == null) {
                    logFolder = new DefaultCubridNode(id, managerLogNameArr[i], iconsArr[i]);
                    logFolder.setType(managerLogTypeArr[i]);
                    logFolder.setEditorId(LogEditorPart.ID);
                    logFolder.setContainer(false);
                    managerLogsFolder.addChild(logFolder);
                }
            }
            //add database server log folder
            String serverLogsFolderId = parent.getId() + NODE_SEPARATOR + LOGS_SERVER_FOLDER_ID;
            ICubridNode serverLogsFolder = parent.getChild(serverLogsFolderId);
            if (serverLogsFolder == null) {
                serverLogsFolder = new DefaultCubridNode(serverLogsFolderId, LOGS_SERVER_FOLDER_NAME, "icons/navigator/log_db_group.png");
                serverLogsFolder.setType(CubridNodeType.LOGS_SERVER_FOLDER);
                serverLogsFolder.setContainer(true);
                ICubridNodeLoader loader = new CubridDatabaseLogFolderLoader();
                loader.setLevel(getLevel());
                serverLogsFolder.setLoader(loader);
                parent.addChild(serverLogsFolder);
                if (getLevel() == DEFINITE_LEVEL) {
                    serverLogsFolder.getChildren(monitor);
                }
            } else {
                if (serverLogsFolder.getLoader() != null && serverLogsFolder.getLoader().isLoaded()) {
                    serverLogsFolder.getLoader().setLoaded(false);
                    serverLogsFolder.getChildren(monitor);
                }
            }
        }
        setLoaded(true);
        CubridNodeManager.getInstance().fireCubridNodeChanged(new CubridNodeChangedEvent((ICubridNode) parent, CubridNodeChangedEventType.CONTAINER_NODE_REFRESH));
    }
}
Also used : ServerType(com.cubrid.cubridmanager.core.common.model.ServerType) DefaultCubridNode(com.cubrid.common.ui.spi.model.DefaultCubridNode) ICubridNodeLoader(com.cubrid.common.ui.spi.model.ICubridNodeLoader) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) CubridNodeChangedEvent(com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)

Example 24 with ServerType

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

the class AddBrokerMonitorAction method isSupported.

/**
	 * selection is Host node host is connected
	 * 
	 * @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java.lang.Object)
	 * @param obj Object
	 * @return boolean support:true;not support:false;
	 */
public boolean isSupported(Object obj) {
    if (obj instanceof HostMonitorPart) {
        HostMonitorPart hostMonPart = (HostMonitorPart) obj;
        HostNode hostNode = (HostNode) hostMonPart.getModel();
        if (hostNode == null || hostNode.getServerInfo() == null || hostNode.getServerInfo().getLoginedUserInfo() == null) {
            return false;
        }
        ServerType type = hostNode.getServerInfo().getServerType();
        return type == ServerType.BOTH || type == ServerType.BROKER;
    }
    return false;
}
Also used : ServerType(com.cubrid.cubridmanager.core.common.model.ServerType) HostNode(com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode) HostMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HostMonitorPart)

Example 25 with ServerType

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

the class AddHostAndDbWizard method addPages.

/**
	 * Add wizard pages
	 */
public void addPages() {
    WizardDialog dialog = (WizardDialog) getContainer();
    if (addedType == 0 || selectedHostNode == null || selectedHostNode.getServerInfo() == null) {
        setHostInfoPage = new SetHostInfoPage(selectedHostNode, addedHostNodeList, allHostNodeList);
        addPage(setHostInfoPage);
    }
    ServerType serverType = selectedHostNode == null || selectedHostNode.getServerInfo() == null ? null : selectedHostNode.getServerInfo().getServerType();
    if (addedType == 0 || addedType == 1) {
        selectDbPage = new SelectDbPage();
        selectDbPage.setServerType(serverType);
        addPage(selectDbPage);
        dialog.addPageChangedListener(selectDbPage);
    }
    if (addedType == 0 || addedType == 2) {
        selectBrokerPage = new SelectBrokerPage();
        selectBrokerPage.setServerType(serverType);
        addPage(selectBrokerPage);
        dialog.addPageChangedListener(selectBrokerPage);
    }
}
Also used : ServerType(com.cubrid.cubridmanager.core.common.model.ServerType) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

ServerType (com.cubrid.cubridmanager.core.common.model.ServerType)26 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)10 Map (java.util.Map)9 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)7 MonitoringTask (com.cubrid.cubridmanager.core.common.task.MonitoringTask)7 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)7 GetBrokerConfParameterTask (com.cubrid.cubridmanager.core.broker.task.GetBrokerConfParameterTask)6 GetCMConfParameterTask (com.cubrid.cubridmanager.core.common.task.GetCMConfParameterTask)6 GetCMUserListTask (com.cubrid.cubridmanager.core.common.task.GetCMUserListTask)6 GetCubridConfParameterTask (com.cubrid.cubridmanager.core.common.task.GetCubridConfParameterTask)6 GetEnvInfoTask (com.cubrid.cubridmanager.core.common.task.GetEnvInfoTask)6 GetDatabaseListTask (com.cubrid.cubridmanager.core.cubrid.database.task.GetDatabaseListTask)6 HashMap (java.util.HashMap)6 ITask (com.cubrid.common.core.task.ITask)5 CubridServer (com.cubrid.common.ui.spi.model.CubridServer)5 ArrayList (java.util.ArrayList)5 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)4 UpdateCMUserTask (com.cubrid.cubridmanager.core.common.task.UpdateCMUserTask)4 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)3 BrokerInfos (com.cubrid.cubridmanager.core.broker.model.BrokerInfos)3