KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > datashare > UserInfo


1 /* ----- BEGIN LICENSE BLOCK -----
2  * Version: MPL 1.1
3  *
4  * The contents of this file are subject to the Mozilla Public License Version
5  * 1.1 (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS" basis,
10  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11  * for the specific language governing rights and limitations under the
12  * License.
13  *
14  * The Original Code is the DataShare server.
15  *
16  * The Initial Developer of the Original Code is
17  * Ball Aerospace & Technologies Corp, Fairborn, Ohio
18  * Portions created by the Initial Developer are Copyright (C) 2001
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s): Charles Wood <cwood@ball.com>
22  *
23  * ----- END LICENSE BLOCK ----- */

24 /* RCS $Id: UserInfo.java,v 1.4 2002/01/29 20:50:17 lizellaman Exp $
25  * $Log: UserInfo.java,v $
26  * Revision 1.4 2002/01/29 20:50:17 lizellaman
27  * Added LoggingInterface, modified the PropertiesInterface implementation
28  *
29  * Revision 1.3 2002/01/22 15:05:53 lizellaman
30  * make admin attribute for clients default to false (was true)
31  *
32  * Revision 1.2 2002/01/03 03:37:36 lizellaman
33  * periodic update of changes I have made
34  *
35  * Revision 1.1.1.1 2001/10/23 13:37:15 lizellaman
36  * initial sourceforge release
37  *
38  */

39
40 package org.datashare;
41
42 import java.io.Serializable JavaDoc;
43 import org.datashare.objects.RegistrationInfo;
44
45 /**
46  * contains static information about clients (things that should not change once
47  * they are connected to the server)
48  */

49 public class UserInfo implements Serializable JavaDoc
50    {
51    /**
52     * this allows us to serialize this class without 'marshalling' errors.
53     *
54     */

55    static final long serialVersionUID = 9030493813756685675L;
56
57    private RegistrationInfo regInfo = null;
58    public boolean authenticated = false; // need to decide if authenticated is defaulted to true or false (use PropertiesManager!!)
59
public boolean admin = false;
60    public String JavaDoc uniqueName = "";
61
62    public String JavaDoc firstName = "";
63    public String JavaDoc lastName = "";
64    public String JavaDoc primaryPhone = "";
65    public String JavaDoc primaryEmail = "";
66    public String JavaDoc imageURL = "";
67    public String JavaDoc clientMachine = "";
68    public String JavaDoc serverMachine = "";
69
70    /**
71     * private because should never be used!
72     */

73    private UserInfo()
74       {
75       }
76
77    /**
78     * Constructor, not useful except for testing for what type of object is in a
79     * DataShareObject
80     */

81    public UserInfo(RegistrationInfo regInfo)
82       {
83       this.regInfo = regInfo;
84       uniqueName = regInfo.clientUserName; // default to userName
85
SessionUtilities.getLoggingInterface().debugMsg(SessionUtilities.getLoggingInterface().DEBUG,
86          SessionUtilities.getLoggingInterface().CLIENT,
87          "UserInfo for " + uniqueName + " has admin set to " + admin + " (for now)" );
88       }
89
90    public String JavaDoc
91    getUserName()
92       {
93       return regInfo.clientUserName;
94       }
95
96    public int
97    getClientMode()
98       {
99       return regInfo.clientMode;
100       }
101
102    public String JavaDoc
103    getClientClass()
104       {
105       return regInfo.clientClass;
106       }
107
108    public String JavaDoc
109    getEnterpriseName()
110       {
111       return regInfo.enterpriseName;
112       }
113
114    public String JavaDoc
115    getOtherInfo()
116       {
117       return regInfo.otherInfo;
118       }
119    }
120
Popular Tags