KickJava   Java API By Example, From Geeks To Geeks.

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


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: InstantMsgData.java,v 1.1.1.1 2001/10/23 13:37:19 lizellaman Exp $
25  * $Log: InstantMsgData.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  * Used by InstantMessenger to send messages and to invite another User to a Session
35  *
36  * @author Charles Wood
37  * @version 1.0
38  */

39 public class InstantMsgData implements java.io.Serializable JavaDoc
40    {
41    /**
42     * this allows us to serialize this class without 'marshalling' errors.
43     *
44     */

45    static final long serialVersionUID = 9034563813476897504L;
46
47    /**
48     * msgType value, used when all we are sending is a message
49     *
50     */

51    public final static int PLAIN = 0;
52
53    /**
54     * msgType value, used when we are telling other user we do not want to join their Session
55     *
56     */

57    public final static int CANCEL = 1;
58
59    /**
60     * msgType value, used when we are sending a Session invitation to another user
61     *
62     */

63    public final static int INVITE = 2;
64
65    /**
66     * msgType value, used when we are accepting an invitation to a Session
67     *
68     */

69    public final static int ACCEPT = 3;
70
71    /**
72     * the message to be displayed by IM
73     *
74     */

75    public String JavaDoc msg;
76
77    /**
78     * indicates what type of message this is
79     *
80     */

81    public int msgType;
82
83    /**
84     * who this message is to be sent to
85     */

86    public String JavaDoc[] destinationClientKeyValue;
87
88    /**
89     * constructor
90     */

91    public InstantMsgData()
92       {
93       }
94
95    /**
96     * the normal constructor for this class when sending a plain (no reply) message
97     *
98     * @param msg the text to send along with this message
99     */

100    public InstantMsgData(String JavaDoc[] destinationUser, String JavaDoc msg)
101       {
102       this.msg = msg;
103       destinationClientKeyValue = destinationUser;
104       this.msgType = PLAIN;
105       }
106
107    /**
108     * the normal constructor for this class
109     *
110     * @param msg the text to send along with this message
111     * @param msgType the type of message this instance represents, should be
112     * PLAIN, CANCEL, INVITE, or ACCEPT
113     */

114    public InstantMsgData(String JavaDoc[] destinationUser, String JavaDoc msg, int msgType)
115       {
116       this.msg = msg;
117       destinationClientKeyValue = destinationUser;
118       this.msgType = msgType;
119       }
120
121    }
122
Popular Tags