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: InstantMsgData.java,v 1.1.1.1 2001/10/23 13:37:19 lizellaman Exp $
025: * $Log: InstantMsgData.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: * Used by InstantMessenger to send messages and to invite another User to a Session
035: *
036: * @author Charles Wood
037: * @version 1.0
038: */
039: public class InstantMsgData implements java.io.Serializable {
040: /**
041: * this allows us to serialize this class without 'marshalling' errors.
042: *
043: */
044: static final long serialVersionUID = 9034563813476897504L;
045:
046: /**
047: * msgType value, used when all we are sending is a message
048: *
049: */
050: public final static int PLAIN = 0;
051:
052: /**
053: * msgType value, used when we are telling other user we do not want to join their Session
054: *
055: */
056: public final static int CANCEL = 1;
057:
058: /**
059: * msgType value, used when we are sending a Session invitation to another user
060: *
061: */
062: public final static int INVITE = 2;
063:
064: /**
065: * msgType value, used when we are accepting an invitation to a Session
066: *
067: */
068: public final static int ACCEPT = 3;
069:
070: /**
071: * the message to be displayed by IM
072: *
073: */
074: public String msg;
075:
076: /**
077: * indicates what type of message this is
078: *
079: */
080: public int msgType;
081:
082: /**
083: * who this message is to be sent to
084: */
085: public String[] destinationClientKeyValue;
086:
087: /**
088: * constructor
089: */
090: public InstantMsgData() {
091: }
092:
093: /**
094: * the normal constructor for this class when sending a plain (no reply) message
095: *
096: * @param msg the text to send along with this message
097: */
098: public InstantMsgData(String[] destinationUser, String msg) {
099: this .msg = msg;
100: destinationClientKeyValue = destinationUser;
101: this .msgType = PLAIN;
102: }
103:
104: /**
105: * the normal constructor for this class
106: *
107: * @param msg the text to send along with this message
108: * @param msgType the type of message this instance represents, should be
109: * PLAIN, CANCEL, INVITE, or ACCEPT
110: */
111: public InstantMsgData(String[] destinationUser, String msg,
112: int msgType) {
113: this.msg = msg;
114: destinationClientKeyValue = destinationUser;
115: this.msgType = msgType;
116: }
117:
118: }
|