use of com.cubrid.cubridmanager.core.cubrid.user.task.GetAllUserAuthorizationsTask in project cubrid-manager by CUBRID.
the class DBAuthComparator method loadData.
/**
* Load the data
*/
private void loadData() {
final GetUserListTask getUserTask = new GetUserListTask(database.getDatabaseInfo());
final GetAllUserAuthorizationsTask getUserAuthTask = new GetAllUserAuthorizationsTask(database.getDatabaseInfo());
TaskJobExecutor taskExec = new CommonTaskJobExec(new ITaskExecutorInterceptor() {
public void completeAll() {
final List<UserDetailInfo> userDetailList = new ArrayList<UserDetailInfo>();
DbUserInfoList userListInfo = getUserTask.getResultModel();
Map<String, UserDetailInfo> allUserAuthMap = getUserAuthTask.getAllAuthMap();
if (userListInfo != null) {
for (DbUserInfo userInfo : userListInfo.getUserList()) {
UserDetailInfo userDetailInfo = allUserAuthMap.get(userInfo.getName());
if (userDetailInfo == null) {
userDetailInfo = new UserDetailInfo();
userDetailInfo.setUserName(userInfo.getName());
}
userDetailList.add(userDetailInfo);
}
}
setTableData(userDetailList);
}
public IStatus postTaskFinished(ITask task) {
return Status.OK_STATUS;
}
});
taskExec.addTask(getUserTask);
taskExec.addTask(getUserAuthTask);
JobFamily jobFamily = new JobFamily();
String serverName = database.getServer().getName();
String dbName = database.getName();
jobFamily.setServerName(serverName);
jobFamily.setDbName(dbName);
String jobName = Messages.jobLoadUserData + " - " + "@" + dbName + "@" + serverName;
taskExec.schedule(jobName, jobFamily, false, Job.SHORT);
}
Aggregations