Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: info/crossbar/state/AllUsers.java


1   /*
2    *  @(#)AllUsers.java $Revision: 1.3 $ $Date: 2003/06/04 04:55:32 $
3    *
4    *  Copyright 2002 by Daniel Kehoe <kehoe@fortuity.com>
5    *  All Rights Reserved
6    *
7    *  Redistribution and use in source and binary forms, with or without
8    *  modification, are permitted provided that the following conditions
9    *  are met:
10   *  1. Redistributions of source code must retain the above copyright
11   *  notice, this list of conditions and the following disclaimer.
12   *  2. Redistributions in binary form must reproduce the above copyright
13   *  notice, this list of conditions and the following disclaimer in the
14   *  documentation and/or other materials provided with the distribution.
15   *
16   *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17   *  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18   *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19   *  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20   *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21   *  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22   *  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23   *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24   *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25   *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26   *  SUCH DAMAGE.
27   */
28  package info.crossbar.state;
29  
30  import java.util.logging.Logger;
31  import java.util.logging.Level;
32  import java.util.*;
33  
34  import javax.servlet.ServletException;
35  
36  import java.sql.SQLException;
37  
38  import info.crossbar.state.CrossbarPersistentBean;
39  
40  /**
41   * AllUsers class for use by <a href="http://www.crossbar.info/">Crossbar</a>
42   *
43   * @author     Daniel Kehoe, <a href="http://www.fortuity.com/">Fortuity Consulting</a>
44   * @created    January 23, 2002
45   * @version    <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/crossbar/crossbar-sitemap/src/java/info/crossbar/state/AllUsers.java">View source, revision history</a>
46   * $Revision: 1.3 $ $Date: 2003/06/04 04:55:32 $
47   * <p>
48   * DESCRIPTION:
49   * Maintains a collection of Users.
50   */
51  
52  public class AllUsers extends CrossbarPersistentBean {
53  
54    /**
55     * Set up logging.
56     *
57     */
58    private static Logger log = Logger.getLogger(AllUsers.class.getName());
59  
60    private static ArrayList fields = new ArrayList(Arrays.asList(new String[]{
61      "userID", 
62      "email", 
63      "password",
64      "role",
65      "name",
66    })); 
67      
68    // members
69    protected String tableID = "All Users";
70    private String userID;
71    private String email;
72    private String password;
73    private String role;
74    private String name;
75    
76    /**
77     * No argument Constructor.
78     *
79     */
80    public AllUsers() 
81      throws SQLException {
82      log.entering(AllUsers.class.getName(), "Constructor");
83      init(this.tableID, this.fields);
84      load();
85      log.exiting(AllUsers.class.getName(), "Constructor");
86    }
87    
88    public void load() {
89      load("select user from user in class info.crossbar.state.User");
90    }
91    
92  }// end of class AllUsers