KickJava   Java API By Example, From Geeks To Geeks.

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


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: UpdateAvailableMsg.java,v 1.1.1.1 2001/10/23 13:37:19 lizellaman Exp $
25  * $Log: UpdateAvailableMsg.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 import java.io.Serializable JavaDoc;
34 import javax.swing.tree.DefaultMutableTreeNode JavaDoc;
35
36 /**
37  * This class is sent in the command stream and is used to indicate a change in the
38  * tree structure has happened (Consumer started consuming a Channel, etc).
39  *
40  * @author Charles Wood
41  * @version 1.0
42  */

43 public class UpdateAvailableMsg implements Serializable JavaDoc
44    {
45    /**
46     * used to indicate what version of this class is seriallized.
47     *
48     */

49    static final long serialVersionUID = 8429669002181117438L;
50
51    /**
52     * Message that may indicate what activity happened that made update necessary
53     *
54     */

55    String JavaDoc activityMsg;
56
57    /**
58     * The DefaultMutableTreeNode that is to be added or removed
59     *
60     */

61    DefaultObjectInfo doi = null;
62
63    /**
64     * indicates if treeNode is to be added or removed, true for add, false for remove
65     *
66     */

67    boolean newTreeNode;
68
69    /**
70     * Constructor, does no initialization of its own
71     *
72     */

73    public UpdateAvailableMsg()
74       {
75       }
76
77    /**
78     * class constructor, used to send message to HC functions to inform them to retrieve new tree
79     *
80     * @param activityMsg the message that indicates what activity occured
81     */

82    public UpdateAvailableMsg(String JavaDoc activityMsg)
83       {
84       this.activityMsg = activityMsg;
85       }
86
87    /**
88     * class constructor, used to send information to sessionmangers about how to update their tree
89     *
90     * @param activityMsg the message that indicates what activity occured
91     * @param doi the instance to be added/removed from the tree
92     * @param newTreeNode true if doi is to be added, false if it is to be
93     * removed
94     */

95    public UpdateAvailableMsg(String JavaDoc activityMsg,
96                              DefaultObjectInfo doi,
97                              boolean newTreeNode)
98       {
99       this(activityMsg);
100       this.doi = doi;
101       this.newTreeNode = newTreeNode;
102       }
103
104    /**
105     * returns a description of what activity has transpired
106     *
107     * @return the activity that caused this message to be issued
108     */

109    public String JavaDoc
110    getMsg()
111       {
112       return activityMsg;
113       }
114
115    /**
116     * returns the object that is associated with this update
117     *
118     * @return the object for this update
119     */

120    public DefaultObjectInfo
121    getObject()
122       {
123       return doi;
124       }
125
126    /**
127     * return indication of whether or not to add the associated treeNode,
128     * true if treeNode is new and should be added, false if it is already known and
129     * should be removed.
130     *
131     * @return true if treeNode is new, false otherwise
132     */

133    public boolean
134    getIsNewTreeNode()
135       {
136       return newTreeNode;
137       }
138
139    }
140
Popular Tags