KickJava   Java API By Example, From Geeks To Geeks.

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


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: RequestHistory.java,v 1.1.1.1 2001/10/23 13:37:19 lizellaman Exp $
25  * $Log: RequestHistory.java,v $
26  * Revision 1.1.1.1 2001/10/23 13:37:19 lizellaman
27  * initial sourceforge release
28  *
29  */

30
31 package org.datashare.objects;
32
33 /**
34  * This class is used when a client wishes to request EJBs (or a count of EJBs)
35  * for a particular Session and Channel. The client sends this object to the server
36  * who then responds in one of two ways. If this RequestHistory object is requesting
37  * a COUNT, then a HistoryCountObject is sent over the commandStatusChannel. If this
38  * RequestHistory object is requesting DATA, then the DataShareObjects are sent down
39  * the Channel connection, as they would be normally. Note that COUNT requests are
40  * sent to the server on the commandStatus channel while DATA and CANCEL requests
41  * are sent in the Data channel for the function;
42  *
43  */

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

50    static final long serialVersionUID = 9030493813711567504L;
51
52    /**
53     * Use this for typeOfRequest if you want to know only the number of DataShareObjects available
54     */

55    public static final int COUNT = 1;
56
57    /**
58     * Use this for typeOfRequest if you want the DataShareObjects
59     */

60    public static final int DATA = 2;
61
62    /**
63     * Use this for typeOfRequest if you want to cancel a previous DATA request
64     */

65    public static final int CANCEL = 3;
66
67    /**
68     * This defines the type of history request, use COUNT, CANCEL, or DATA
69     */

70    public int typeOfRequest = COUNT; // default value
71

72    /**
73     * The ADSKey string for the channel for which EJBs are desired (required for COUNT request)
74     */

75    public String JavaDoc channelDatabaseKey;
76
77    /**
78     * The channel name for which EJBs are desired (required for COUNT request)
79     */

80    public String JavaDoc channelName;
81
82    /**
83     * The sessionName for which EJBs are desired (required for COUNT request)
84     */

85    public String JavaDoc sessionName;
86
87    /**
88     * the user who is requesting the history, used to put a name with the request because
89     * the activate command has not been issued at the time history is requested
90     */

91    public String JavaDoc userName;
92
93    /**
94     * Constructor, normally not used
95     */

96    public RequestHistory()
97       {
98       }
99
100    /**
101     * Constructor
102     */

103    public RequestHistory(String JavaDoc userName, int typeOfRequest, String JavaDoc sessionName, String JavaDoc channelDatabaseKey, String JavaDoc channelName)
104       {
105       this.userName = userName;
106       this.typeOfRequest = typeOfRequest;
107       this.sessionName = sessionName;
108       this.channelDatabaseKey = channelDatabaseKey;
109       this.channelName = channelName;
110       }
111    }
112
Popular Tags