001: /* ----- BEGIN LICENSE BLOCK -----
002: * Version: MPL 1.1
003: *
004: * The contents of this file are subject to the Mozilla Public License Version
005: * 1.1 (the "License"); you may not use this file except in compliance with
006: * the License. You may obtain a copy of the License at
007: * http://www.mozilla.org/MPL/
008: *
009: * Software distributed under the License is distributed on an "AS IS" basis,
010: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
011: * for the specific language governing rights and limitations under the
012: * License.
013: *
014: * The Original Code is the DataShare server.
015: *
016: * The Initial Developer of the Original Code is
017: * Ball Aerospace & Technologies Corp, Fairborn, Ohio
018: * Portions created by the Initial Developer are Copyright (C) 2001
019: * the Initial Developer. All Rights Reserved.
020: *
021: * Contributor(s): Charles Wood <cwood@ball.com>
022: *
023: * ----- END LICENSE BLOCK ----- */
024: /* RCS $Id: UserInfo.java,v 1.4 2002/01/29 20:50:17 lizellaman Exp $
025: * $Log: UserInfo.java,v $
026: * Revision 1.4 2002/01/29 20:50:17 lizellaman
027: * Added LoggingInterface, modified the PropertiesInterface implementation
028: *
029: * Revision 1.3 2002/01/22 15:05:53 lizellaman
030: * make admin attribute for clients default to false (was true)
031: *
032: * Revision 1.2 2002/01/03 03:37:36 lizellaman
033: * periodic update of changes I have made
034: *
035: * Revision 1.1.1.1 2001/10/23 13:37:15 lizellaman
036: * initial sourceforge release
037: *
038: */
039:
040: package org.datashare;
041:
042: import java.io.Serializable;
043: import org.datashare.objects.RegistrationInfo;
044:
045: /**
046: * contains static information about clients (things that should not change once
047: * they are connected to the server)
048: */
049: public class UserInfo implements Serializable {
050: /**
051: * this allows us to serialize this class without 'marshalling' errors.
052: *
053: */
054: static final long serialVersionUID = 9030493813756685675L;
055:
056: private RegistrationInfo regInfo = null;
057: public boolean authenticated = false; // need to decide if authenticated is defaulted to true or false (use PropertiesManager!!)
058: public boolean admin = false;
059: public String uniqueName = "";
060:
061: public String firstName = "";
062: public String lastName = "";
063: public String primaryPhone = "";
064: public String primaryEmail = "";
065: public String imageURL = "";
066: public String clientMachine = "";
067: public String serverMachine = "";
068:
069: /**
070: * private because should never be used!
071: */
072: private UserInfo() {
073: }
074:
075: /**
076: * Constructor, not useful except for testing for what type of object is in a
077: * DataShareObject
078: */
079: public UserInfo(RegistrationInfo regInfo) {
080: this .regInfo = regInfo;
081: uniqueName = regInfo.clientUserName; // default to userName
082: SessionUtilities.getLoggingInterface().debugMsg(
083: SessionUtilities.getLoggingInterface().DEBUG,
084: SessionUtilities.getLoggingInterface().CLIENT,
085: "UserInfo for " + uniqueName + " has admin set to "
086: + admin + " (for now)");
087: }
088:
089: public String getUserName() {
090: return regInfo.clientUserName;
091: }
092:
093: public int getClientMode() {
094: return regInfo.clientMode;
095: }
096:
097: public String getClientClass() {
098: return regInfo.clientClass;
099: }
100:
101: public String getEnterpriseName() {
102: return regInfo.enterpriseName;
103: }
104:
105: public String getOtherInfo() {
106: return regInfo.otherInfo;
107: }
108: }
|