1 | /*
|
---|
2 | * UserQueryResult.java
|
---|
3 | * Copyright (C) 2008 New Zealand Digital Library, http://www.nzdl.org
|
---|
4 | *
|
---|
5 | * This program is free software; you can redistribute it and/or modify
|
---|
6 | * it under the terms of the GNU General Public License as published by
|
---|
7 | * the Free Software Foundation; either version 2 of the License, or
|
---|
8 | * (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This program is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this program; if not, write to the Free Software
|
---|
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
18 | */
|
---|
19 | package org.greenstone.gsdl3.util;
|
---|
20 |
|
---|
21 | import java.util.Vector;
|
---|
22 | import org.greenstone.gsdl3.util.UserTermInfo;
|
---|
23 |
|
---|
24 | public class UserQueryResult{
|
---|
25 | /** the list of UserInfo */
|
---|
26 | public Vector users_=null;
|
---|
27 |
|
---|
28 | UserQueryResult(){
|
---|
29 | users_=new Vector();
|
---|
30 | }
|
---|
31 |
|
---|
32 | public void clear(){
|
---|
33 | users_.clear();
|
---|
34 | }
|
---|
35 |
|
---|
36 | public void addUserTerm(String username, String password, String groups, String accountstatus, String comment){
|
---|
37 | UserTermInfo ui=new UserTermInfo();
|
---|
38 | ui.username_=username;
|
---|
39 | ui.password_=password;
|
---|
40 | ui.groups_=groups;
|
---|
41 | ui.accountstatus_=accountstatus;
|
---|
42 | ui.comment_=comment;
|
---|
43 | users_.add(ui);
|
---|
44 | }
|
---|
45 |
|
---|
46 | public Vector getUserTerms(){
|
---|
47 | return users_;
|
---|
48 | }
|
---|
49 |
|
---|
50 | public String toString(){
|
---|
51 | String result="";
|
---|
52 | for (int i=0;i<users_.size();i++){
|
---|
53 | result +=((UserTermInfo)users_.elementAt(i)).toString()+", ";
|
---|
54 | }
|
---|
55 |
|
---|
56 | return result;
|
---|
57 | }
|
---|
58 |
|
---|
59 | public int getSize(){
|
---|
60 | return users_.size();
|
---|
61 | }
|
---|
62 | }
|
---|