KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > ipanema > security > UserSearchResult


1 /* ************************************************************************** *
2  * Copyright (C) 2004 NightLabs GmbH, Marco Schulze *
3  * All rights reserved. *
4  * http://www.NightLabs.de *
5  * *
6  * This program and the accompanying materials are free software; you can re- *
7  * distribute it and/or modify it under the terms of the GNU General Public *
8  * License as published by the Free Software Foundation; either ver 2 of the *
9  * License, or any later version. *
10  * *
11  * This module is distributed in the hope that it will be useful, but WITHOUT *
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT- *
13  * NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more *
14  * details. *
15  * *
16  * You should have received a copy of the GNU General Public License along *
17  * with this module; if not, write to the Free Software Foundation, Inc.: *
18  * 59 Temple Place, Suite 330 *
19  * Boston MA 02111-1307 *
20  * USA *
21  * *
22  * Or get it online: *
23  * http://www.opensource.org/licenses/gpl-license.php *
24  * *
25  * In case, you want to use this module or parts of it in a proprietary pro- *
26  * ject, you can purchase it under the NightLabs Commercial License. Please *
27  * contact NightLabs GmbH under info AT nightlabs DOT com for more infos or *
28  * visit http://www.NightLabs.com *
29  * ************************************************************************** */

30
31 /*
32  * Created on 07.06.2004
33  */

34 package com.nightlabs.ipanema.security;
35
36 import java.util.ArrayList JavaDoc;
37 import java.util.Iterator JavaDoc;
38 import java.util.List JavaDoc;
39
40 import com.nightlabs.webapp.MultiPageSearchResult;
41
42 /**
43  * @author marco
44  */

45 public class UserSearchResult extends MultiPageSearchResult {
46     /**
47      * @param _itemsFound
48      * @param _itemsPerPage
49      * @param _pageIndex
50      * @param _items
51      */

52     public UserSearchResult(
53             int _itemsFound, int _itemsPerPage,
54             int _pageIndex, List JavaDoc _items)
55     {
56         super(_itemsFound, _itemsPerPage, _pageIndex, _items);
57     }
58
59     public static final int INCLUDE_NONE = User.INCLUDE_NONE;
60     public static final int INCLUDE_PERSON = User.INCLUDE_PERSON;
61 // public static final int INCLUDE_ROLEGROUPS = User.INCLUDE_ROLEGROUPS;
62
// public static final int INCLUDE_ROLEGROUPS_ROLES = User.INCLUDE_ROLEGROUPS_ROLES;
63
// public static final int INCLUDE_ROLEREFS = User.INCLUDE_ROLEREFS;
64
// public static final int INCLUDE_ROLEREFS_ROLES = User.INCLUDE_ROLEREFS_ROLES;
65

66     public void makeTransient(int includeMask)
67     {
68         List JavaDoc transientItems = new ArrayList JavaDoc();
69         for (Iterator JavaDoc it = getItems().iterator(); it.hasNext(); ) {
70             User user = (User) it.next();
71             user.makeTransient(includeMask);
72             user.setPassword(null);
73             transientItems.add(user);
74         } // for (Iterator it = getItems().iterator(); it.hasNext(); ) {
75
setItems(transientItems);
76     }
77 }
78
Popular Tags