com.sun.management.oss.impl.model
Interface GenericModel

All Known Subinterfaces:
ByClassesGenericModel, OperationalStatusGenericModel, PerformanceGenericModel
All Known Implementing Classes:
OperationalStatusMfModel, PerformanceMfModel

public interface GenericModel

GenericModel class. This interface to be implemented by each data model if the factory does not support ByClasses jobs, otherwise, data model should be created inheriting from the ByClassesGenericModelinterface.

Version:
1.0

Method Summary
 PerformanceAttributeDescriptor[] getObservableAttributes(java.lang.String observableObjectClassName)
          getObservableAttributes will return all observable attributes for a certain class.
 ObservableObjectClassIterator getObservableObjectClasses()
          getObservableObjectClasses will return all observable object classes in the model.
 ObservableObjectIterator getObservableObjects(java.lang.String observableObjectClassName, javax.management.ObjectName base)
          getObservableObjects will return all observable objects of a certain class matching the JMX pattern base.
 int[] getSupportedGranularities(java.lang.String observableObjectClass)
          getSupportedGranularities will return an array of granularities that is supported by the supplied observable object class.
 javax.management.ObjectName[] getSupportedObservableObjects(javax.management.ObjectName[] dnList)
          getSupportedObservableObjects will filter out which of the potentially observable objects are actually observable.
 boolean isMatchingNamingRules(javax.management.ObjectName dn)
          isMatchingNamingRules Returns true if the given object distinguished name is valid for the naming rules of the data model.
 void setMBS(javax.management.MBeanServer ms)
          setMBS is the first method called by the factory, after having instanciated its own GenericModel object.
 

Method Detail

setMBS

public void setMBS(javax.management.MBeanServer ms)
            throws java.lang.IllegalArgumentException
setMBS is the first method called by the factory, after having instanciated its own GenericModel object. It must be coded so that the MBeanServer is kept into object and used for performing necessary JMX queries.

Parameters:
ms - the MBeanServer to be used for queries.
Throws:
java.lang.IllegalArgumentException - Is raised if the input parameter is null.

getObservableObjects

public ObservableObjectIterator getObservableObjects(java.lang.String observableObjectClassName,
                                                     javax.management.ObjectName base)
                                              throws java.lang.IllegalArgumentException
getObservableObjects will return all observable objects of a certain class matching the JMX pattern base.

Parameters:
observableObjectClassName - The class name of the observable object instances to be found.
base - The JMX pattern for the search.
Returns:
Iterator that contains all supported observable objects (ObjectNames objects).
Throws:
java.lang.IllegalArgumentException - Is raised if the input parameters are not valid.

getSupportedObservableObjects

public javax.management.ObjectName[] getSupportedObservableObjects(javax.management.ObjectName[] dnList)
getSupportedObservableObjects will filter out which of the potentially observable objects are actually observable.

If an object of the provided list is present in the returned list, that means it is an observable object (a job can be created for this object).

Parameters:
dnList - List of object names to check for observability.
Returns:
strSupported

getObservableObjectClasses

public ObservableObjectClassIterator getObservableObjectClasses()
getObservableObjectClasses will return all observable object classes in the model.

Returns:
An array of granularities that is supported by the supplied observable object class.

getObservableAttributes

public PerformanceAttributeDescriptor[] getObservableAttributes(java.lang.String observableObjectClassName)
                                                         throws java.lang.IllegalArgumentException
getObservableAttributes will return all observable attributes for a certain class.

Parameters:
observableObjectClassName - The class name of the observable object instances to be found.
Returns:
An array of attribute descriptors.
Throws:
java.lang.IllegalArgumentException - Is raised if the input parameters are not valid.

isMatchingNamingRules

public boolean isMatchingNamingRules(javax.management.ObjectName dn)
isMatchingNamingRules Returns true if the given object distinguished name is valid for the naming rules of the data model.

Parameters:
dn - The object name to check for validity.
Returns:
True if the object name is valid.

getSupportedGranularities

public int[] getSupportedGranularities(java.lang.String observableObjectClass)
                                throws java.lang.IllegalArgumentException
getSupportedGranularities will return an array of granularities that is supported by the supplied observable object class.

Parameters:
observableObjectClass - Class you want to know the supported granularities for.
Returns:
An array of granularities that is supported by the supplied observable object class.
Throws:
java.lang.IllegalArgumentException - Is raised if an arguement has a wrong format/value.