org.rhq.enterprise.server.resource.metadata
Class ResourceMetadataManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean
All Implemented Interfaces:
ResourceMetadataManagerLocal

public class ResourceMetadataManagerBean
extends java.lang.Object
implements ResourceMetadataManagerLocal

This class manages the metadata for resources. Plugins are registered against this bean so that their metadata can be pulled out and stored as necessary.

Author:
Greg Hinkle, Heiko W. Rupp, John Mazzitelli

Constructor Summary
ResourceMetadataManagerBean()
           
 
Method Summary
 Plugin getPlugin(java.lang.String name)
          Returns the information on the given plugin as found in the database.
 java.util.List<Plugin> getPlugins()
          Returns the information on all agent plugins as found in the database.
 java.util.List<Plugin> getPluginsByResourceTypeAndCategory(java.lang.String resourceTypeName, ResourceCategory resourceCategory)
           
 void registerPlugin(Subject whoami, Plugin plugin, PluginDescriptor pluginDescriptor, java.io.File pluginFile, boolean forceUpdate)
          For server-side registration of plugin archives.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceMetadataManagerBean

public ResourceMetadataManagerBean()
Method Detail

getPlugin

public Plugin getPlugin(java.lang.String name)
Returns the information on the given plugin as found in the database.

Specified by:
getPlugin in interface ResourceMetadataManagerLocal
Parameters:
name - the name of a plugin
Returns:
the plugin with the specified name
Throws:
javax.persistence.NoResultException - when no plugin with that name exists

getPlugins

public java.util.List<Plugin> getPlugins()
Returns the information on all agent plugins as found in the database.

Specified by:
getPlugins in interface ResourceMetadataManagerLocal
Returns:
list of plugins deployed

getPluginsByResourceTypeAndCategory

public java.util.List<Plugin> getPluginsByResourceTypeAndCategory(java.lang.String resourceTypeName,
                                                                  ResourceCategory resourceCategory)
Specified by:
getPluginsByResourceTypeAndCategory in interface ResourceMetadataManagerLocal

registerPlugin

public void registerPlugin(Subject whoami,
                           Plugin plugin,
                           PluginDescriptor pluginDescriptor,
                           java.io.File pluginFile,
                           boolean forceUpdate)
                    throws java.lang.Exception
Description copied from interface: ResourceMetadataManagerLocal
For server-side registration of plugin archives. At server startup or as new plugins are runtime deployed the jar will have its descriptor read and parsed and the metadata for the plugin will be updated in the db. If you provide a non-null pluginFile, and the plugin is deemed to be new or updated, the content of the file will be streamed to the database. Note that if you provide a non-null file, you must ensure its MD5 matches that of the file (i.e. this method will not attempt to recompute the file's MD5, it will assume the caller has already done that and provided the proper MD5 in plugin).

Specified by:
registerPlugin in interface ResourceMetadataManagerLocal
plugin - The plugin object being deployed
pluginDescriptor - The plugin descriptor file
pluginFile - the actual plugin file whose content will be stored in the database (will be ignored if null)
forceUpdate - if true, the plugin's types will be updated, even if the plugin hasn't changed since the last time it was registered
Throws:
java.lang.Exception


Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.