org.rhq.enterprise.server.xmlschema
Class ServerPluginDescriptorMetadataParser

java.lang.Object
  extended by org.rhq.enterprise.server.xmlschema.ServerPluginDescriptorMetadataParser

public class ServerPluginDescriptorMetadataParser
extends java.lang.Object

Provides methods to parse the server plugin descriptors.

Author:
John Mazzitelli

Constructor Summary
ServerPluginDescriptorMetadataParser()
           
 
Method Summary
static java.lang.String getPluginComponentClassName(ServerPluginDescriptorType descriptor)
          Returns the fully qualified class name of the plugin component.
static ConfigurationDefinition getPluginConfigurationDefinition(ServerPluginDescriptorType descriptor)
          Returns the global configuration definition for the plugin.
static java.util.List<ScheduledJobDefinition> getScheduledJobs(Configuration scheduledJobsConfig)
          Given a configuration, this will return any scheduled jobs that are defined in it.
static java.util.List<ScheduledJobDefinition> getScheduledJobs(ServerPluginDescriptorType descriptor)
          Given a descriptor, this will parse it and return any scheduled jobs that it finds.
static ConfigurationDefinition getScheduledJobsDefinition(ServerPluginDescriptorType descriptor)
          Returns the scheduled jobs configuration definition for the plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerPluginDescriptorMetadataParser

public ServerPluginDescriptorMetadataParser()
Method Detail

getPluginComponentClassName

public static java.lang.String getPluginComponentClassName(ServerPluginDescriptorType descriptor)
Returns the fully qualified class name of the plugin component. If the descriptor did not define a plugin component, this will return null.

Parameters:
descriptor -
Returns:
the name of the plugin component class, or null if not specified

getPluginConfigurationDefinition

public static ConfigurationDefinition getPluginConfigurationDefinition(ServerPluginDescriptorType descriptor)
                                                                throws java.lang.Exception
Returns the global configuration definition for the plugin. This does not include any scheduled job information - see getScheduledJobs(ServerPluginDescriptorType) for that.

Parameters:
descriptor -
Returns:
the plugin configuration definition, or null if the descriptor did not define plugin config.
Throws:
java.lang.Exception - if the plugin descriptor was invalid

getScheduledJobsDefinition

public static ConfigurationDefinition getScheduledJobsDefinition(ServerPluginDescriptorType descriptor)
                                                          throws java.lang.Exception
Returns the scheduled jobs configuration definition for the plugin. Use getScheduledJobs(ServerPluginDescriptorType) to return a list of a more strongly typed jobs object, as opposed to a generic configuration definition.

Parameters:
descriptor -
Returns:
the scheduled jobs configuration definition, or null if the descriptor did not define plugin config.
Throws:
java.lang.Exception - if the plugin descriptor was invalid

getScheduledJobs

public static java.util.List<ScheduledJobDefinition> getScheduledJobs(ServerPluginDescriptorType descriptor)
                                                               throws java.lang.Exception
Given a descriptor, this will parse it and return any scheduled jobs that it finds. This essentially gives you a list of the pre-defined jobs, prior to a user customizing them with their own settings.

Parameters:
descriptor -
Returns:
list of jobs that are defined, will be empty if no jobs are defined.
Throws:
java.lang.Exception - if the plugin descriptor was invalid

getScheduledJobs

public static java.util.List<ScheduledJobDefinition> getScheduledJobs(Configuration scheduledJobsConfig)
                                                               throws java.lang.Exception
Given a configuration, this will return any scheduled jobs that are defined in it. This essentially gives you a list of the jobs that may be different from the descriptor's pre-defined jobs due to a user customizing them with their own settings.

Parameters:
jobsConfig - the configuration with the scheduled job information
Returns:
list of jobs that are defined, will be empty if no jobs are defined.
Throws:
java.lang.Exception - if the configuration was invalid


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