MonitoredObject.java revision 608:7e06bf1dcb09
1190971Srmacklem/*
2190971Srmacklem * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
3190971Srmacklem * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4190971Srmacklem *
5190971Srmacklem * This code is free software; you can redistribute it and/or modify it
6190971Srmacklem * under the terms of the GNU General Public License version 2 only, as
7190971Srmacklem * published by the Free Software Foundation.  Oracle designates this
8190971Srmacklem * particular file as subject to the "Classpath" exception as provided
9190971Srmacklem * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.corba.se.spi.monitoring;
26
27
28import com.sun.corba.se.spi.monitoring.MonitoredAttribute;
29import java.util.*;
30import java.util.Collection;
31
32/**
33 * <p>
34 *
35 * @author Hemanth Puttaswamy
36 * </p>
37 * <p>
38 * Monitored Object provides an Hierarchichal view of the ORB Monitoring
39 * System. It can contain multiple children and a single parent. Each
40 * Monitored Object may also contain Multiple Monitored Attributes.
41 * </p>
42 */
43public interface MonitoredObject {
44
45  ///////////////////////////////////////
46  // operations
47/**
48 * <p>
49 * Gets the name of this MonitoredObject
50 * </p><p>
51 *
52 * @return a String with name of this Monitored Object
53 * </p>
54 */
55    public String getName();
56/**
57 * <p>
58 * Gets the description of MonitoredObject
59 * </p><p>
60 *
61 * @return a String with Monitored Object Description.
62 * </p>
63 */
64    public String getDescription();
65/**
66 * <p>
67 * This method will add a child Monitored Object to this Monitored Object.
68 * </p>
69 * <p>
70 * </p>
71 */
72    public void addChild( MonitoredObject m );
73/**
74 * <p>
75 * This method will remove child Monitored Object identified by the given name
76 * </p>
77 * <p>
78 * @param name of the ChildMonitored Object
79 * </p>
80 */
81    public void removeChild( String name );
82
83/**
84 * <p>
85 * Gets the child MonitoredObject associated with this MonitoredObject
86 * instance using name as the key. The name should be fully qualified name
87 * like orb.connectionmanager
88 * </p>
89 * <p>
90 *
91 * @return a MonitoredObject identified by the given name
92 * </p>
93 * <p>
94 * @param name of the ChildMonitored Object
95 * </p>
96 */
97    public MonitoredObject getChild(String name);
98/**
99 * <p>
100 * Gets all the Children registered under this instance of Monitored
101 * Object.
102 * </p>
103 * <p>
104 *
105 * @return Collection of immediate Children associated with this MonitoredObject.
106 * </p>
107 */
108    public Collection getChildren();
109/**
110 * <p>
111 * Sets the parent for this Monitored Object.
112 * </p>
113 * <p>
114 * </p>
115 */
116    public void setParent( MonitoredObject m );
117/**
118 * <p>
119 * There will be only one parent for an instance of MontoredObject, this
120 * call gets parent and returns null if the Monitored Object is the root.
121 * </p>
122 * <p>
123 *
124 * @return a MonitoredObject which is a Parent of this Monitored Object instance
125 * </p>
126 */
127    public MonitoredObject getParent();
128
129/**
130 * <p>
131 * Adds the attribute with the given name.
132 * </p>
133 * <p>
134 *
135 * </p>
136 * <p>
137 * @param value is the MonitoredAttribute which will be set as one of the
138 * attribute of this MonitoredObject.
139 * </p>
140 */
141    public void addAttribute(MonitoredAttribute value);
142/**
143 * <p>
144 * Removes the attribute with the given name.
145 * </p>
146 * <p>
147 *
148 * </p>
149 * <p>
150 * @param name is the MonitoredAttribute name
151 * </p>
152 */
153    public void removeAttribute(String name);
154
155/**
156 * <p>
157 * Gets the Monitored Object registered by the given name
158 * </p>
159 *
160 * <p>
161 * @return a MonitoredAttribute identified by the given name
162 * </p>
163 * <p>
164 * @param name of the attribute
165 * </p>
166 */
167    public MonitoredAttribute getAttribute(String name);
168/**
169 * <p>
170 * Gets all the Monitored Attributes for this Monitored Objects. It doesn't
171 * include the Child Monitored Object, that needs to be traversed using
172 * getChild() or getChildren() call.
173 * </p>
174 * <p>
175 *
176 * @return Collection of all the Attributes for this MonitoredObject
177 * </p>
178 */
179    public Collection getAttributes();
180/**
181 * <p>
182 * Clears the state of all the Monitored Attributes associated with the
183 * Monitored Object. It will also clear the state on all it's child
184 * Monitored Object. The call to clearState will be initiated from
185 * CORBAMBean.startMonitoring() call.
186 * </p>
187 *
188 */
189    public void clearState();
190
191} // end MonitoredObject
192