InstantMsgData.java :  » Groupware » Data-share » org » datashare » objects » Java Open Source

Java Open Source » Groupware » Data share 
Data share » org » datashare » objects » InstantMsgData.java
/* ----- BEGIN LICENSE BLOCK -----
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is the DataShare server.
 *
 * The Initial Developer of the Original Code is
 * Ball Aerospace & Technologies Corp, Fairborn, Ohio
 * Portions created by the Initial Developer are Copyright (C) 2001
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s): Charles Wood <cwood@ball.com>
 *
 * ----- END LICENSE BLOCK ----- */
/* RCS $Id: InstantMsgData.java,v 1.1.1.1 2001/10/23 13:37:19 lizellaman Exp $
 * $Log: InstantMsgData.java,v $
 * Revision 1.1.1.1  2001/10/23 13:37:19  lizellaman
 * initial sourceforge release
 *
 */

package org.datashare.objects;

/**
 * Used by InstantMessenger to send messages and to invite another User to a Session
 *
 * @author Charles Wood
 * @version 1.0
 */
public class InstantMsgData implements java.io.Serializable
   {
   /**
    * this allows us to serialize this class without 'marshalling' errors.
    *
    */
   static final long serialVersionUID = 9034563813476897504L;

   /**
    * msgType value, used when all we are sending is a message
    *
    */
   public final static int PLAIN = 0;

   /**
    * msgType value, used when we are telling other user we do not want to join their Session
    *
    */
   public final static int CANCEL = 1;

   /**
    * msgType value, used when we are sending a Session invitation to another user
    *
    */
   public final static int INVITE = 2;

   /**
    * msgType value, used when we are accepting an invitation to a Session
    *
    */
   public final static int ACCEPT = 3;

   /**
    * the message to be displayed by IM
    *
    */
   public String msg;

   /**
    * indicates what type of message this is
    *
    */
   public int msgType;

   /**
    * who this message is to be sent to
    */
   public String[] destinationClientKeyValue;

   /**
    * constructor
    */
   public InstantMsgData()
      {
      }

   /**
    * the normal constructor for this class when sending a plain (no reply) message
    *
    * @param msg the text to send along with this message
    */
   public InstantMsgData(String[] destinationUser, String msg)
      {
      this.msg = msg;
      destinationClientKeyValue = destinationUser;
      this.msgType = PLAIN;
      }

   /**
    * the normal constructor for this class
    *
    * @param msg the text to send along with this message
    * @param msgType the type of message this instance represents, should be
    *     PLAIN, CANCEL, INVITE, or ACCEPT
    */
   public InstantMsgData(String[] destinationUser, String msg, int msgType)
      {
      this.msg = msg;
      destinationClientKeyValue = destinationUser;
      this.msgType = msgType;
      }

   }
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.