public abstract class AgentPluginDescriptorUtil extends Object
| Constructor and Description |
|---|
AgentPluginDescriptorUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addPluginToDependencyGraph(PluginDependencyGraph dependencyGraph,
PluginDescriptor descriptor)
Given an existing dependency graph and a plugin descriptor, this will add that plugin and its dependencies
to the dependency graph.
|
static org.rhq.core.domain.plugin.Plugin |
determineObsoletePlugin(org.rhq.core.domain.plugin.Plugin plugin1,
org.rhq.core.domain.plugin.Plugin plugin2)
Determines which of the two plugins is obsolete - in other words, this determines which
plugin is older.
|
static ComparableVersion |
getPluginVersion(File pluginFile,
PluginDescriptor descriptor)
Returns the version for the plugin represented by the given descriptor/file.
|
static PluginDescriptor |
loadPluginDescriptorFromUrl(URL pluginJarFileUrl)
Loads a plugin descriptor from the given plugin jar and returns it.
|
static PluginDescriptor |
parsePluginDescriptor(InputStream is)
Parses a descriptor from InputStream without a validator.
|
static PluginDescriptor |
parsePluginDescriptor(InputStream is,
ValidationEventCollector validationEventCollector)
Parses a descriptor from InputStream without a validator.
|
public static org.rhq.core.domain.plugin.Plugin determineObsoletePlugin(org.rhq.core.domain.plugin.Plugin plugin1,
org.rhq.core.domain.plugin.Plugin plugin2)
null will be returned.
Otherwise, the versions are compared and the one with the oldest version is obsolete.
If they have the same versions, the one with the oldest timestamp is obsolete.
If they have the same timestamp too, we have no other way to determine obsolescence so plugin1
will be picked arbitrarily and a message will be logged when this occurs.plugin1 - plugin2 - null is returned if they are the same (i.e. they have the same MD5)IllegalArgumentException - if the two plugins have different logical namespublic static ComparableVersion getPluginVersion(File pluginFile, PluginDescriptor descriptor) throws Exception
pluginFile - the plugin jardescriptor - the plugin descriptor as found in the plugin jar (if null,
the plugin file will be read and the descriptor parsed from it)Exception - if the plugin is invalid, there is no version for the plugin or the version string is invalidpublic static void addPluginToDependencyGraph(PluginDependencyGraph dependencyGraph, PluginDescriptor descriptor)
dependencyGraph - descriptor - public static PluginDescriptor loadPluginDescriptorFromUrl(URL pluginJarFileUrl) throws PluginContainerException
pluginJarFileUrl - URL to a plugin jar filePluginContainerException - if failed to find or parse a descriptor file in the plugin jarpublic static PluginDescriptor parsePluginDescriptor(InputStream is) throws PluginContainerException
is - input to checkPluginContainerException - if validation failspublic static PluginDescriptor parsePluginDescriptor(InputStream is, ValidationEventCollector validationEventCollector) throws PluginContainerException
is - input to checkPluginContainerException - if validation failsCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.