Search in sources :

Example 6 with GetUserListTask

use of com.cubrid.cubridmanager.core.cubrid.user.task.GetUserListTask in project cubrid-manager by CUBRID.

the class CQBUserEditor method loadData.

/**
	 * Load data
	 *
	 * @return <code>true</code> if it is successfully;<code>false</code>
	 *         otherwise
	 */
public boolean loadData() {
    Connection con = null;
    try {
        con = JDBCConnectionManager.getConnection(database.getDatabaseInfo(), false);
        final GetUserListTask task = new GetUserListTask(database.getDatabaseInfo(), con);
        final GetAllClassListTask classInfoTask = new GetAllClassListTask(database.getDatabaseInfo(), con);
        final GetAllPartitionClassTask partitionTask = new GetAllPartitionClassTask(database.getDatabaseInfo(), con);
        execTask(new ITask[] { task, classInfoTask, partitionTask });
        GetUserAuthorizationsTask privilegeTask = new GetUserAuthorizationsTask(database.getDatabaseInfo(), con);
        try {
            for (DbUserInfo userInfo : userListInfo.getUserList()) {
                if (userInfo.getName().equals(userName)) {
                    userInfo.setUserAuthorizations(privilegeTask.getUserAuthorizations(userInfo.getName()));
                }
            }
        } catch (Exception e) {
            LOGGER.error("get user failed", e);
        }
        initial();
    } catch (Exception e) {
        LOGGER.error(e.getMessage());
    } finally {
        QueryUtil.freeQuery(con);
    }
    return true;
}
Also used : GetUserListTask(com.cubrid.cubridmanager.core.cubrid.user.task.GetUserListTask) DbUserInfo(com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo) GetAllClassListTask(com.cubrid.cubridmanager.core.cubrid.table.task.GetAllClassListTask) Connection(java.sql.Connection) GetAllPartitionClassTask(com.cubrid.cubridmanager.core.cubrid.table.task.GetAllPartitionClassTask) GetUserAuthorizationsTask(com.cubrid.cubridmanager.core.cubrid.user.task.GetUserAuthorizationsTask) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

GetUserListTask (com.cubrid.cubridmanager.core.cubrid.user.task.GetUserListTask)6 DbUserInfo (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo)5 GetAllClassListTask (com.cubrid.cubridmanager.core.cubrid.table.task.GetAllClassListTask)4 GetAllPartitionClassTask (com.cubrid.cubridmanager.core.cubrid.table.task.GetAllPartitionClassTask)4 DbUserInfoList (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfoList)4 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)3 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)3 GetUserAuthorizationsTask (com.cubrid.cubridmanager.core.cubrid.user.task.GetUserAuthorizationsTask)3 Connection (java.sql.Connection)3 ITask (com.cubrid.common.core.task.ITask)2 CubridNavigatorView (com.cubrid.common.ui.common.navigator.CubridNavigatorView)2 EditUserDialog (com.cubrid.common.ui.cubrid.user.dialog.EditUserDialog)2 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 PartInitException (org.eclipse.ui.PartInitException)2 DefaultSchemaNode (com.cubrid.common.ui.spi.model.DefaultSchemaNode)1 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)1 CommonTaskJobExec (com.cubrid.common.ui.spi.progress.CommonTaskJobExec)1 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)1 ITaskExecutorInterceptor (com.cubrid.common.ui.spi.progress.ITaskExecutorInterceptor)1