1. /*
  2. * @(#)MonitoredObject.java 1.4 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.spi.monitoring;
  8. import com.sun.corba.se.spi.monitoring.MonitoredAttribute;
  9. import java.util.*;
  10. import java.util.Collection;
  11. /**
  12. * <p>
  13. *
  14. * @author Hemanth Puttaswamy
  15. * </p>
  16. * <p>
  17. * Monitored Object provides an Hierarchichal view of the ORB Monitoring
  18. * System. It can contain multiple children and a single parent. Each
  19. * Monitored Object may also contain Multiple Monitored Attributes.
  20. * </p>
  21. */
  22. public interface MonitoredObject {
  23. ///////////////////////////////////////
  24. // operations
  25. /**
  26. * <p>
  27. * Gets the name of this MonitoredObject
  28. * </p><p>
  29. *
  30. * @return a String with name of this Monitored Object
  31. * </p>
  32. */
  33. public String getName();
  34. /**
  35. * <p>
  36. * Gets the description of MonitoredObject
  37. * </p><p>
  38. *
  39. * @return a String with Monitored Object Description.
  40. * </p>
  41. */
  42. public String getDescription();
  43. /**
  44. * <p>
  45. * This method will add a child Monitored Object to this Monitored Object.
  46. * </p>
  47. * <p>
  48. * </p>
  49. */
  50. public void addChild( MonitoredObject m );
  51. /**
  52. * <p>
  53. * This method will remove child Monitored Object identified by the given name
  54. * </p>
  55. * <p>
  56. * @param name of the ChildMonitored Object
  57. * </p>
  58. */
  59. public void removeChild( String name );
  60. /**
  61. * <p>
  62. * Gets the child MonitoredObject associated with this MonitoredObject
  63. * instance using name as the key. The name should be fully qualified name
  64. * like orb.connectionmanager
  65. * </p>
  66. * <p>
  67. *
  68. * @return a MonitoredObject identified by the given name
  69. * </p>
  70. * <p>
  71. * @param name of the ChildMonitored Object
  72. * </p>
  73. */
  74. public MonitoredObject getChild(String name);
  75. /**
  76. * <p>
  77. * Gets all the Children registered under this instance of Monitored
  78. * Object.
  79. * </p>
  80. * <p>
  81. *
  82. * @return Collection of immediate Children associated with this MonitoredObject.
  83. * </p>
  84. */
  85. public Collection getChildren();
  86. /**
  87. * <p>
  88. * Sets the parent for this Monitored Object.
  89. * </p>
  90. * <p>
  91. * </p>
  92. */
  93. public void setParent( MonitoredObject m );
  94. /**
  95. * <p>
  96. * There will be only one parent for an instance of MontoredObject, this
  97. * call gets parent and returns null if the Monitored Object is the root.
  98. * </p>
  99. * <p>
  100. *
  101. * @return a MonitoredObject which is a Parent of this Monitored Object instance
  102. * </p>
  103. */
  104. public MonitoredObject getParent();
  105. /**
  106. * <p>
  107. * Adds the attribute with the given name.
  108. * </p>
  109. * <p>
  110. *
  111. * </p>
  112. * <p>
  113. * @param value is the MonitoredAttribute which will be set as one of the
  114. * attribute of this MonitoredObject.
  115. * </p>
  116. */
  117. public void addAttribute(MonitoredAttribute value);
  118. /**
  119. * <p>
  120. * Removes the attribute with the given name.
  121. * </p>
  122. * <p>
  123. *
  124. * </p>
  125. * <p>
  126. * @param name is the MonitoredAttribute name
  127. * </p>
  128. */
  129. public void removeAttribute(String name);
  130. /**
  131. * <p>
  132. * Gets the Monitored Object registered by the given name
  133. * </p>
  134. *
  135. * <p>
  136. * @return a MonitoredAttribute identified by the given name
  137. * </p>
  138. * <p>
  139. * @param name of the attribute
  140. * </p>
  141. */
  142. public MonitoredAttribute getAttribute(String name);
  143. /**
  144. * <p>
  145. * Gets all the Monitored Attributes for this Monitored Objects. It doesn't
  146. * include the Child Monitored Object, that needs to be traversed using
  147. * getChild() or getChildren() call.
  148. * </p>
  149. * <p>
  150. *
  151. * @return Collection of all the Attributes for this MonitoredObject
  152. * </p>
  153. */
  154. public Collection getAttributes();
  155. /**
  156. * <p>
  157. * Clears the state of all the Monitored Attributes associated with the
  158. * Monitored Object. It will also clear the state on all it's child
  159. * Monitored Object. The call to clearState will be initiated from
  160. * CORBAMBean.startMonitoring() call.
  161. * </p>
  162. *
  163. */
  164. public void clearState();
  165. } // end MonitoredObject