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: RegistrationInfo.java,v 1.2 2002/02/04 13:52:48 lizellaman Exp $
025: * $Log: RegistrationInfo.java,v $
026: * Revision 1.2 2002/02/04 13:52:48 lizellaman
027: * Remove all references to past product names (or)
028: * Add PublicAPI for creating Rendezvous Sessions
029: *
030: * Revision 1.1.1.1 2001/10/23 13:37:19 lizellaman
031: * initial sourceforge release
032: *
033: */
034:
035: package org.datashare.objects;
036:
037: import java.io.Serializable;
038:
039: // This is the object that is required by the server to validate a user prior to
040: // registering the user as a client. This object must be sent from the client to
041: // the server on the CommandStatus Channel before the server will allow any other
042: // connections to be activated.
043:
044: public class RegistrationInfo implements Serializable {
045: /**
046: * this allows us to serialize this class without 'marshalling' errors.
047: *
048: */
049: static final long serialVersionUID = 9030493813711545676L;
050:
051: public String clientUserName; // the client's username
052: public String password;
053: public String enterpriseName;
054: public String clientClass; // used to organize different types of clients (visibility, tree location)
055:
056: /**
057: * indicates how the client code was launched (APPLET/APPLICATION/DESKTOP)
058: */
059: public int clientMode;
060:
061: final public static int UNKNOWN = 0;
062:
063: /**
064: * clientMode for clients that were launched as an Applet
065: */
066: final public static int APPLET = 1; // this client was launched as an applet
067: /**
068: * clientMode for clients that were launched as an Application
069: */
070: final public static int APPLICATION = 2; // this client was launched as an application
071: /**
072: * clientMode for clients that were launched from the K2 Desktop
073: */
074: final public static int DESKTOP = 3; // this client was launched from the K2 desktop
075: /**
076: * clienMode for automatic clients, like from the public API
077: */
078: final public static int PUBLIC_API = 4;
079: /**
080: * when indexed by clientMode, returns mode in which client was started/launched
081: */
082: final public static String clientModes[] = { "Unknown", "Applet",
083: "Application", "Desktop", "public API" };
084:
085: /**
086: * this field is available to let the user input optional additional info about themselves.
087: */
088: public String otherInfo = "";
089:
090: /**
091: * Constructor, not useful
092: */
093: private RegistrationInfo() {
094: }
095:
096: public RegistrationInfo(String clientUserName, String password,
097: String enterpriseName, String clientClass, int clientMode,
098: String otherInfo) {
099: this.clientUserName = clientUserName;
100: this.password = password;
101: this.enterpriseName = enterpriseName;
102: this.clientClass = clientClass;
103: this.clientMode = clientMode;
104: this.otherInfo = otherInfo;
105: }
106: }
|