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: UpdateAvailableMsg.java,v 1.1.1.1 2001/10/23 13:37:19 lizellaman Exp $
025: * $Log: UpdateAvailableMsg.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: import java.io.Serializable;
034: import javax.swing.tree.DefaultMutableTreeNode;
035:
036: /**
037: * This class is sent in the command stream and is used to indicate a change in the
038: * tree structure has happened (Consumer started consuming a Channel, etc).
039: *
040: * @author Charles Wood
041: * @version 1.0
042: */
043: public class UpdateAvailableMsg implements Serializable {
044: /**
045: * used to indicate what version of this class is seriallized.
046: *
047: */
048: static final long serialVersionUID = 8429669002181117438L;
049:
050: /**
051: * Message that may indicate what activity happened that made update necessary
052: *
053: */
054: String activityMsg;
055:
056: /**
057: * The DefaultMutableTreeNode that is to be added or removed
058: *
059: */
060: DefaultObjectInfo doi = null;
061:
062: /**
063: * indicates if treeNode is to be added or removed, true for add, false for remove
064: *
065: */
066: boolean newTreeNode;
067:
068: /**
069: * Constructor, does no initialization of its own
070: *
071: */
072: public UpdateAvailableMsg() {
073: }
074:
075: /**
076: * class constructor, used to send message to HC functions to inform them to retrieve new tree
077: *
078: * @param activityMsg the message that indicates what activity occured
079: */
080: public UpdateAvailableMsg(String activityMsg) {
081: this .activityMsg = activityMsg;
082: }
083:
084: /**
085: * class constructor, used to send information to sessionmangers about how to update their tree
086: *
087: * @param activityMsg the message that indicates what activity occured
088: * @param doi the instance to be added/removed from the tree
089: * @param newTreeNode true if doi is to be added, false if it is to be
090: * removed
091: */
092: public UpdateAvailableMsg(String activityMsg,
093: DefaultObjectInfo doi, boolean newTreeNode) {
094: this (activityMsg);
095: this .doi = doi;
096: this .newTreeNode = newTreeNode;
097: }
098:
099: /**
100: * returns a description of what activity has transpired
101: *
102: * @return the activity that caused this message to be issued
103: */
104: public String getMsg() {
105: return activityMsg;
106: }
107:
108: /**
109: * returns the object that is associated with this update
110: *
111: * @return the object for this update
112: */
113: public DefaultObjectInfo getObject() {
114: return doi;
115: }
116:
117: /**
118: * return indication of whether or not to add the associated treeNode,
119: * true if treeNode is new and should be added, false if it is already known and
120: * should be removed.
121: *
122: * @return true if treeNode is new, false otherwise
123: */
124: public boolean getIsNewTreeNode() {
125: return newTreeNode;
126: }
127:
128: }
|