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;
}
Aggregations