use of com.cubrid.cubridmanager.core.common.model.CasAuthType in project cubrid-manager by CUBRID.
the class GetCMUserListTask method buildUserInfo.
/**
*
* Build user info
*
* @param serverUserInfoList List<ServerUserInfo> The given list that stored
* some instance of ServerUserInfo
* @param node TreeNode
*/
private void buildUserInfo(List<ServerUserInfo> serverUserInfoList, TreeNode node) {
for (int j = 0; j < node.childrenSize(); j++) {
TreeNode node1 = node.getChildren().get(j);
if (node1.getValue("open") == null || !node1.getValue("open").trim().equals("user")) {
continue;
}
String userId = node1.getValue("id");
if (userId == null) {
continue;
}
String password = node1.getValue("passwd");
String casAuthInfo = node1.getValue("casauth");
String dbCreater = node1.getValue("dbcreate");
String statusMonitorAuthInfo = node1.getValue("statusmonitorauth");
ServerUserInfo userInfo = new ServerUserInfo(userId, password);
CasAuthType casAuthType = CasAuthType.AUTH_NONE;
if (casAuthInfo != null && casAuthInfo.trim().equals(CasAuthType.AUTH_ADMIN.getText())) {
casAuthType = CasAuthType.AUTH_ADMIN;
} else if (casAuthInfo != null && casAuthInfo.trim().equals(CasAuthType.AUTH_MONITOR.getText())) {
casAuthType = CasAuthType.AUTH_MONITOR;
}
userInfo.setCasAuth(casAuthType);
StatusMonitorAuthType statusMonitorAuth = StatusMonitorAuthType.AUTH_NONE;
if (statusMonitorAuthInfo != null && statusMonitorAuthInfo.trim().equals(StatusMonitorAuthType.AUTH_ADMIN.getText())) {
statusMonitorAuth = StatusMonitorAuthType.AUTH_ADMIN;
} else if (statusMonitorAuthInfo != null && statusMonitorAuthInfo.trim().equals(StatusMonitorAuthType.AUTH_MONITOR.getText())) {
statusMonitorAuth = StatusMonitorAuthType.AUTH_MONITOR;
}
userInfo.setStatusMonitorAuth(statusMonitorAuth);
if (userInfo.isAdmin()) {
userInfo.setStatusMonitorAuth(StatusMonitorAuthType.AUTH_ADMIN);
}
if (dbCreater != null && dbCreater.equals(DbCreateAuthType.AUTH_ADMIN.getText())) {
userInfo.setDbCreateAuthType(DbCreateAuthType.AUTH_ADMIN);
} else {
userInfo.setDbCreateAuthType(DbCreateAuthType.AUTH_NONE);
}
if (userInfo.getUserName().equals(serverInfo.getUserName())) {
userInfo.setPassword(serverInfo.getUserPassword());
}
buildDbAuthInfo(node1, userInfo);
serverUserInfoList.add(userInfo);
}
}
Aggregations