1 /*
   2  * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * 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  */
  25 package com.sun.corba.se.spi.monitoring;
  26 
  27 
  28 import com.sun.corba.se.spi.monitoring.MonitoredAttribute;
  29 import java.util.*;
  30 import java.util.Collection;
  31 
  32 /**
  33  * @author Hemanth Puttaswamy
  34  *
  35  * Monitored Object provides an Hierarchichal view of the ORB Monitoring
  36  * System. It can contain multiple children and a single parent. Each
  37  * Monitored Object may also contain Multiple Monitored Attributes.
  38  */
  39 public interface MonitoredObject {
  40 
  41   ///////////////////////////////////////
  42   // operations
  43 /**
  44  * Gets the name of this MonitoredObject
  45  *
  46  * @return a String with name of this Monitored Object
  47  */
  48     public String getName();
  49 /**
  50  * Gets the description of MonitoredObject
  51  *
  52  * @return a String with Monitored Object Description.
  53  */
  54     public String getDescription();
  55 /**
  56  * This method will add a child Monitored Object to this Monitored Object.
  57  */
  58     public void addChild( MonitoredObject m );
  59 /**
  60  * This method will remove child Monitored Object identified by the given name
  61  *
  62  * @param name of the ChildMonitored Object
  63  */
  64     public void removeChild( String name );
  65 
  66 /**
  67  * Gets the child MonitoredObject associated with this MonitoredObject
  68  * instance using name as the key. The name should be fully qualified name
  69  * like orb.connectionmanager
  70  *
  71  * @return a MonitoredObject identified by the given name
  72  * @param name of the ChildMonitored Object
  73  */
  74     public MonitoredObject getChild(String name);
  75 /**
  76  * Gets all the Children registered under this instance of Monitored
  77  * Object.
  78  *
  79  * @return Collection of immediate Children associated with this MonitoredObject.
  80  */
  81     public Collection getChildren();
  82 /**
  83  * Sets the parent for this Monitored Object.
  84  */
  85     public void setParent( MonitoredObject m );
  86 /**
  87  * There will be only one parent for an instance of MontoredObject, this
  88  * call gets parent and returns null if the Monitored Object is the root.
  89  *
  90  * @return a MonitoredObject which is a Parent of this Monitored Object instance
  91  */
  92     public MonitoredObject getParent();
  93 
  94 /**
  95  * Adds the attribute with the given name.
  96  *
  97  * @param value is the MonitoredAttribute which will be set as one of the
  98  * attribute of this MonitoredObject.
  99  */
 100     public void addAttribute(MonitoredAttribute value);
 101 /**
 102  * Removes the attribute with the given name.
 103  *
 104  * @param name is the MonitoredAttribute name
 105  */
 106     public void removeAttribute(String name);
 107 
 108 /**
 109  * Gets the Monitored Object registered by the given name
 110  *
 111  * @return a MonitoredAttribute identified by the given name
 112  * @param name of the attribute
 113  */
 114     public MonitoredAttribute getAttribute(String name);
 115 /**
 116  * Gets all the Monitored Attributes for this Monitored Objects. It doesn't
 117  * include the Child Monitored Object, that needs to be traversed using
 118  * getChild() or getChildren() call.
 119  *
 120  * @return Collection of all the Attributes for this MonitoredObject
 121  */
 122     public Collection getAttributes();
 123 /**
 124  * Clears the state of all the Monitored Attributes associated with the
 125  * Monitored Object. It will also clear the state on all it's child
 126  * Monitored Object. The call to clearState will be initiated from
 127  * CORBAMBean.startMonitoring() call.
 128  */
 129     public void clearState();
 130 
 131 } // end MonitoredObject