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: RequestHistory.java,v 1.1.1.1 2001/10/23 13:37:19 lizellaman Exp $
025: * $Log: RequestHistory.java,v $
026: * Revision 1.1.1.1 2001/10/23 13:37:19 lizellaman
027: * initial sourceforge release
028: *
029: */
030:
031: package org.datashare.objects;
032:
033: /**
034: * This class is used when a client wishes to request EJBs (or a count of EJBs)
035: * for a particular Session and Channel. The client sends this object to the server
036: * who then responds in one of two ways. If this RequestHistory object is requesting
037: * a COUNT, then a HistoryCountObject is sent over the commandStatusChannel. If this
038: * RequestHistory object is requesting DATA, then the DataShareObjects are sent down
039: * the Channel connection, as they would be normally. Note that COUNT requests are
040: * sent to the server on the commandStatus channel while DATA and CANCEL requests
041: * are sent in the Data channel for the function;
042: *
043: */
044: public class RequestHistory implements java.io.Serializable {
045: /**
046: * this allows us to serialize this class without 'marshalling' errors.
047: *
048: */
049: static final long serialVersionUID = 9030493813711567504L;
050:
051: /**
052: * Use this for typeOfRequest if you want to know only the number of DataShareObjects available
053: */
054: public static final int COUNT = 1;
055:
056: /**
057: * Use this for typeOfRequest if you want the DataShareObjects
058: */
059: public static final int DATA = 2;
060:
061: /**
062: * Use this for typeOfRequest if you want to cancel a previous DATA request
063: */
064: public static final int CANCEL = 3;
065:
066: /**
067: * This defines the type of history request, use COUNT, CANCEL, or DATA
068: */
069: public int typeOfRequest = COUNT; // default value
070:
071: /**
072: * The ADSKey string for the channel for which EJBs are desired (required for COUNT request)
073: */
074: public String channelDatabaseKey;
075:
076: /**
077: * The channel name for which EJBs are desired (required for COUNT request)
078: */
079: public String channelName;
080:
081: /**
082: * The sessionName for which EJBs are desired (required for COUNT request)
083: */
084: public String sessionName;
085:
086: /**
087: * the user who is requesting the history, used to put a name with the request because
088: * the activate command has not been issued at the time history is requested
089: */
090: public String userName;
091:
092: /**
093: * Constructor, normally not used
094: */
095: public RequestHistory() {
096: }
097:
098: /**
099: * Constructor
100: */
101: public RequestHistory(String userName, int typeOfRequest,
102: String sessionName, String channelDatabaseKey,
103: String channelName) {
104: this.userName = userName;
105: this.typeOfRequest = typeOfRequest;
106: this.sessionName = sessionName;
107: this.channelDatabaseKey = channelDatabaseKey;
108: this.channelName = channelName;
109: }
110: }
|