KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > datashare > objects > RegistrationInfo


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: RegistrationInfo.java,v 1.2 2002/02/04 13:52:48 lizellaman Exp $
25  * $Log: RegistrationInfo.java,v $
26  * Revision 1.2 2002/02/04 13:52:48 lizellaman
27  * Remove all references to past product names (or)
28  * Add PublicAPI for creating Rendezvous Sessions
29  *
30  * Revision 1.1.1.1 2001/10/23 13:37:19 lizellaman
31  * initial sourceforge release
32  *
33  */

34
35 package org.datashare.objects;
36
37 import java.io.Serializable JavaDoc;
38
39 // This is the object that is required by the server to validate a user prior to
40
// registering the user as a client. This object must be sent from the client to
41
// the server on the CommandStatus Channel before the server will allow any other
42
// connections to be activated.
43

44 public class RegistrationInfo implements Serializable JavaDoc
45    {
46    /**
47     * this allows us to serialize this class without 'marshalling' errors.
48     *
49     */

50    static final long serialVersionUID = 9030493813711545676L;
51
52    public String JavaDoc clientUserName; // the client's username
53
public String JavaDoc password;
54    public String JavaDoc enterpriseName;
55    public String JavaDoc clientClass; // used to organize different types of clients (visibility, tree location)
56

57    /**
58     * indicates how the client code was launched (APPLET/APPLICATION/DESKTOP)
59     */

60    public int clientMode;
61
62    final public static int UNKNOWN = 0;
63
64    /**
65     * clientMode for clients that were launched as an Applet
66     */

67    final public static int APPLET = 1; // this client was launched as an applet
68
/**
69     * clientMode for clients that were launched as an Application
70     */

71    final public static int APPLICATION = 2; // this client was launched as an application
72
/**
73     * clientMode for clients that were launched from the K2 Desktop
74     */

75    final public static int DESKTOP = 3; // this client was launched from the K2 desktop
76
/**
77     * clienMode for automatic clients, like from the public API
78     */

79    final public static int PUBLIC_API = 4;
80    /**
81     * when indexed by clientMode, returns mode in which client was started/launched
82     */

83    final public static String JavaDoc clientModes[] = {"Unknown", "Applet", "Application", "Desktop", "public API"};
84
85    /**
86     * this field is available to let the user input optional additional info about themselves.
87     */

88    public String JavaDoc otherInfo = "";
89
90    /**
91     * Constructor, not useful
92     */

93    private RegistrationInfo()
94       {}
95
96    public RegistrationInfo(String JavaDoc clientUserName, String JavaDoc password, String JavaDoc enterpriseName,
97                            String JavaDoc clientClass, int clientMode, String JavaDoc otherInfo)
98       {
99       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    }
107
Popular Tags