modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java
| 6
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/PluginMetadataParser.java
| 2
modules/core/client-api/src/main/resources/rhq-plugin.xsd
| 109 +++++
modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java
| 161 +++----
modules/core/dbutils/pom.xml
| 2
modules/core/dbutils/src/main/scripts/dbsetup/config-data.xml
| 166 -------
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
| 154 -------
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
| 10
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
| 38 -
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftDetectorTest.java
| 5
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftConfigurationDefinitionTest.java
| 208 ----------
modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
| 12
12 files changed, 228 insertions(+), 645 deletions(-)
New commits:
commit 6c00837adededa9b74db227c378fefdc587bcfa7
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 30 15:00:05 2011 -0400
webservice/jaxb requires this to be static and have no-arg constr
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
index 00f9ab9..2c9fe0a 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java
@@ -54,10 +54,14 @@ public class DriftConfiguration implements Serializable {
private static final long serialVersionUID = 1L;
- public class BaseDirectory implements Serializable {
+ public static class BaseDirectory implements Serializable {
private static final long serialVersionUID = 1L;
- private final BaseDirValueContext context;
- private final String name;
+ private BaseDirValueContext context;
+ private String name;
+
+ // required for jaxb/web services remoting
+ protected BaseDirectory() {
+ }
public BaseDirectory(BaseDirValueContext context, String name) {
this.context = context;
diff --git
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftDetectorTest.java
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftDetectorTest.java
index b5f9bd2..efa504b 100644
---
a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftDetectorTest.java
+++
b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftDetectorTest.java
@@ -23,9 +23,8 @@ import org.rhq.common.drift.ChangeSetReader;
import org.rhq.common.drift.ChangeSetReaderImpl;
import org.rhq.common.drift.DirectoryEntry;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.drift.DriftConfiguration;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition;
+import org.rhq.core.domain.drift.DriftConfiguration.BaseDirectory;
import org.rhq.test.JMockTest;
public class DriftDetectorTest extends JMockTest {
@@ -97,7 +96,7 @@ public class DriftDetectorTest extends JMockTest {
DriftConfiguration driftConfiguration(String name, String basedir) {
DriftConfiguration config = new DriftConfiguration(new Configuration());
config.setName(name);
- config.setBasedir(config.new BaseDirectory(fileSystem, basedir));
+ config.setBasedir(new BaseDirectory(fileSystem, basedir));
return config;
}
commit e2645d293a973bec0c6aeb201112eec324a6dccd
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 30 14:59:27 2011 -0400
revert these back, accidentally deleted tis thinking these server plugin references
were agent related.
diff --git
a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
index 326c993..e76feab 100644
---
a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
+++
b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
@@ -83,6 +83,7 @@ public abstract class ServerPluginDescriptorUtil {
PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN_ENTITLEMENT,
XmlSchemas.PKG_SERVERPLUGIN_ENTITLEMENT);
PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN_BUNDLE,
XmlSchemas.PKG_SERVERPLUGIN_BUNDLE);
PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN_PACKAGETYPE,
XmlSchemas.PKG_SERVERPLUGIN_PACKAGETYPE);
+ PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN_DRIFT,
XmlSchemas.PKG_SERVERPLUGIN_DRIFT);
// so we only have to do this once, build a ':' separated context path
containing all schema package names
StringBuilder packages = new StringBuilder();
@@ -238,8 +239,8 @@ public abstract class ServerPluginDescriptorUtil {
pluginDescriptor = ((JAXBElement<? extends
ServerPluginDescriptorType>) jaxbElement).getValue();
} finally {
if (unmarshaller != null) {
- ValidationEventCollector validationEventCollector =
(ValidationEventCollector) unmarshaller
- .getEventHandler();
+ ValidationEventCollector validationEventCollector =
+
(ValidationEventCollector)unmarshaller.getEventHandler();
logValidationEvents(pluginJarFileUrl, validationEventCollector);
}
}
@@ -329,35 +330,34 @@ public abstract class ServerPluginDescriptorUtil {
//
StringBuilder message = new StringBuilder();
String severity = null;
- switch (event.getSeverity()) {
- case ValidationEvent.WARNING:
- severity = "warning";
- break;
- case ValidationEvent.ERROR:
- severity = "error";
- break;
- case ValidationEvent.FATAL_ERROR:
- severity = "fatal error";
- break;
+ switch(event.getSeverity()) {
+ case ValidationEvent.WARNING:
+ severity = "warning";
+ break;
+ case ValidationEvent.ERROR:
+ severity = "error";
+ break;
+ case ValidationEvent.FATAL_ERROR:
+ severity = "fatal error";
+ break;
}
message.append("Validation ").append(severity);
File pluginJarFile = new File(pluginJarFileUrl.getPath());
- message.append(" while parsing
[").append(pluginJarFile.getName()).append(":").append(
- PLUGIN_DESCRIPTOR_PATH).append("]");
+ message.append(" while parsing
[").append(pluginJarFile.getName()).append(":").append(PLUGIN_DESCRIPTOR_PATH).append("]");
ValidationEventLocator locator = event.getLocator();
message.append(" at line ").append(locator.getLineNumber());
message.append(", column ").append(locator.getColumnNumber());
message.append(": ").append(event.getMessage());
// Now write the message to the log at an appropriate level.
- switch (event.getSeverity()) {
- case ValidationEvent.WARNING:
- case ValidationEvent.ERROR:
- LOG.warn(message);
- break;
- case ValidationEvent.FATAL_ERROR:
- LOG.error(message);
- break;
+ switch(event.getSeverity()) {
+ case ValidationEvent.WARNING:
+ case ValidationEvent.ERROR:
+ LOG.warn(message);
+ break;
+ case ValidationEvent.FATAL_ERROR:
+ LOG.error(message);
+ break;
}
}
}
diff --git
a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
index 4aab442..ea48d0e 100644
---
a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
+++
b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
@@ -75,4 +75,8 @@ public interface XmlSchemas {
// the schema used to define content source metadata which is used by content plugins
like the URL or Disk plugins
public static final String XSD_CONTENTSOURCE_PACKAGEDETAILS =
"rhq-contentsource-packagedetails.xsd";
public static final String PKG_CONTENTSOURCE_PACKAGEDETAILS =
"org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails";
+
+ // the schema used to define content source metadata which is used by content plugins
like the URL or Disk plugins
+ public static final String XSD_SERVERPLUGIN_DRIFT =
"rhq-serverplugin-drift.xsd";
+ public static final String PKG_SERVERPLUGIN_DRIFT =
"org.rhq.enterprise.server.xmlschema.generated.serverplugin.drift";
}
\ No newline at end of file
commit 5eb7bece78ee487d73a49f5a0600954245d4ba83
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 30 14:58:59 2011 -0400
rip out the pre-canned drift configuration definition - turns out, we don't really
need this persisted.
the resource types will have relationships directly to templates, so we won't have
floating or orphaned templates
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index e2a599d..39f0798 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -22,7 +22,7 @@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
- <db.schema.version>2.112</db.schema.version>
+ <db.schema.version>2.111</db.schema.version>
</properties>
<dependencies>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/config-data.xml
b/modules/core/dbutils/src/main/scripts/dbsetup/config-data.xml
deleted file mode 100644
index 904e10b..0000000
--- a/modules/core/dbutils/src/main/scripts/dbsetup/config-data.xml
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dbsetup name="config-data.xml">
- <table name="RHQ_CONFIG_DEF">
- <data id="1" name="GLOBAL_DRIFT_CONFIG_DEF"
description="The drift configuration definition"
- config_format="STRUCTURED" />
- </table>
-
- <table name="RHQ_CONFIG_PROP_DEF">
- <data id="1" name="name" display_name="Drift
Configuration Name" config_def_id="1"
- description="The drift configuration name"
- required="true"
- readonly="false"
- summary="true"
- order_index="0"
- dtype="property"
- simple_type="STRING"
- allow_custom_enum_value="false" />
-
- <data id="2" name="enabled"
display_name="Enabled" config_def_id="1"
- description="Enables or disables the drift configuration"
- required="true"
- readonly="false"
- summary="true"
- order_index="1"
- dtype="property"
- simple_type="BOOLEAN"
- allow_custom_enum_value="false"
- default_value="false" />
-
- <data id="3" name="basedir" display_name="Base
Directory" config_def_id="1"
- description="The root directory from which snapshots will be generated
during drift monitoring."
- required="true"
- readonly="false"
- summary="true"
- order_index="2"
- dtype="map" />
-
- <data id="4" name="valueContext" display_name="Value
Context" parent_map_definition_id="3"
- description="Identifies where the named value can be found."
- required="true"
- readonly="false"
- summary="true"
- order_index="0"
- dtype="property"
- simple_type="STRING"
- allow_custom_enum_value="false" />
-
- <data id="5" name="valueName" display_name="Value
Name" parent_map_definition_id="3"
- description="The name of the value as found in the context"
- required="true"
- readonly="false"
- summary="true"
- order_index="1"
- dtype="property"
- simple_type="STRING"
- allow_custom_enum_value="false" />
-
- <data id="6" name="interval"
display_name="Interval" config_def_id="1"
- description="The frequency in seconds in which drift monitoring should
run. Defaults to 1800 seconds (i.e. 30 minutes)"
- required="false"
- readonly="false"
- summary="true"
- order_index="3"
- dtype="property"
- simple_type="LONG"
- allow_custom_enum_value="false"
- default_value="1800" />
-
- <!-- the JPA mapping is weird here - we insert the child row first, then the
parent.
- This is because the child row does not specify any config_def_id OR
parent_list_definition_id.
- All relationship references are null.
- The parent list will point its parent_list_definition_id to this map
row's ID and is why
- we need to put the child row in first, so it exists for the parent to refer
to.
- You do this to indicate it is the parent to this child row and this child
row denotes
- the parent list's member definition
- -->
- <data id="8" name="include"
display_name="Include"
- description="A pattern that specifies a file or directory to
include."
- required="true"
- readonly="false"
- summary="true"
- order_index="0"
- dtype="map" />
-
- <data id="7" name="includes"
display_name="Includes" config_def_id="1"
parent_list_definition_id="8"
- description="A set of patterns that specify files and/or directories
to include."
- required="false"
- readonly="false"
- summary="true"
- order_index="4"
- dtype="list" />
-
- <data id="9" name="path" display_name="Path"
parent_map_definition_id="8"
- description="A file system path that can be a directory or a file. The
path is assumed to be relative to the base directory of the drift configuration."
- required="true"
- readonly="false"
- summary="true"
- order_index="0"
- dtype="property"
- simple_type="STRING"
- allow_custom_enum_value="false" />
-
- <data id="10" name="pattern"
display_name="Pattern" parent_map_definition_id="8"
- description="Pathname pattern that must match for the items in the
directory path to be included."
- required="false"
- readonly="false"
- summary="true"
- order_index="1"
- dtype="property"
- simple_type="STRING"
- allow_custom_enum_value="false" />
-
- <!-- the JPA mapping is weird here - we insert the child row first, then the
parent.
- This is because the child row does not specify any config_def_id OR
parent_list_definition_id.
- All relationship references are null.
- The parent list will point its parent_list_definition_id to this map
row's ID and is why
- we need to put the child row in first, so it exists for the parent to refer
to.
- You do this to indicate it is the parent to this child row and this child
row denotes
- the parent list's member definition
- -->
- <data id="12" name="exclude"
display_name="Exclude"
- description="A pattern that specifies a file or directory to
exclude."
- required="true"
- readonly="false"
- summary="true"
- order_index="0"
- dtype="map" />
-
- <data id="11" name="excludes"
display_name="Excludes" config_def_id="1"
parent_list_definition_id="12"
- description="A set of patterns that specify files and/or directories
to exclude."
- required="false"
- readonly="false"
- summary="true"
- order_index="5"
- dtype="list" />
-
- <data id="13" name="path" display_name="Path"
parent_map_definition_id="12"
- description="A file system path that can be a directory or a file. The
path is assumed to be relative to the base directory of the drift configuration."
- required="true"
- readonly="false"
- summary="true"
- order_index="0"
- dtype="property"
- simple_type="STRING"
- allow_custom_enum_value="false" />
-
- <data id="14" name="pattern"
display_name="Pattern" parent_map_definition_id="12"
- description="Pathname pattern that must match for the items in the
directory path to be excluded."
- required="false"
- readonly="false"
- summary="true"
- order_index="1"
- dtype="property"
- simple_type="STRING"
- allow_custom_enum_value="false" />
- </table>
-
- <table name="RHQ_CONF_PROP_DEF_ENUM">
- <data id="1" name="pluginConfiguration"
string_value="pluginConfiguration" order_index="0"
property_def_id="4" />
- <data id="2" name="resourceConfiguration"
string_value="resourceConfiguration" order_index="1"
property_def_id="4" />
- <data id="3" name="measurementTrait"
string_value="measurementTrait" order_index="2"
property_def_id="4" />
- <data id="4" name="fileSystem"
string_value="fileSystem" order_index="3"
property_def_id="4" />
- </table>
-
-</dbsetup>
\ No newline at end of file
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 57c100c..bc4bc43 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3445,160 +3445,6 @@
</schemaSpec>
<schemaSpec version="2.111">
- <!-- BUILD THE STATIC CONFIG DEFINITION FOR DRIFT CONFIGURATION
-->
-
- <!-- db agnostic insert the config def row -->
- <schema-directSQL>
- <statement desc="Creating global drift configuration
definition">
- INSERT INTO rhq_config_def (id, name, description,
config_format)
- VALUES (1, 'GLOBAL_DRIFT_CONFIG_DEF', 'The drift
configuration definition', 'STRUCTURED')
- </statement>
- </schema-directSQL>
-
- <!-- db specific inserts to add the property defs -->
- <!-- POSTGRES -->
- <schema-directSQL>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, description, required, readonly, summary, order_index, dtype, simple_type,
allow_custom_enum_value)
- VALUES (1, 'name', 'Drift Configuration Name', 1,
'The drift configuration name', 'true', 'false', 'true',
0, 'property', 'STRING', 'false')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, description, required, readonly, summary, order_index, dtype, simple_type,
allow_custom_enum_value, default_value)
- VALUES (2, 'enabled', 'Enabled', 1, 'Enables
or disables the drift configuration' , 'true', 'false',
'true', 1, 'property', 'BOOLEAN', 'false',
'false')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, description, required, readonly, summary, order_index, dtype)
- VALUES (3, 'basedir', 'Base Directory', 1,
'The root directory from which snapshots will be generated during drift
monitoring.', 'true', 'false', 'true', 2, 'map')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (4, 'valueContext', 'Value Context', 3,
'Identifies where the named value can be found.', 'true', 'false',
'true', 0, 'property', 'STRING', 'false')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (5, 'valueName', 'Value Name', 3, 'The
name of the value as found in the context', 'true', 'false',
'true', 1, 'property', 'STRING', 'false')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, description, required, readonly, summary, order_index, dtype, simple_type,
allow_custom_enum_value, default_value)
- VALUES (6, 'interval', 'Interval', 1, 'The
frequency in seconds in which drift monitoring should run. Defaults to 1800 seconds (i.e.
30 minutes)', 'false', 'false', 'true', 3, 'property',
'LONG', 'false', '1800')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
description, required, readonly, summary, order_index, dtype)
- VALUES (8, 'include', 'Include', 'A pattern
that specifies a file or directory to include.', 'true', 'false',
'true', 0, 'map')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, parent_list_definition_id, description, required, readonly, summary,
order_index, dtype)
- VALUES (7, 'includes', 'Includes', 1, 8, 'A
set of patterns that specify files and/or directories to include.', 'false',
'false', 'true', 4, 'list')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (9, 'path', 'Path', 8, 'A file system
path that can be a directory or a file. The path is assumed to be relative to the base
directory of the drift configuration.', 'true', 'false',
'true', 0, 'property', 'STRING', 'false')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (10, 'pattern', 'Pattern', 8,
'Pathname pattern that must match for the items in the directory path to be
included.', 'false', 'false', 'true', 1, 'property',
'STRING', 'false')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
description, required, readonly, summary, order_index, dtype)
- VALUES (12, 'exclude', 'Exclude', 'A pattern
that specifies a file or directory to exclude.', 'true', 'false',
'true', 0, 'map')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, parent_list_definition_id, description, required, readonly, summary,
order_index, dtype)
- VALUES (11, 'excludes', 'Excludes', 1, 12, 'A
set of patterns that specify files and/or directories to exclude.', 'false',
'false', 'true', 5, 'list')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (13, 'path', 'Path', 12, 'A file
system path that can be a directory or a file. The path is assumed to be relative to the
base directory of the drift configuration.', 'true', 'false',
'true', 0, 'property', 'STRING', 'false')
- </statement>
- <statement targetDBVendor="postgresql">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (14, 'pattern', 'Pattern', 12,
'Pathname pattern that must match for the items in the directory path to be
excluded.', 'false', 'false', 'true', 1, 'property',
'STRING', 'false')
- </statement>
- </schema-directSQL>
-
- <!-- ORACLE -->
- <schema-directSQL>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, description, required, readonly, summary, order_index, dtype, simple_type,
allow_custom_enum_value)
- VALUES (1, 'name', 'Drift Configuration Name', 1,
'The drift configuration name', 1, 0, 1, 0, 'property', 'STRING',
0)
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, description, required, readonly, summary, order_index, dtype, simple_type,
allow_custom_enum_value, default_value)
- VALUES (2, 'enabled', 'Enabled', 1, 'Enables
or disables the drift configuration' , 1, 0, 1, 1, 'property',
'BOOLEAN', 0, 'false')
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, description, required, readonly, summary, order_index, dtype)
- VALUES (3, 'basedir', 'Base Directory', 1,
'The root directory from which snapshots will be generated during drift
monitoring.', 1, 0, 1, 2, 'map')
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (4, 'valueContext', 'Value Context', 3,
'Identifies where the named value can be found.', 1, 0, 1, 0, 'property',
'STRING', 0)
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (5, 'valueName', 'Value Name', 3, 'The
name of the value as found in the context', 1, 0, 1, 1, 'property',
'STRING', 0)
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, description, required, readonly, summary, order_index, dtype, simple_type,
allow_custom_enum_value, default_value)
- VALUES (6, 'interval', 'Interval', 1, 'The
frequency in seconds in which drift monitoring should run. Defaults to 1800 seconds (i.e.
30 minutes)', 0, 0, 1, 3, 'property', 'LONG', 0, '1800')
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
description, required, readonly, summary, order_index, dtype)
- VALUES (8, 'include', 'Include', 'A pattern
that specifies a file or directory to include.', 1, 0, 1, 0, 'map')
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, parent_list_definition_id, description, required, readonly, summary,
order_index, dtype)
- VALUES (7, 'includes', 'Includes', 1, 8, 'A
set of patterns that specify files and/or directories to include.', 0, 0, 1, 4,
'list')
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (9, 'path', 'Path', 8, 'A file system
path that can be a directory or a file. The path is assumed to be relative to the base
directory of the drift configuration.', 1, 0, 1, 0, 'property',
'STRING', 0)
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (10, 'pattern', 'Pattern', 8,
'Pathname pattern that must match for the items in the directory path to be
included.', 0, 0, 1, 1, 'property', 'STRING', 0)
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
description, required, readonly, summary, order_index, dtype)
- VALUES (12, 'exclude', 'Exclude', 'A pattern
that specifies a file or directory to exclude.', 1, 0, 1, 0, 'map')
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
config_def_id, parent_list_definition_id, description, required, readonly, summary,
order_index, dtype)
- VALUES (11, 'excludes', 'Excludes', 1, 12, 'A
set of patterns that specify files and/or directories to exclude.', 0, 0, 1, 5,
'list')
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (13, 'path', 'Path', 12, 'A file
system path that can be a directory or a file. The path is assumed to be relative to the
base directory of the drift configuration.', 1, 0, 1, 0, 'property',
'STRING', 0)
- </statement>
- <statement targetDBVendor="oracle">
- INSERT INTO rhq_config_prop_def (id, name, display_name,
parent_map_definition_id, description, required, readonly, summary, order_index, dtype,
simple_type, allow_custom_enum_value)
- VALUES (14, 'pattern', 'Pattern', 12,
'Pathname pattern that must match for the items in the directory path to be
excluded.', 0, 0, 1, 1, 'property', 'STRING', 0)
- </statement>
- </schema-directSQL>
-
- <!-- db agnostic inserts to add the enum values -->
- <schema-directSQL>
- <statement>
- INSERT INTO rhq_conf_prop_def_enum (id, name, string_value,
order_index, property_def_id)
- VALUES (1, 'pluginConfiguration',
'pluginConfiguration', 0, 4)
- </statement>
- <statement>
- INSERT INTO rhq_conf_prop_def_enum (id, name, string_value,
order_index, property_def_id)
- VALUES (2, 'resourceConfiguration',
'resourceConfiguration', 1, 4)
- </statement>
- <statement>
- INSERT INTO rhq_conf_prop_def_enum (id, name, string_value,
order_index, property_def_id)
- VALUES (3, 'measurementTrait',
'measurementTrait', 2, 4)
- </statement>
- <statement>
- INSERT INTO rhq_conf_prop_def_enum (id, name, string_value,
order_index, property_def_id)
- VALUES (4, 'fileSystem', 'fileSystem',
3, 4)
- </statement>
- </schema-directSQL>
-
- </schemaSpec>
-
- <schemaSpec version="2.112">
<schema-directSQL>
<statement desc="Creating table RHQ_DRIFT_TEMPLATE">
CREATE TABLE RHQ_DRIFT_TEMPLATE (
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
index bdf677d..3b4576d 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
@@ -79,7 +79,7 @@ public class DriftConfigurationDefinition implements Serializable {
}
static {
- INSTANCE.setId(1);
+ //INSTANCE.setId(1);
INSTANCE.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
INSTANCE.put(createName());
@@ -98,7 +98,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertySimpleType type = PropertySimpleType.STRING;
PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description,
required, type);
- pd.setId(1);
+ //pd.setId(1);
pd.setDisplayName("Drift Configuration Name");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -115,7 +115,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertySimpleType type = PropertySimpleType.BOOLEAN;
PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description,
required, type);
- pd.setId(2);
+ //pd.setId(2);
pd.setDisplayName("Enabled");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -135,7 +135,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertyDefinitionSimple valueName = createBasedirValueName();
PropertyDefinitionMap pd = new PropertyDefinitionMap(name, description, required,
valueContext, valueName);
- pd.setId(3);
+ //pd.setId(3);
pd.setDisplayName("Base Directory");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -152,7 +152,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertySimpleType type = PropertySimpleType.STRING;
PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description,
required, type);
- pd.setId(4);
+ //pd.setId(4);
pd.setDisplayName("Value Context");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -160,22 +160,22 @@ public class DriftConfigurationDefinition implements Serializable {
PropertyDefinitionEnumeration pcEnum = new PropertyDefinitionEnumeration(
BaseDirValueContext.pluginConfiguration.name(),
BaseDirValueContext.pluginConfiguration.name());
- pcEnum.setId(1);
+ //pcEnum.setId(1);
pcEnum.setOrderIndex(0);
PropertyDefinitionEnumeration rcEnum = new PropertyDefinitionEnumeration(
BaseDirValueContext.resourceConfiguration.name(),
BaseDirValueContext.resourceConfiguration.name());
- rcEnum.setId(2);
+ //rcEnum.setId(2);
rcEnum.setOrderIndex(1);
PropertyDefinitionEnumeration mtEnum = new
PropertyDefinitionEnumeration(BaseDirValueContext.measurementTrait
.name(), BaseDirValueContext.measurementTrait.name());
- mtEnum.setId(3);
+ //mtEnum.setId(3);
mtEnum.setOrderIndex(2);
PropertyDefinitionEnumeration fsEnum = new
PropertyDefinitionEnumeration(BaseDirValueContext.fileSystem.name(),
BaseDirValueContext.fileSystem.name());
- fsEnum.setId(4);
+ //fsEnum.setId(4);
fsEnum.setOrderIndex(3);
ArrayList<PropertyDefinitionEnumeration> pdEnums = new
ArrayList<PropertyDefinitionEnumeration>(4);
@@ -195,7 +195,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertySimpleType type = PropertySimpleType.STRING;
PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description,
required, type);
- pd.setId(5);
+ //pd.setId(5);
pd.setDisplayName("Value Name");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -211,7 +211,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertySimpleType type = PropertySimpleType.LONG;
PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description,
required, type);
- pd.setId(6);
+ //pd.setId(6);
pd.setDisplayName("Interval");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -230,7 +230,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertyDefinitionMap map = createInclude();
PropertyDefinitionList pd = new PropertyDefinitionList(name, description,
required, map);
- pd.setId(7);
+ //pd.setId(7);
pd.setDisplayName("Includes");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -248,7 +248,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertyDefinitionSimple pattern = createIncludePattern();
PropertyDefinitionMap pd = new PropertyDefinitionMap(name, description, required,
path, pattern);
- pd.setId(8);
+ //pd.setId(8);
pd.setDisplayName("Include");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -263,7 +263,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertySimpleType type = PropertySimpleType.STRING;
PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description,
required, type);
- pd.setId(9);
+ //pd.setId(9);
pd.setDisplayName("Path");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -279,7 +279,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertySimpleType type = PropertySimpleType.STRING;
PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description,
required, type);
- pd.setId(10);
+ //pd.setId(10);
pd.setDisplayName("Pattern");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -296,7 +296,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertyDefinitionMap map = createExclude();
PropertyDefinitionList pd = new PropertyDefinitionList(name, description,
required, map);
- pd.setId(11);
+ //pd.setId(11);
pd.setDisplayName("Excludes");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -314,7 +314,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertyDefinitionSimple pattern = createExcludePattern();
PropertyDefinitionMap pd = new PropertyDefinitionMap(name, description, required,
path, pattern);
- pd.setId(12);
+ //pd.setId(12);
pd.setDisplayName("Exclude");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -329,7 +329,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertySimpleType type = PropertySimpleType.STRING;
PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description,
required, type);
- pd.setId(13);
+ //pd.setId(13);
pd.setDisplayName("Path");
pd.setReadOnly(false);
pd.setSummary(true);
@@ -345,7 +345,7 @@ public class DriftConfigurationDefinition implements Serializable {
PropertySimpleType type = PropertySimpleType.STRING;
PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description,
required, type);
- pd.setId(14);
+ //pd.setId(14);
pd.setDisplayName("Pattern");
pd.setReadOnly(false);
pd.setSummary(true);
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftConfigurationDefinitionTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftConfigurationDefinitionTest.java
deleted file mode 100644
index 6388292..0000000
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftConfigurationDefinitionTest.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.server.drift;
-
-import java.util.List;
-
-import org.testng.annotations.Test;
-
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
-import org.rhq.core.domain.configuration.definition.PropertyDefinitionEnumeration;
-import org.rhq.core.domain.configuration.definition.PropertyDefinitionList;
-import org.rhq.core.domain.configuration.definition.PropertyDefinitionMap;
-import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition;
-import org.rhq.enterprise.server.test.AbstractEJB3Test;
-
-/**
- * Tests that our hard-coded singleton DriftConfigurationDefinition is persisted properly
in the DB.
- */
-@Test
-public class DriftConfigurationDefinitionTest extends AbstractEJB3Test {
-
- public void testDriftConfigurationDefinition() throws Throwable {
- ConfigurationDefinition def;
- ConfigurationDefinition defDATABASE;
-
- getTransactionManager().begin();
- try {
- def = DriftConfigurationDefinition.getInstance();
- defDATABASE = getEntityManager().find(ConfigurationDefinition.class,
def.getId());
- } finally {
- getTransactionManager().rollback();
- }
-
- assert defDATABASE.getId() == def.getId();
- assert defDATABASE.getPropertyDefinitions().size() ==
def.getPropertyDefinitions().size();
-
- PropertyDefinitionSimple simpleDATABASE;
- PropertyDefinitionSimple simple;
- PropertyDefinitionMap mapDATABASE;
- PropertyDefinitionMap map;
- PropertyDefinitionList listDATABASE;
- PropertyDefinitionList list;
-
- // NAME
- simpleDATABASE =
defDATABASE.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_NAME);
- simple =
def.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_NAME);
- assertSimpleProperty(simpleDATABASE, simple);
-
- // ENABLED
- simpleDATABASE =
defDATABASE.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_ENABLED);
- simple =
def.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_ENABLED);
- assertSimpleProperty(simpleDATABASE, simple);
-
- // INTERVAL
- simpleDATABASE =
defDATABASE.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_INTERVAL);
- simple =
def.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_INTERVAL);
- assertSimpleProperty(simpleDATABASE, simple);
-
- // BASEDIR
- mapDATABASE =
defDATABASE.getPropertyDefinitionMap(DriftConfigurationDefinition.PROP_BASEDIR);
- map = def.getPropertyDefinitionMap(DriftConfigurationDefinition.PROP_BASEDIR);
- assertMapProperty(mapDATABASE, map);
-
- // BASEDIR VALUECONTEXT (implicitly also tests the enums)
- simpleDATABASE = mapDATABASE
-
.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT);
- simple =
map.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT);
- assertSimpleProperty(simpleDATABASE, simple);
-
- // BASEDIR VALUENAME
- simpleDATABASE =
mapDATABASE.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_BASEDIR_VALUENAME);
- simple =
map.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_BASEDIR_VALUENAME);
- assertSimpleProperty(simpleDATABASE, simple);
-
- // INCLUDES
- listDATABASE =
defDATABASE.getPropertyDefinitionList(DriftConfigurationDefinition.PROP_INCLUDES);
- list =
def.getPropertyDefinitionList(DriftConfigurationDefinition.PROP_INCLUDES);
- assertListProperty(listDATABASE, list);
-
- // INCLUDES INCLUDE
- mapDATABASE = (PropertyDefinitionMap) listDATABASE.getMemberDefinition();
- map = (PropertyDefinitionMap) list.getMemberDefinition();
- assertMapProperty(mapDATABASE, map);
-
- // INCLUDES INCLUDE PATH
- simpleDATABASE =
mapDATABASE.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_PATH);
- simple =
map.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_PATH);
- assertSimpleProperty(simpleDATABASE, simple);
-
- // INCLUDES INCLUDE PATTERN
- simpleDATABASE =
mapDATABASE.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_PATTERN);
- simple =
map.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_PATTERN);
- assertSimpleProperty(simpleDATABASE, simple);
-
- // EXCLUDES
- listDATABASE =
defDATABASE.getPropertyDefinitionList(DriftConfigurationDefinition.PROP_EXCLUDES);
- list =
def.getPropertyDefinitionList(DriftConfigurationDefinition.PROP_EXCLUDES);
- assertListProperty(listDATABASE, list);
-
- // EXCLUDES EXCLUDE
- mapDATABASE = (PropertyDefinitionMap) listDATABASE.getMemberDefinition();
- map = (PropertyDefinitionMap) list.getMemberDefinition();
- assertMapProperty(mapDATABASE, map);
-
- // EXCLUDES EXCLUDE PATH
- simpleDATABASE =
mapDATABASE.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_PATH);
- simple =
map.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_PATH);
- assertSimpleProperty(simpleDATABASE, simple);
-
- // EXCLUDES EXCLUDE PATTERN
- simpleDATABASE =
mapDATABASE.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_PATTERN);
- simple =
map.getPropertyDefinitionSimple(DriftConfigurationDefinition.PROP_PATTERN);
- assertSimpleProperty(simpleDATABASE, simple);
- }
-
- private void assertListProperty(PropertyDefinitionList listDb, PropertyDefinitionList
list) throws Throwable {
-
- try {
- assert listDb.getId() == list.getId();
- assert listDb.getActivationPolicy() == list.getActivationPolicy();
- assert listDb.getDescription().equals(list.getDescription());
- assert listDb.getDisplayName().equals(list.getDisplayName());
- assert listDb.getName().equals(list.getName());
- assert listDb.getOrder() == list.getOrder();
- } catch (Throwable t) {
- System.out.println("Lists failed test:\nlistDb=[" + listDb +
"]\nlist=[" + list + "]");
- throw t;
- }
- }
-
- private void assertMapProperty(PropertyDefinitionMap mapDb, PropertyDefinitionMap
map) throws Throwable {
-
- try {
- assert mapDb.getId() == map.getId();
- assert mapDb.getActivationPolicy() == map.getActivationPolicy();
- assert mapDb.getDescription().equals(map.getDescription());
- assert mapDb.getDisplayName().equals(map.getDisplayName());
- assert mapDb.getName().equals(map.getName());
- assert mapDb.getOrder() == map.getOrder();
- } catch (Throwable t) {
- System.out.println("Maps failed test:\nmapDb=[" + mapDb +
"]\nmap=[" + map + "]");
- throw t;
- }
- }
-
- private void assertSimpleProperty(PropertyDefinitionSimple simpleDb,
PropertyDefinitionSimple simple)
- throws Throwable {
-
- try {
- assert simpleDb.getId() == simple.getId();
- assert simpleDb.getAllowCustomEnumeratedValue() ==
simple.getAllowCustomEnumeratedValue();
- assert simpleDb.getActivationPolicy() == simple.getActivationPolicy();
- assert simpleDb.getDescription().equals(simple.getDescription());
- assert simpleDb.getDisplayName().equals(simple.getDisplayName());
- assert simpleDb.getName().equals(simple.getName());
- assert simpleDb.getOrder() == simple.getOrder();
- assert simpleDb.getType() == simple.getType();
- if (simpleDb.getDefaultValue() == null) {
- assert simpleDb.getDefaultValue() == null &&
simple.getDefaultValue() == null;
- } else {
- assert simpleDb.getDefaultValue().equals(simple.getDefaultValue());
- }
- assertEnumeratedValues(simpleDb.getEnumeratedValues(),
simple.getEnumeratedValues());
-
- } catch (Throwable t) {
- System.out.println("Simples failed test:\nsimpleDb=[" + simpleDb +
"]\nsimple=[" + simple + "]");
- throw t;
- }
- }
-
- private void assertEnumeratedValues(List<PropertyDefinitionEnumeration>
enumsDb,
- List<PropertyDefinitionEnumeration> enums) throws Throwable {
-
- assert enumsDb.size() == enums.size() : "enum sizes do not match: " +
enumsDb.size() + ":" + enums.size();
-
- for (int i = 0; i < enumsDb.size(); i++) {
- PropertyDefinitionEnumeration eenumDb = enumsDb.get(i);
- PropertyDefinitionEnumeration eenum = enums.get(i);
-
- try {
- assert eenumDb.getId() == eenum.getId();
- assert eenumDb.getName().equals(eenum.getName());
- assert eenumDb.getOrderIndex() == eenum.getOrderIndex();
- assert eenumDb.getValue().equals(eenum.getValue());
- } catch (Throwable t) {
- System.out.println("Enum failed test:\neenumDb=[" + eenumDb +
"]\neenums=[" + eenum + "]");
- throw t;
- }
- }
- }
-}
\ No newline at end of file
commit 00d8b7c8505c176709e37eecf77369784091a605
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 30 14:13:59 2011 -0400
an initial stab at a drift config for jboss-as.
diff --git a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
index a151196..2d11f7a 100644
--- a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
@@ -257,6 +257,18 @@
</configuration>
</content>
+ <drift-configuration name="Core Files">
+ <basedir>
+ <value-context>pluginConfiguration</value-context>
+ <value-name>jbossHomeDir</value-name>
+ </basedir>
+ <includes>
+ <include path="bin" />
+ <include path="lib" />
+ <include path="client" />
+ </includes>
+ </drift-configuration>
+
<bundle-target>
<destination-base-dir name="Install Directory"
description="The top directory where the JBossAS Server is installed. (i.e. the value
found in the 'JBoss Home Directory' connection property)">
<value-context>pluginConfiguration</value-context>
commit 5843aece1e20f19bce486ac31c393f259a20015c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 30 14:13:43 2011 -0400
combine the drift schema into the main plugin xsd. we no longer have a separate
drift.xsd
diff --git
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java
index 54892ab..c7c0a12 100644
---
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java
+++
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/DriftMetadataParser.java
@@ -23,9 +23,9 @@
package org.rhq.core.clientapi.agent.metadata;
-import org.rhq.core.clientapi.descriptor.drift.DriftDescriptor;
-import org.rhq.core.clientapi.descriptor.drift.DriftFilterDescriptor;
-import org.rhq.core.clientapi.descriptor.drift.DriftDescriptor.Basedir;
+import org.rhq.core.clientapi.descriptor.plugin.DriftDescriptor;
+import org.rhq.core.clientapi.descriptor.plugin.DriftFilterDescriptor;
+import org.rhq.core.clientapi.descriptor.plugin.DriftDescriptor.Basedir;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertyList;
import org.rhq.core.domain.configuration.PropertyMap;
diff --git
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/PluginMetadataParser.java
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/PluginMetadataParser.java
index 93c4417..f3aa13e 100644
---
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/PluginMetadataParser.java
+++
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/PluginMetadataParser.java
@@ -33,10 +33,10 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.rhq.core.clientapi.descriptor.drift.DriftDescriptor;
import org.rhq.core.clientapi.descriptor.plugin.Bundle;
import org.rhq.core.clientapi.descriptor.plugin.BundleTargetDescriptor;
import org.rhq.core.clientapi.descriptor.plugin.ContentDescriptor;
+import org.rhq.core.clientapi.descriptor.plugin.DriftDescriptor;
import org.rhq.core.clientapi.descriptor.plugin.EventDescriptor;
import org.rhq.core.clientapi.descriptor.plugin.MetricDescriptor;
import org.rhq.core.clientapi.descriptor.plugin.OperationDescriptor;
diff --git a/modules/core/client-api/src/main/resources/rhq-plugin.xsd
b/modules/core/client-api/src/main/resources/rhq-plugin.xsd
index 65d0fdb..e02013a 100644
--- a/modules/core/client-api/src/main/resources/rhq-plugin.xsd
+++ b/modules/core/client-api/src/main/resources/rhq-plugin.xsd
@@ -2,7 +2,6 @@
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:config="urn:xmlns:rhq-configuration"
- xmlns:drift="urn:xmlns:rhq-drift"
xmlns:rhq="urn:xmlns:rhq-plugin"
targetNamespace="urn:xmlns:rhq-plugin"
elementFormDefault="qualified"
@@ -10,7 +9,6 @@
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
blockDefault="">
<xs:import namespace="urn:xmlns:rhq-configuration"
schemaLocation="rhq-configuration.xsd"/>
- <xs:import namespace="urn:xmlns:rhq-drift"
schemaLocation="rhq-drift.xsd"/>
<xs:annotation>
<xs:documentation>Schema for the definition of an AMPS plugin. AMPS plugins
provide the metadata for new
@@ -550,6 +548,111 @@
</xs:complexType>
</xs:element>
+ <!-- == Drift ================================================== -->
+
+ <xs:complexType name="Drift">
+ <xs:annotation>
+ <xs:appinfo>
+ <jaxb:class name="DriftDescriptor" />
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="basedir" minOccurs="1"
maxOccurs="1">
+ <xs:complexType>
+ <xs:annotation>
+ <xs:documentation>
+ The root directory from which snapshots will be generated
during drift monitoring.
+ Each base directory's value is obtained from a particular
context (e.g. in the
+ resource's plugin configuration or its resource
configuration).
+ Within that context, the base directory value is obtained by
looking up the named value in the given context.
+ For example, if the value-name is "install.dir" and
the value-context is "pluginConfiguration",
+ then the destination base directory value is obtained by
getting the "install.dir" property value
+ found in the resource's plugin configuration.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="value-context">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration
value="pluginConfiguration"></xs:enumeration>
+ <xs:enumeration
value="resourceConfiguration"></xs:enumeration>
+ <xs:enumeration
value="measurementTrait"></xs:enumeration>
+ <xs:enumeration
value="fileSystem"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="value-name"
type="xs:string"></xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="interval" type="xs:long"
minOccurs="0" maxOccurs="1" default="1800">
+ <xs:annotation>
+ <xs:documentation>
+ The frequency in seconds in which drift monitoring should run.
Defaults to thirty minutes.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="includes" type="rhq:DriftIncludes"
minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>
+ A set of patterns that specify files and/or directories to
include.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="excludes" type="rhq:DriftExcludes"
minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>
+ A set of patterns that specify files and/or directories to
exclude.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ </xs:complexType>
+
+ <xs:complexType name="DriftIncludes">
+ <xs:annotation>
+ <xs:appinfo>
+ <jaxb:class name="DriftIncludesDescriptor" />
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="include" type="rhq:DriftFilter"
minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DriftExcludes">
+ <xs:annotation>
+ <xs:appinfo>
+ <jaxb:class name="DriftExcludesDescriptor" />
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="exclude" type="rhq:DriftFilter"
minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="DriftFilter">
+ <xs:annotation>
+ <xs:appinfo>
+ <jaxb:class name="DriftFilterDescriptor" />
+ </xs:appinfo>
+ </xs:annotation>
+ <xs:attribute name="path" type="xs:string"
use="required">
+ <xs:annotation>
+ <xs:documentation>
+ A file system path that can be a directory or a file. The path is
assumed to be
+ relative to the base directory of the drift configuration.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="pattern" type="xs:string"
use="optional">
+ <xs:annotation>
+ <xs:documentation>Provides a pattern that matches those files to be
monitored for drift.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+
<!-- BASE RESOURCE -->
<xs:element name="resource" type="rhq:resource">
@@ -622,7 +725,7 @@
<xs:element ref="rhq:event" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element ref="rhq:content" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element name="resource-configuration"
type="config:configuration" minOccurs="0"/>
- <xs:element name="drift-configuration" type="drift:Drift"
minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="drift-configuration" type="rhq:Drift"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="rhq:bundle-target" minOccurs="0"
maxOccurs="1"/>
<xs:element ref="rhq:help" minOccurs="0"
maxOccurs="1" />
</xs:sequence>
diff --git
a/modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java
b/modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java
index f44d2cb..527a5f9 100644
---
a/modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java
+++
b/modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java
@@ -364,14 +364,13 @@ public class PluginMetadataParserTest {
PluginDescriptor descriptor = toPluginDescriptor("" + //
"<plugin name='drift-test-plugin' displayName='Drift
Test' package='org.rhq.plugins.test'" + //
"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
+ //
- " xmlns='urn:xmlns:rhq-plugin'" + //
- " xmlns:d='urn:xmlns:rhq-drift'>" + //
+ " xmlns='urn:xmlns:rhq-plugin'>" + //
" <server name='TestServer'>" + //
" <drift-configuration name='test1'>" + //
- " <d:basedir>" + //
- "
<d:value-context>pluginConfiguration</d:value-context>" + //
- " <d:value-name>var.lib.test1</d:value-name>"
+ //
- " </d:basedir>" + //
+ " <basedir>" + //
+ "
<value-context>pluginConfiguration</value-context>" + //
+ " <value-name>var.lib.test1</value-name>" +
//
+ " </basedir>" + //
" </drift-configuration>" + //
" </server>" + //
"</plugin>");
@@ -393,14 +392,13 @@ public class PluginMetadataParserTest {
toPluginDescriptor("" + //
"<plugin name='drift-test-plugin' displayName='Drift
Test' package='org.rhq.plugins.test'" + //
"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" + //
- " xmlns='urn:xmlns:rhq-plugin'" + //
- " xmlns:d='urn:xmlns:rhq-drift'>" + //
+ " xmlns='urn:xmlns:rhq-plugin'>" + //
" <server name='TestServer'>" + //
" <drift-configuration name='test1'>" + //
- " <d:basedir>" + //
- "
<d:value-context>saywhat</d:value-context>" + // this is an invalid
context
- "
<d:value-name>var.lib.test1</d:value-name>" + //
- " </d:basedir>" + //
+ " <basedir>" + //
+ " <value-context>saywhat</value-context>"
+ // this is an invalid context
+ " <value-name>var.lib.test1</value-name>"
+ //
+ " </basedir>" + //
" </drift-configuration>" + //
" </server>" + //
"</plugin>");
@@ -415,14 +413,13 @@ public class PluginMetadataParserTest {
PluginDescriptor descriptor = toPluginDescriptor("" + //
"<plugin name='drift-test-plugin' displayName='Drift
Test' package='org.rhq.plugins.test'" + //
"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
+ //
- " xmlns='urn:xmlns:rhq-plugin'" + //
- " xmlns:d='urn:xmlns:rhq-drift'>" + //
+ " xmlns='urn:xmlns:rhq-plugin'>" + //
" <server name='TestServer'>" + //
" <drift-configuration name='test1'>" + //
- " <d:basedir>" + //
- "
<d:value-context>pluginConfiguration</d:value-context>" + //
- " <d:value-name>var.lib.test1</d:value-name>"
+ //
- " </d:basedir>" + //
+ " <basedir>" + //
+ "
<value-context>pluginConfiguration</value-context>" + //
+ " <value-name>var.lib.test1</value-name>" +
//
+ " </basedir>" + //
" </drift-configuration>" + //
" </server>" + //
"</plugin>");
@@ -443,15 +440,14 @@ public class PluginMetadataParserTest {
PluginDescriptor descriptor = toPluginDescriptor("" + //
"<plugin name='drift-test-plugin' displayName='Drift
Test' package='org.rhq.plugins.test'" + //
"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
+ //
- " xmlns='urn:xmlns:rhq-plugin'" + //
- " xmlns:d='urn:xmlns:rhq-drift'>" + //
+ " xmlns='urn:xmlns:rhq-plugin'>" + //
" <server name='TestServer'>" + //
" <drift-configuration name='test1'>" + //
- " <d:basedir>" + //
- "
<d:value-context>pluginConfiguration</d:value-context>" + //
- " <d:value-name>var.lib.test1</d:value-name>"
+ //
- " </d:basedir>" + //
- " <d:interval>3600</d:interval>" + //
+ " <basedir>" + //
+ "
<value-context>pluginConfiguration</value-context>" + //
+ " <value-name>var.lib.test1</value-name>" +
//
+ " </basedir>" + //
+ " <interval>3600</interval>" + //
" </drift-configuration>" + //
" </server>" + //
"</plugin>");
@@ -472,18 +468,17 @@ public class PluginMetadataParserTest {
PluginDescriptor descriptor = toPluginDescriptor("" + //
"<plugin name='drift-test-plugin' displayName='Drift
Test' package='org.rhq.plugins.test'" + //
"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
+ //
- " xmlns='urn:xmlns:rhq-plugin'" + //
- " xmlns:d='urn:xmlns:rhq-drift'>" + //
+ " xmlns='urn:xmlns:rhq-plugin'>" + //
" <server name='TestServer'>" + //
" <drift-configuration name='test1'>" + //
- " <d:basedir>" + //
- "
<d:value-context>pluginConfiguration</d:value-context>" + //
- " <d:value-name>var.lib.test1</d:value-name>"
+ //
- " </d:basedir>" + //
- " <d:includes>" + //
- " <d:include path='lib'
pattern='*.jar'/>" + //
- " <d:include path='conf'
pattern='*.xml'/>" + //
- " </d:includes>" + //
+ " <basedir>" + //
+ "
<value-context>pluginConfiguration</value-context>" + //
+ " <value-name>var.lib.test1</value-name>" +
//
+ " </basedir>" + //
+ " <includes>" + //
+ " <include path='lib'
pattern='*.jar'/>" + //
+ " <include path='conf'
pattern='*.xml'/>" + //
+ " </includes>" + //
" </drift-configuration>" + //
" </server>" + //
"</plugin>");
@@ -528,19 +523,18 @@ public class PluginMetadataParserTest {
PluginDescriptor descriptor = toPluginDescriptor("" + //
"<plugin name='drift-test-plugin' displayName='Drift
Test' package='org.rhq.plugins.test'" + //
"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
+ //
- " xmlns='urn:xmlns:rhq-plugin'" + //
- " xmlns:d='urn:xmlns:rhq-drift'>" + //
+ " xmlns='urn:xmlns:rhq-plugin'>" + //
" <server name='TestServer'>" + //
" <drift-configuration name='test1'>" + //
- " <d:basedir>" + //
- "
<d:value-context>pluginConfiguration</d:value-context>" + //
- " <d:value-name>var.lib.test1</d:value-name>"
+ //
- " </d:basedir>" + //
- " <d:interval>3600</d:interval>" + //
- " <d:excludes>" + //
- " <d:exclude path='lib'
pattern='*.jar'/>" + //
- " <d:exclude path='conf'
pattern='*.xml'/>" + //
- " </d:excludes>" + //
+ " <basedir>" + //
+ "
<value-context>pluginConfiguration</value-context>" + //
+ " <value-name>var.lib.test1</value-name>" +
//
+ " </basedir>" + //
+ " <interval>3600</interval>" + //
+ " <excludes>" + //
+ " <exclude path='lib'
pattern='*.jar'/>" + //
+ " <exclude path='conf'
pattern='*.xml'/>" + //
+ " </excludes>" + //
" </drift-configuration>" + //
" </server>" + //
"</plugin>");
@@ -590,52 +584,51 @@ public class PluginMetadataParserTest {
PluginDescriptor descriptor = toPluginDescriptor("" + //
"<plugin name='drift-test-plugin' displayName='Drift
Test' package='org.rhq.plugins.test'" + //
"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
+ //
- " xmlns='urn:xmlns:rhq-plugin'" + //
- " xmlns:d='urn:xmlns:rhq-drift'>" + //
+ " xmlns='urn:xmlns:rhq-plugin'>" + //
" <server name='TestServer'>" + //
" <drift-configuration name='test1'>" + //
- " <d:basedir>" + //
- "
<d:value-context>pluginConfiguration</d:value-context>" + //
- " <d:value-name>var.lib.test1</d:value-name>"
+ //
- " </d:basedir>" + //
- " <d:interval>11111</d:interval>" + //
- " <d:includes>" + //
- " <d:include path='ilib'
pattern='*.ijar'/>" + //
- " <d:include path='iconf'
pattern='*.ixml'/>" + //
- " </d:includes>" + //
+ " <basedir>" + //
+ "
<value-context>pluginConfiguration</value-context>" + //
+ " <value-name>var.lib.test1</value-name>" +
//
+ " </basedir>" + //
+ " <interval>11111</interval>" + //
+ " <includes>" + //
+ " <include path='ilib'
pattern='*.ijar'/>" + //
+ " <include path='iconf'
pattern='*.ixml'/>" + //
+ " </includes>" + //
" </drift-configuration>" + //
" <drift-configuration name='test2'>" + //
- " <d:basedir>" + //
- "
<d:value-context>resourceConfiguration</d:value-context>" + //
- " <d:value-name>var.lib.test2</d:value-name>"
+ //
- " </d:basedir>" + //
- " <d:interval>22222</d:interval>" + //
- " <d:excludes>" + //
- " <d:exclude path='elib'
pattern='*.ejar'/>" + //
- " <d:exclude path='econf'
pattern='*.exml'/>" + //
- " </d:excludes>" + //
+ " <basedir>" + //
+ "
<value-context>resourceConfiguration</value-context>" + //
+ " <value-name>var.lib.test2</value-name>" +
//
+ " </basedir>" + //
+ " <interval>22222</interval>" + //
+ " <excludes>" + //
+ " <exclude path='elib'
pattern='*.ejar'/>" + //
+ " <exclude path='econf'
pattern='*.exml'/>" + //
+ " </excludes>" + //
" </drift-configuration>" + //
" <drift-configuration name='test3'>" + //
- " <d:basedir>" + //
- "
<d:value-context>measurementTrait</d:value-context>" + //
- " <d:value-name>var.lib.test3</d:value-name>"
+ //
- " </d:basedir>" + //
- " <d:interval>33333</d:interval>" + //
- " <d:includes>" + //
- " <d:include path='ilib'
pattern='*.ijar'/>" + //
- " <d:include path='iconf'
pattern='*.ixml'/>" + //
- " </d:includes>" + //
- " <d:excludes>" + //
- " <d:exclude path='elib'
pattern='*.ejar'/>" + //
- " <d:exclude path='econf'
pattern='*.exml'/>" + //
- " </d:excludes>" + //
+ " <basedir>" + //
+ "
<value-context>measurementTrait</value-context>" + //
+ " <value-name>var.lib.test3</value-name>" +
//
+ " </basedir>" + //
+ " <interval>33333</interval>" + //
+ " <includes>" + //
+ " <include path='ilib'
pattern='*.ijar'/>" + //
+ " <include path='iconf'
pattern='*.ixml'/>" + //
+ " </includes>" + //
+ " <excludes>" + //
+ " <exclude path='elib'
pattern='*.ejar'/>" + //
+ " <exclude path='econf'
pattern='*.exml'/>" + //
+ " </excludes>" + //
" </drift-configuration>" + //
" <drift-configuration name='test4'>" + //
- " <d:basedir>" + //
- "
<d:value-context>fileSystem</d:value-context>" + //
- " <d:value-name>/wot/gorilla</d:value-name>" +
//
- " </d:basedir>" + //
- " <d:interval>44444</d:interval>" + //
+ " <basedir>" + //
+ " <value-context>fileSystem</value-context>" +
//
+ " <value-name>/wot/gorilla</value-name>" + //
+ " </basedir>" + //
+ " <interval>44444</interval>" + //
" </drift-configuration>" + //
" </server>" + //
"</plugin>");
diff --git
a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
index e76feab..326c993 100644
---
a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
+++
b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
@@ -83,7 +83,6 @@ public abstract class ServerPluginDescriptorUtil {
PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN_ENTITLEMENT,
XmlSchemas.PKG_SERVERPLUGIN_ENTITLEMENT);
PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN_BUNDLE,
XmlSchemas.PKG_SERVERPLUGIN_BUNDLE);
PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN_PACKAGETYPE,
XmlSchemas.PKG_SERVERPLUGIN_PACKAGETYPE);
- PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN_DRIFT,
XmlSchemas.PKG_SERVERPLUGIN_DRIFT);
// so we only have to do this once, build a ':' separated context path
containing all schema package names
StringBuilder packages = new StringBuilder();
@@ -239,8 +238,8 @@ public abstract class ServerPluginDescriptorUtil {
pluginDescriptor = ((JAXBElement<? extends
ServerPluginDescriptorType>) jaxbElement).getValue();
} finally {
if (unmarshaller != null) {
- ValidationEventCollector validationEventCollector =
-
(ValidationEventCollector)unmarshaller.getEventHandler();
+ ValidationEventCollector validationEventCollector =
(ValidationEventCollector) unmarshaller
+ .getEventHandler();
logValidationEvents(pluginJarFileUrl, validationEventCollector);
}
}
@@ -330,34 +329,35 @@ public abstract class ServerPluginDescriptorUtil {
//
StringBuilder message = new StringBuilder();
String severity = null;
- switch(event.getSeverity()) {
- case ValidationEvent.WARNING:
- severity = "warning";
- break;
- case ValidationEvent.ERROR:
- severity = "error";
- break;
- case ValidationEvent.FATAL_ERROR:
- severity = "fatal error";
- break;
+ switch (event.getSeverity()) {
+ case ValidationEvent.WARNING:
+ severity = "warning";
+ break;
+ case ValidationEvent.ERROR:
+ severity = "error";
+ break;
+ case ValidationEvent.FATAL_ERROR:
+ severity = "fatal error";
+ break;
}
message.append("Validation ").append(severity);
File pluginJarFile = new File(pluginJarFileUrl.getPath());
- message.append(" while parsing
[").append(pluginJarFile.getName()).append(":").append(PLUGIN_DESCRIPTOR_PATH).append("]");
+ message.append(" while parsing
[").append(pluginJarFile.getName()).append(":").append(
+ PLUGIN_DESCRIPTOR_PATH).append("]");
ValidationEventLocator locator = event.getLocator();
message.append(" at line ").append(locator.getLineNumber());
message.append(", column ").append(locator.getColumnNumber());
message.append(": ").append(event.getMessage());
// Now write the message to the log at an appropriate level.
- switch(event.getSeverity()) {
- case ValidationEvent.WARNING:
- case ValidationEvent.ERROR:
- LOG.warn(message);
- break;
- case ValidationEvent.FATAL_ERROR:
- LOG.error(message);
- break;
+ switch (event.getSeverity()) {
+ case ValidationEvent.WARNING:
+ case ValidationEvent.ERROR:
+ LOG.warn(message);
+ break;
+ case ValidationEvent.FATAL_ERROR:
+ LOG.error(message);
+ break;
}
}
}
diff --git
a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
index ea48d0e..4aab442 100644
---
a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
+++
b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
@@ -75,8 +75,4 @@ public interface XmlSchemas {
// the schema used to define content source metadata which is used by content plugins
like the URL or Disk plugins
public static final String XSD_CONTENTSOURCE_PACKAGEDETAILS =
"rhq-contentsource-packagedetails.xsd";
public static final String PKG_CONTENTSOURCE_PACKAGEDETAILS =
"org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails";
-
- // the schema used to define content source metadata which is used by content plugins
like the URL or Disk plugins
- public static final String XSD_SERVERPLUGIN_DRIFT =
"rhq-serverplugin-drift.xsd";
- public static final String PKG_SERVERPLUGIN_DRIFT =
"org.rhq.enterprise.server.xmlschema.generated.serverplugin.drift";
}
\ No newline at end of file