是否有可能只检索启用的用户 - 添加过滤器 - 到 jt400 的 UserList 的 getUsers 方法?
我做了以下实现,但它没有很好的性能,所以我试图找到一种更好的方法,如果有可能过滤用户并只获得启用的用户。
Set<String> as400Users = new HashSet();
AS400 as400 = new AS400(host, username, password);
//Retrieving Users
UserList users = new UserList(as400);
Enumeration io = users.getUsers();
while (io.hasMoreElements()) {
com.ibm.as400.access.User u = (com.ibm.as400.access.User)io.nextElement();
String userName = u.getName();
if (u.getStatus().equalsIgnoreCase("*ENABLED")) {
as400Users.add(userName);
}
}