.classpath
| 2
etc/apt/pom.xml
| 2
etc/samples/perspectives/sample-perspective/app/pom.xml
| 2
etc/samples/perspectives/sample-perspective/perspective/pom.xml
| 2
etc/samples/skeleton-plugin/pom.xml
| 2
modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java
| 2
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
| 7
modules/core/plugindoc/pom.xml
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
| 25 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotDriftDetailsView.java
| 82 +++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
| 136 ++++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
| 90 +++---
modules/enterprise/gui/webdav-war/pom.xml
| 2
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
| 32 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java
| 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java
| 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
| 143 ++++++----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
| 61 ++--
modules/enterprise/server/plugins/alert-scriptlang/pom.xml
| 2
modules/enterprise/server/plugins/alert-sms/pom.xml
| 2
modules/enterprise/server/plugins/cloud/pom.xml
| 2
modules/enterprise/server/plugins/drift-mongodb/pom.xml
| 2
modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
| 2
modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
| 2
modules/enterprise/server/plugins/perspectives/policy/pom.xml
| 2
modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
| 2
modules/helpers/inventory-serializer/pom.xml
| 4
modules/integration-tests/mod_cluster-plugin-test/pom.xml
| 2
modules/jopr/pom.xml
| 2
modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
| 2
modules/plugins/hardware/pom.xml
| 2
modules/plugins/iptables/pom.xml
| 2
modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
| 3
modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
| 3
modules/plugins/jdbctrace/pom.xml
| 2
modules/plugins/jira/pom.xml
| 2
modules/plugins/lsof/pom.xml
| 2
modules/plugins/onewire/pom.xml
| 2
modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
| 6
modules/plugins/raw-config-test/pom.xml
| 2
modules/plugins/services/pom.xml
| 2
42 files changed, 389 insertions(+), 280 deletions(-)
New commits:
commit e7dbeafaf53877f9f1bc26c11d5157ddaf5105fb
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 13:53:41 2011 -0400
We've already upped the pom versions in every place that the release builds
actually touch. But it seems we didn't up then in the places that the
release build does not touch. Upping instances of 4.1.0-SNAPSHOT to
4.3.0-SNAPSHOT.
diff --git a/etc/apt/pom.xml b/etc/apt/pom.xml
index 65136e1..0e4ab0d 100644
--- a/etc/apt/pom.xml
+++ b/etc/apt/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/etc/samples/perspectives/sample-perspective/app/pom.xml
b/etc/samples/perspectives/sample-perspective/app/pom.xml
index ced290d..1b205a9 100644
--- a/etc/samples/perspectives/sample-perspective/app/pom.xml
+++ b/etc/samples/perspectives/sample-perspective/app/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/etc/samples/perspectives/sample-perspective/perspective/pom.xml
b/etc/samples/perspectives/sample-perspective/perspective/pom.xml
index 963a8ca..ce97a56 100644
--- a/etc/samples/perspectives/sample-perspective/perspective/pom.xml
+++ b/etc/samples/perspectives/sample-perspective/perspective/pom.xml
@@ -10,7 +10,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/etc/samples/skeleton-plugin/pom.xml b/etc/samples/skeleton-plugin/pom.xml
index b72c93d..0af4c89 100644
--- a/etc/samples/skeleton-plugin/pom.xml
+++ b/etc/samples/skeleton-plugin/pom.xml
@@ -15,7 +15,7 @@
<description>A template for building a custom RHQ Agent
plugin</description>
<properties>
- <rhq.version>4.1.0-SNAPSHOT</rhq.version>
+ <rhq.version>4.3.0-SNAPSHOT</rhq.version>
</properties>
<dependencies>
diff --git
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java
index 3148d09..e1a761f 100644
---
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java
+++
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java
@@ -389,7 +389,7 @@ public abstract class AgentPluginDescriptorUtil {
for (ValidationEvent event : validationEventCollector.getEvents()) {
// First build the message to be logged. The message will look something like
this:
//
- // Validation fatal error while parsing
[jopr-jboss-as-plugin-4.1.0-SNAPSHOT.jar:META-INF/rhq-plugin.xml]
+ // Validation fatal error while parsing
[jopr-jboss-as-plugin-4.3.0-SNAPSHOT.jar:META-INF/rhq-plugin.xml]
// at line 221, column 94: cvc-minInclusive-valid: Value '20000' is
not facet-valid with respect to
// minInclusive '30000' for type
'#AnonType_defaultIntervalmetric'.
//
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 5586534..6771f72 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml
b/modules/enterprise/gui/webdav-war/pom.xml
index 77aca38..021dc70 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git
a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
index 7db3365..adab2c8 100644
---
a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
+++
b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
@@ -87,7 +87,7 @@ public class DriftServerTest extends AbstractEJB3Test {
prepareCustomServerPluginService(driftServerPluginService);
driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
- File jpaDriftPlugin = new
File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.1.0-SNAPSHOT.jar");
+ File jpaDriftPlugin = new
File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.3.0-SNAPSHOT.jar");
assertTrue("Drift server plugin JAR file not found at" +
jpaDriftPlugin.getPath(), jpaDriftPlugin.exists());
FileUtils.copyFileToDirectory(jpaDriftPlugin,
driftServerPluginService.masterConfig.getPluginDirectory());
@@ -179,9 +179,8 @@ public class DriftServerTest extends AbstractEJB3Test {
protected void deleteEntity(Class<?> clazz, String name, EntityManager em) {
try {
Object entity = em.createQuery(
- "select entity from " + clazz.getSimpleName() + " entity
where entity.name = :name")
- .setParameter("name", name)
- .getSingleResult();
+ "select entity from " + clazz.getSimpleName() + " entity
where entity.name = :name").setParameter(
+ "name", name).getSingleResult();
em.remove(entity);
} catch (NoResultException e) {
// we can ignore no results because this code will run when the db
@@ -189,18 +188,14 @@ public class DriftServerTest extends AbstractEJB3Test {
} catch (NonUniqueResultException e) {
// we will fail here to let the person running the test know that
// the database may not be in a consistent state
- fail("Purging " + name + " failed. Expected to find one
instance of " + clazz.getSimpleName() +
- " but found more than one. The database may not be in a consistent
state.");
+ fail("Purging " + name + " failed. Expected to find one
instance of " + clazz.getSimpleName()
+ + " but found more than one. The database may not be in a consistent
state.");
}
}
protected void initResourceType() {
- resourceType = new ResourceTypeBuilder().createResourceType()
- .withId(0)
- .withName(RESOURCE_TYPE_NAME)
- .withCategory(SERVER)
- .withPlugin(RESOURCE_TYPE_NAME.toLowerCase())
- .build();
+ resourceType = new
ResourceTypeBuilder().createResourceType().withId(0).withName(RESOURCE_TYPE_NAME)
+ .withCategory(SERVER).withPlugin(RESOURCE_TYPE_NAME.toLowerCase()).build();
}
protected void initAgent() {
@@ -208,13 +203,8 @@ public class DriftServerTest extends AbstractEJB3Test {
}
protected void initResource() {
- resource = new ResourceBuilder().createResource()
- .withId(0)
- .withName(RESOURCE_NAME)
- .withResourceKey(RESOURCE_NAME)
- .withRandomUuid()
- .withResourceType(resourceType)
- .build();
+ resource = new
ResourceBuilder().createResource().withId(0).withName(RESOURCE_NAME).withResourceKey(
+ RESOURCE_NAME).withRandomUuid().withResourceType(resourceType).build();
}
protected Subject getOverlord() {
@@ -226,8 +216,8 @@ public class DriftServerTest extends AbstractEJB3Test {
}
protected String toString(DriftDefinitionTemplate template) {
- return DriftDefinitionTemplate.class.getSimpleName() + "[id: " +
template.getId() + ", name: " +
- template.getName() + "]";
+ return DriftDefinitionTemplate.class.getSimpleName() + "[id: " +
template.getId() + ", name: "
+ + template.getName() + "]";
}
protected Drift findDriftByPath(List<? extends Drift> drifts, String path) {
diff --git a/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
b/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
index a9816b4..d76ad0a 100644
--- a/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
+++ b/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
@@ -8,7 +8,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-sms/pom.xml
b/modules/enterprise/server/plugins/alert-sms/pom.xml
index 5b7a1c5..b34c97c 100644
--- a/modules/enterprise/server/plugins/alert-sms/pom.xml
+++ b/modules/enterprise/server/plugins/alert-sms/pom.xml
@@ -8,7 +8,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cloud/pom.xml
b/modules/enterprise/server/plugins/cloud/pom.xml
index fcb145f..176b174 100644
--- a/modules/enterprise/server/plugins/cloud/pom.xml
+++ b/modules/enterprise/server/plugins/cloud/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/drift-mongodb/pom.xml
b/modules/enterprise/server/plugins/drift-mongodb/pom.xml
index 23e8981..7d14df3 100644
--- a/modules/enterprise/server/plugins/drift-mongodb/pom.xml
+++ b/modules/enterprise/server/plugins/drift-mongodb/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
b/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
index 80180de..164de34 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
index 72c885e..51d3e6c 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
@@ -10,7 +10,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/pom.xml
b/modules/enterprise/server/plugins/perspectives/policy/pom.xml
index 28788d8..618522f 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
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..1e3bae0 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
@@ -324,7 +324,7 @@ public abstract class ServerPluginDescriptorUtil {
for (ValidationEvent event : validationEventCollector.getEvents()) {
// First build the message to be logged. The message will look something like
this:
//
- // Validation fatal error while parsing
[jopr-jboss-as-plugin-4.1.0-SNAPSHOT.jar:META-INF/rhq-plugin.xml]
+ // Validation fatal error while parsing
[jopr-jboss-as-plugin-4.3.0-SNAPSHOT.jar:META-INF/rhq-plugin.xml]
// at line 221, column 94: cvc-minInclusive-valid: Value '20000' is
not facet-valid with respect to
// minInclusive '30000' for type
'#AnonType_defaultIntervalmetric'.
//
diff --git a/modules/helpers/inventory-serializer/pom.xml
b/modules/helpers/inventory-serializer/pom.xml
index b97f9fb..687296d 100644
--- a/modules/helpers/inventory-serializer/pom.xml
+++ b/modules/helpers/inventory-serializer/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>inventory-serializer</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>Inventory Serializer</name>
<description>A helper command line app to export parts of the inventory to
XML</description>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 4e29e2b..bb40916 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/jopr/pom.xml b/modules/jopr/pom.xml
index 10eba8f..aa8b6d2 100644
--- a/modules/jopr/pom.xml
+++ b/modules/jopr/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
index 6a63c06..305babe 100644
--- a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
+++ b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/hardware/pom.xml b/modules/plugins/hardware/pom.xml
index 0f54830..a922967 100644
--- a/modules/plugins/hardware/pom.xml
+++ b/modules/plugins/hardware/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iptables/pom.xml b/modules/plugins/iptables/pom.xml
index 0772067..266acbc 100644
--- a/modules/plugins/iptables/pom.xml
+++ b/modules/plugins/iptables/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jdbctrace/pom.xml b/modules/plugins/jdbctrace/pom.xml
index 69d9ac3..f052dff 100644
--- a/modules/plugins/jdbctrace/pom.xml
+++ b/modules/plugins/jdbctrace/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jira/pom.xml b/modules/plugins/jira/pom.xml
index c2123dc..6e488f6 100644
--- a/modules/plugins/jira/pom.xml
+++ b/modules/plugins/jira/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/lsof/pom.xml b/modules/plugins/lsof/pom.xml
index 1c691f4..6f7439d 100644
--- a/modules/plugins/lsof/pom.xml
+++ b/modules/plugins/lsof/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/onewire/pom.xml b/modules/plugins/onewire/pom.xml
index 57b0ed0..0cf5d3a 100644
--- a/modules/plugins/onewire/pom.xml
+++ b/modules/plugins/onewire/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/raw-config-test/pom.xml
b/modules/plugins/raw-config-test/pom.xml
index 666329c..5a4abc6 100644
--- a/modules/plugins/raw-config-test/pom.xml
+++ b/modules/plugins/raw-config-test/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.plugins</groupId>
diff --git a/modules/plugins/services/pom.xml b/modules/plugins/services/pom.xml
index 3fc60b5..adf6da8 100644
--- a/modules/plugins/services/pom.xml
+++ b/modules/plugins/services/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-services-plugin</artifactId>
commit 721cb4ed7a305c331a37cad3834dcdc37aa76ed8
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 13:51:47 2011 -0400
remove webservices stuff from eclipse libs, I don't think we need it for
an eclipse build.
diff --git a/.classpath b/.classpath
index 0fe640b..195902e 100644
--- a/.classpath
+++ b/.classpath
@@ -124,7 +124,6 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/resteasy/resteasy-jaxrs/2.2.1.GA/resteasy-jaxrs-2.2.1.GA.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/resteasy/resteasy-jettison-provider/2.2.1.GA/resteasy-jettison-provider-2.2.1.GA.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/resteasy/jaxrs-api/2.2.1.GA/jaxrs-api-2.2.1.GA.jar"/>
- <classpathentry exported="true" kind="lib"
path="modules/enterprise/remoting/webservices/target/rhq-remoting-webservices-4.1.0-SNAPSHOT/wsconsume-output"/>
<classpathentry kind="src"
path="modules/common/ant-bundle/src/main/java"/>
<classpathentry kind="src"
path="modules/enterprise/server/plugins/drift-mongodb/src/main/java"/>
<classpathentry kind="src"
path="modules/enterprise/server/plugins/drift-mongodb/src/test/java"/>
@@ -287,6 +286,5 @@
<classpathentry kind="src"
path="modules/plugins/jboss-as-7/src/test/java"/>
<classpathentry kind="src"
path="modules/integration-tests/jboss-as-7-plugin-test/src/test/java"/>
<classpathentry kind="src"
path="modules/integration-tests/mod_cluster-plugin-test/src/test/java"/>
- <classpathentry kind="lib"
path="modules/enterprise/remoting/webservices/target/rhq-remoting-webservices-4.1.0-SNAPSHOT/wsprovide-output"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
commit e3b6312a8bb94f417b84b72caa486ec6f775fec3
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 12:18:12 2011 -0400
Update plugins supporting drift to use better template names
- new conventions: "Template: Some Name"
- add descriptions to all plugin defined templates
diff --git a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
index 1503962..e337217 100644
--- a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
@@ -1195,7 +1195,8 @@
</configuration>
</content>
- <drift-definition name="Core Files">
+ <drift-definition name="Template: Base Files"
+ description="A template for monitoring base application
server files for drift. It defines monitoring for some standard sub-directories of the
HOME directory. Note, it is not recommeded to monitor all files for an application
server. There are many files, and many temp files.">
<basedir>
<value-context>pluginConfiguration</value-context>
<value-name>homeDir</value-name>
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 44a2ea5..d02a8c0 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
@@ -258,7 +258,8 @@
</configuration>
</content>
- <drift-definition name="Core Files">
+ <drift-definition name="Template: Base Files"
+ description="A template for monitoring base application
server files for drift. It defines monitoring for some standard sub-directories of the
HOME directory. Note, it is not recommeded to monitor all files for an application
server. There are many files, and many temp files.">
<basedir>
<value-context>pluginConfiguration</value-context>
<value-name>jbossHomeDir</value-name>
diff --git a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
index 6339c74..fa07736 100644
--- a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
@@ -40,13 +40,13 @@
</bundle-target>
'>
<!ENTITY driftConfig '
- <drift-definition name="File System"
- description="A general purpose template for file system
drift monitoring. It is expected that the base directory will be changed as the file
system root is not recommended.">
+ <drift-definition name="Template: File System"
+ description="A template for monitoring the file system for
drift. It is expected that definitions will set a more specific base directory as the file
system root is not recommended.">
<basedir>
<value-context>fileSystem</value-context>
<value-name>/</value-name>
</basedir>
- </drift-definition>
+ </drift-definition>
'>
<!ENTITY metrics '
<metric displayName="Hostname"
commit eb021c14ddf1f673a500e237c161bf480fc74bb6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 12:12:29 2011 -0400
Rework drift metadata update for changes to plugin defined drift templates.
Now supports handling of:
- user and plugin defined templates for the type
- templates with attached definitions
- pinned templates
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index 7949af1..b44bee1 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -439,6 +439,7 @@ public class ResourceType implements Serializable,
Comparable<ResourceType> {
this.packageTypes = new HashSet<PackageType>();
this.subCategories = new ArrayList<ResourceSubCategory>();
this.productVersions = new HashSet<ProductVersion>();
+ this.driftDefinitionTemplates = new HashSet<DriftDefinitionTemplate>();
this.name = name;
this.category = category;
@@ -841,6 +842,10 @@ public class ResourceType implements Serializable,
Comparable<ResourceType> {
driftDefinitionTemplates.add(template);
}
+ public void setDriftDefinitionTemplates(Set<DriftDefinitionTemplate>
driftDefinitionTemplates) {
+ this.driftDefinitionTemplates = driftDefinitionTemplates;
+ }
+
@Override
public boolean equals(Object obj) {
if (this == obj)
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
index 9baf7a4..4346f69 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
@@ -44,10 +44,11 @@ import org.rhq.core.clientapi.agent.metadata.PluginMetadataManager;
import org.rhq.core.clientapi.agent.metadata.SubCategoriesMetadataParser;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.definition.ConfigurationTemplate;
import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftDefinitionComparator;
import org.rhq.core.domain.drift.DriftDefinitionTemplate;
+import org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode;
import org.rhq.core.domain.resource.ProcessScan;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceSubCategory;
@@ -450,74 +451,114 @@ public class ResourceMetadataManagerBean implements
ResourceMetadataManagerLocal
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void updateDriftMetadata(ResourceType existingType, ResourceType resourceType)
{
- boolean isSame = true;
-
existingType = entityManager.find(ResourceType.class, existingType.getId());
//
- // First, we need to see if the drift definitions have changed. If the existing
and new drift definitions
- // are the same, then we can skip the update and do nothing. Only if one or more
drift definitions
- // are different do we have to do anything to the persisted metadata.
+ // Only if one or more drift definitions are different do we have to do anything
to the persisted metadata.
//
Set<DriftDefinitionTemplate> existingDriftTemplates =
existingType.getDriftDefinitionTemplates();
- Set<DriftDefinitionTemplate> newDriftTemplates =
resourceType.getDriftDefinitionTemplates();
- if (existingDriftTemplates.size() != newDriftTemplates.size()) {
- isSame = false;
- } else {
- // note: the size of the sets are typically really small (usually between 0
and 3),
- // so iterating through them is fast.
-
- // look at all the configs to ensure we detect any changes to individual
settings on the templates
- Set<String> existingNames = new
HashSet<String>(existingDriftTemplates.size());
- Set<String> newNames = new
HashSet<String>(newDriftTemplates.size());
- for (DriftDefinitionTemplate existingTemplate : existingDriftTemplates) {
- String existingName = existingTemplate.getName();
- Configuration existingConfig = existingTemplate.getConfiguration();
-
- existingNames.add(existingName); // for later
-
- for (DriftDefinitionTemplate newTemplate : newDriftTemplates) {
- String newName = newTemplate.getName();
- newNames.add(newName); // for later, do this here, not in the if-stmt
below, so we can catch if new has names not in existing
- if (newName.equals(existingName)) {
- Configuration newConfig = newTemplate.getConfiguration();
- if (!existingConfig.equals(newConfig)) {
- isSame = false;
- }
- break;
+
+ // We are only concerned with the plugin defined templates, user defined
templates are not affected.
+
+ Set<DriftDefinitionTemplate> existingPluginDriftTemplates = new
HashSet<DriftDefinitionTemplate>(
+ existingDriftTemplates.size());
+
+ for (DriftDefinitionTemplate existingTemplate : existingDriftTemplates) {
+ if (!existingTemplate.isUserDefined()) {
+ existingPluginDriftTemplates.add(existingTemplate);
+ }
+ }
+
+ Set<DriftDefinitionTemplate> newPluginDriftTemplates =
resourceType.getDriftDefinitionTemplates();
+ // note: the size of the sets are typically really small (usually between 1 and
3),
+ // so iterating through them is fast.
+
+ // look at all the configs to ensure we detect any changes to individual settings
on the templates
+ Set<String> existingNames = new
HashSet<String>(existingPluginDriftTemplates.size());
+ DriftDefinitionComparator dirComp = new
DriftDefinitionComparator(CompareMode.ONLY_DIRECTORY_SPECIFICATIONS);
+
+ for (Iterator<DriftDefinitionTemplate> i =
existingDriftTemplates.iterator(); i.hasNext();) {
+ DriftDefinitionTemplate existingTemplate = i.next();
+
+ String existingName = existingTemplate.getName();
+ DriftDefinition existingDef = existingTemplate.getTemplateDefinition();
+ Set<DriftDefinition> attachedDefs =
existingTemplate.getDriftDefinitions();
+ boolean noAttachedDefs = (null == attachedDefs || attachedDefs.isEmpty());
+ boolean notPinned = !existingTemplate.isPinned();
+ boolean stillDefined = false;
+
+ // for later to determine if any existing templates are no longer defined in
the plugin
+ existingNames.add(existingName);
+
+ for (DriftDefinitionTemplate newTemplate : newPluginDriftTemplates) {
+ String newName = newTemplate.getName();
+
+ // The new template existed previously. See if it has changed and if so,
in what way:
+ //
+ // IF the existingTemplate
+ // has no attached defs AND
+ // is not pinned
+ // THEN we can update it with impunity
+ // ELSE IF the directories have not changed
+ // THEN we can update the base info fields only
+ // Note that in the latter case we update the template but we will not
push the
+ // changes down to attached defs. This is a little odd because the
template and defs can
+ // get out of sync, but we don't want a plugin change to affect
existing defs in case
+ // the user has made manual changes, or wants it the way it is.
+ if (newName.equals(existingName)) {
+ stillDefined = true;
+
+ DriftDefinition newDef = newTemplate.getTemplateDefinition();
+ boolean noDirChanges = (0 == dirComp.compare(existingDef, newDef));
+
+ if ((noAttachedDefs && notPinned) || noDirChanges) {
+ existingTemplate.setTemplateDefinition(newDef);
+
+ } else {
+ // can't update directories for an existing template if
pinned and/or having attached defs
+ log.error("Failed to update drift definition [" +
newName + "] on type ["
+ + resourceType.getName()
+ + "]. It is not allowed to update directories on an
existing template that is pinned "
+ + "or has attached definitions. It would invalidate
pinned snapshots as the fileset "
+ + "would no longer map from template to
definition.");
}
- }
- if (!isSame) {
break;
}
}
- if (isSame) {
- // make sure they all have the same names and no duplicate names existed
- isSame = existingNames.equals(newNames) && existingNames.size()
== existingDriftTemplates.size();
+ // If the template is no longer defined then what we do depends on whether it
has attached
+ // definitions. If not it can be deleted, otherwise we keep it around so the
user doesn't lose
+ // anything, but set it to user-defined, in essence removing it from the
plugin.
+ if (!stillDefined) {
+ if (noAttachedDefs) {
+ entityManager.remove(existingTemplate);
+ i.remove();
+
+ } else {
+ existingTemplate.setUserDefined(true);
+ log.warn("Plugin no longer defines drift template [" +
existingTemplate.getName() + "] on type ["
+ + resourceType.getName()
+ + "]. This template has attached definitions. To preserve
the existing definitions the "
+ + " template will not be removed but is instead being set as
user-defined. The user will "
+ + " be responsible for further maintenance of this
template.");
+ }
}
}
- //
- // If one or more drift definitions are different between new and existing,
- // then we need to remove the old drift definition and persist the new drift
definition.
- //
+ // Now add new templates, not previously defined
+ for (DriftDefinitionTemplate newTemplate : newPluginDriftTemplates) {
+ String newName = newTemplate.getName();
- if (!isSame) {
- for (DriftDefinitionTemplate doomed : existingDriftTemplates) {
- entityManager.remove(doomed);
+ if (existingNames.contains(newName)) {
+ continue;
}
- existingType.getDriftDefinitionTemplates().clear();
- for (DriftDefinitionTemplate toPersist : newDriftTemplates) {
- entityManager.persist(toPersist);
- existingType.addDriftDefinitionTemplate(toPersist);
- }
+ newTemplate.setResourceType(existingType);
+ entityManager.persist(newTemplate);
+ existingDriftTemplates.add(newTemplate);
}
-
- return;
}
private void persistNewType(ResourceType resourceType) {
commit 36fec921afa5faaeb158d1fc3a28659831bc7bc8
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 11:43:10 2011 -0400
Fix issue in handling of non-cached metadata types in type repo. Also,
optimize further by only querying for metadata that is not already cached
for the requested types.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index 743c094..7949af1 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -401,7 +401,7 @@ public class ResourceType implements Serializable,
Comparable<ResourceType> {
private BundleType bundleType;
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
"resourceType")
- private Set<DriftDefinitionTemplate> driftDefinitionTemplates = new
HashSet<DriftDefinitionTemplate>();
+ private Set<DriftDefinitionTemplate> driftDefinitionTemplates;
// note that this is mapped to a Configuration entity, which is what it really is.
However, our getter/setter
// only provides access to this via ResourceTypeBundleConfiguration to encapsulate
the innards of this implementation
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
index 2b3dbb1..15d7221 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
@@ -31,7 +31,6 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.rhq.core.domain.criteria.ResourceTypeCriteria;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
@@ -58,27 +57,31 @@ public class ResourceTypeRepository {
private static ResourceTypeGWTServiceAsync resourceTypeService =
GWTServiceLookup.getResourceTypeGWTService();
/**
- * The following MetadadaTypes are not cached and will always be queried from the
database:<br/>
+ * The following MetadadaTypes are subject to change and are always fetched from the
database:<br/>
* driftDefinitionTemplates
*
* @author Jay Shaughnessy
*/
public enum MetadataType {
children, operations, measurements, content, events,
pluginConfigurationDefinition, resourceConfigurationDefinition, subCategory, parentTypes,
processScans, productVersions, driftDefinitionTemplates(
- false);
+ true);
- private boolean isCachedMetadata;
+ private boolean isFetchAlways;
private MetadataType() {
- this.isCachedMetadata = true;
+ this(false);
}
- private MetadataType(boolean isCachedMetadata) {
- this.isCachedMetadata = isCachedMetadata;
+ /**
+ * @param isFetchAlways if true then the cache for this metadata will be
refreshed each time it is requested.
+ * Meaning, the db will always be called because this metadata is subject to
change.
+ */
+ private MetadataType(boolean isFetchAlways) {
+ this.isFetchAlways = isFetchAlways;
}
- public boolean isCachedMetadata() {
- return isCachedMetadata;
+ public boolean isFetchAlways() {
+ return isFetchAlways;
}
}
@@ -187,22 +190,17 @@ public class ResourceTypeRepository {
});
}
- public void getResourceTypes(Integer[] resourceTypeIds, EnumSet<MetadataType>
metadataTypesNeeded,
+ public void getResourceTypes(Integer[] resourceTypeIds, EnumSet<MetadataType>
metadataTypes,
final TypesLoadedCallback callback) {
- // note, metadataTypesNeeded == null implies EnumSet.noneOf(MetadataType.class)
- final EnumSet<MetadataType> metadataTypes;
- if (metadataTypesNeeded == null) {
- metadataTypes = EnumSet.noneOf(MetadataType.class);
- } else {
- metadataTypes = metadataTypesNeeded;
- }
-
- ResourceTypeCriteria criteria = new ResourceTypeCriteria();
+ // note, metadataTypes == null implies EnumSet.noneOf(MetadataType.class)
+ metadataTypes = (null == metadataTypes) ? EnumSet.noneOf(MetadataType.class) :
metadataTypes;
final Map<Integer, ResourceType> cachedTypes = new HashMap<Integer,
ResourceType>();
-
List<Integer> typesNeeded = new ArrayList<Integer>();
+ EnumSet<MetadataType> metadataTypesNeeded =
EnumSet.noneOf(MetadataType.class);
+ ResourceTypeCriteria criteria = new ResourceTypeCriteria();
+
if (resourceTypeIds == null) {
//preload all
} else {
@@ -215,7 +213,24 @@ public class ResourceTypeRepository {
|| (!metadataTypes.isEmpty() &&
(!typeCacheLevel.containsKey(typeId) // 2.
|| !typeCacheLevel.get(typeId).containsAll(metadataTypes)))) // 3.
{
+ // add this type to the types we need to fetch
typesNeeded.add(typeId);
+
+ // make sure we fetch the metadata needed for this type
+ if (metadataTypesNeeded.size() < metadataTypes.size()) {
+ EnumSet<MetadataType> metadataTypesCached =
typeCacheLevel.get(typeId);
+
+ if (metadataTypesCached == null) {
+ metadataTypesNeeded = metadataTypes;
+
+ } else {
+ for (MetadataType metadataType : metadataTypes) {
+ if (!metadataTypesCached.contains(metadataType)) {
+ metadataTypesNeeded.add(metadataType);
+ }
+ }
+ }
+ }
} else {
cachedTypes.put(typeId, typeCache.get(typeId));
}
@@ -230,7 +245,7 @@ public class ResourceTypeRepository {
criteria.addFilterIds(typesNeeded.toArray(new Integer[typesNeeded.size()]));
}
- for (MetadataType metadataType : metadataTypes) {
+ for (MetadataType metadataType : metadataTypesNeeded) {
switch (metadataType) {
case children:
criteria.fetchChildResourceTypes(true);
@@ -275,16 +290,16 @@ public class ResourceTypeRepository {
criteria.setPageControl(PageControl.getUnlimitedInstance());
- Log.info("Loading [" + typesNeeded.size() + "] types with
facets=[" + metadataTypes + "]...");
+ Log.info("Loading [" + typesNeeded.size() + "] types with
facets=[" + metadataTypesNeeded + "]...");
- if ((topLevelServerAndServiceTypes == null) && (metadataTypes != null)
- && metadataTypes.contains(MetadataType.children)) {
+ if ((topLevelServerAndServiceTypes == null) && (metadataTypesNeeded !=
null)
+ && metadataTypesNeeded.contains(MetadataType.children)) {
// Perform a one-time load of server and service types with no parent types.
These types are implicitly
// children of all platform types, even though they are not included in the
platform types'
// childResourceTypes field.
- loadTopLevelServerAndServiceTypes(callback, metadataTypes, criteria,
cachedTypes);
+ loadTopLevelServerAndServiceTypes(callback, metadataTypesNeeded, criteria,
cachedTypes);
} else {
- loadRequestedTypes(callback, metadataTypes, criteria, cachedTypes);
+ loadRequestedTypes(callback, metadataTypesNeeded, criteria, cachedTypes);
}
}
@@ -370,14 +385,7 @@ public class ResourceTypeRepository {
cachedType.setSubCategory(type.getSubCategory());
break;
case driftDefinitionTemplates:
- if (cachedType.getDriftDefinitionTemplates() != null)
{
- cachedType.getDriftDefinitionTemplates().clear();
// remove any old ones hanging around
- }
- if (type.getDriftDefinitionTemplates() != null) {
- for (DriftDefinitionTemplate template :
type.getDriftDefinitionTemplates()) {
-
cachedType.addDriftDefinitionTemplate(template);
- }
- }
+
cachedType.setDriftDefinitionTemplates(type.getDriftDefinitionTemplates());
break;
default:
Log.error("ERROR: metadataType " +
metadataType.name()
@@ -392,17 +400,17 @@ public class ResourceTypeRepository {
}
if (metadataTypes != null && !metadataTypes.isEmpty()) {
- if (typeCacheLevel.containsKey(type.getId())) {
- typeCacheLevel.get(type.getId()).addAll(metadataTypes);
- } else {
- for (MetadataType metadataType : metadataTypes) {
- if (metadataType.isCachedMetadata) {
- typeCacheLevel.put(type.getId(),
EnumSet.copyOf(metadataTypes));
- }
+ EnumSet<MetadataType> cachedMetadata =
typeCacheLevel.get(type.getId());
+ cachedMetadata = (null == cachedMetadata) ?
EnumSet.noneOf(MetadataType.class) : cachedMetadata;
+ for (MetadataType metadataType : metadataTypes) {
+ if (!metadataType.isFetchAlways()) {
+ cachedMetadata.add(metadataType);
}
}
+ typeCacheLevel.put(type.getId(), cachedMetadata);
}
}
+
if (callback != null) {
callback.onTypesLoaded(cachedTypes);
}
commit 943c020ba2c50878efbf134def1db714d09507a3
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Oct 28 12:59:00 2011 -0400
Change DriftSnapshotView to inline drift details via another level of
expanded rows. This removes a lot of complicated navigation in the UI
(deep anchors, back button issues, lack of context). It also ends up
taking advantage of all the snapshot context already on the page, and
keeping the user in one consolidated, robust snapshot view.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index 1985cd4..d3ef464 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -528,20 +528,6 @@ public class LinkManager {
return "#Resource/" + resourceId + "/Drift/Definitions/" +
driftDefId + "/Snapshot/" + version;
}
- public static String getDriftCarouselSnapshotDriftLink(int resourceId, int
driftDefId, int version, String driftId) {
- if (!driftId.startsWith(StringIDTableSection.ID_PREFIX)) {
- driftId = StringIDTableSection.ID_PREFIX + driftId;
- }
-
- // TODO: for now, just make this the same as the carousel drift link. The
downside is that the back button
- // will bring us back to the carousel and not the snapshot view. Eventually would
like another
- // master-detail relationship here, but it's hairy to get this working.
- //
- // return "#Resource/" + resourceId + "/Drift/Definitions/" +
driftDefId + "/Snapshot/" + version + "/" + driftId;
-
- return getDriftCarouselDriftLink(resourceId, driftDefId, driftId);
- }
-
public static String getDriftTemplateLink(int typeId, int templateId) {
String result =
getAdminTemplatesEditLink(DriftDefinitionTemplateTypeView.VIEW_ID.getName(), typeId);
@@ -553,15 +539,4 @@ public class LinkManager {
return result + "/Snapshot";
}
-
- public static String getDriftTemplateSnapshotDriftLink(int typeId, int templateId,
String driftId) {
- String result = getDriftTemplateSnapshotLink(typeId, templateId);
-
- if (!driftId.startsWith(StringIDTableSection.ID_PREFIX)) {
- driftId = StringIDTableSection.ID_PREFIX + driftId;
- }
-
- return result + "/" + driftId;
- }
-
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
index 8d7baf5..1dcf23b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
@@ -88,7 +88,7 @@ public class DriftDetailsView extends LocatableVLayout {
}
- private void show(DriftDetails driftDetails) {
+ protected void show(DriftDetails driftDetails) {
for (Canvas child : getMembers()) {
removeMember(child);
child.destroy();
@@ -223,7 +223,7 @@ public class DriftDetailsView extends LocatableVLayout {
return changeSetForm;
}
- private FormItem createViewFileLink(String hash, String path, int version,
DriftFileStatus status) {
+ protected FormItem createViewFileLink(String hash, String path, int version,
DriftFileStatus status) {
if (status == LOADED) {
return createViewFileLink(hash, path, version);
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotDriftDetailsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotDriftDetailsView.java
new file mode 100644
index 0000000..549d43c
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotDriftDetailsView.java
@@ -0,0 +1,82 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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.gui.coregui.client.drift;
+
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.SpacerItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+
+import org.rhq.core.domain.drift.DriftDetails;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
+
+/**
+ * Similar to {@link DriftDetailsView} but omits information already present from the
context of the
+ * snapshot view.
+ *
+ * @author Jay Shaughnessy
+ */
+public class DriftSnapshotDriftDetailsView extends DriftDetailsView {
+
+ public DriftSnapshotDriftDetailsView(String locatorId, String driftId) {
+ super(locatorId, driftId);
+ }
+
+ @Override
+ protected void show(DriftDetails driftDetails) {
+ for (Canvas child : getMembers()) {
+ removeMember(child);
+ child.destroy();
+ }
+
+ DynamicForm driftForm = new
LocatableDynamicForm(extendLocatorId("form"));
+ //driftForm.setIsGroup(true);
+ //driftForm.setGroupTitle(MSG.view_tabs_common_drift());
+ driftForm.setWrapItemTitles(false);
+ driftForm.setNumCols(4);
+
+ SpacerItem spacer = new SpacerItem();
+
+ //StaticTextItem id = new StaticTextItem("id", MSG.common_title_id());
+ //id.setValue(driftDetails.getDrift().getId());
+
+ StaticTextItem path = new StaticTextItem("path",
MSG.common_title_path());
+ path.setValue(driftDetails.getDrift().getPath());
+
+ StaticTextItem file = new StaticTextItem("File",
MSG.view_tabs_common_content());
+ FormItem fileLink = null;
+
+ if (driftDetails.isBinaryFile()) {
+ file.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ fileLink = spacer;
+ driftForm.setItems(path, spacer, file, fileLink);
+
+ } else {
+ file.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ fileLink =
createViewFileLink(driftDetails.getDrift().getNewDriftFile().getHashId(), driftDetails
+ .getDrift().getPath(), driftDetails.getChangeSet().getVersion(),
driftDetails.getNewFileStatus());
+ driftForm.setItems(path, spacer, file, fileLink);
+ }
+
+ addMember(driftForm);
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
index e0996eb..e02f23e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
@@ -29,16 +29,19 @@ import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.rpc.RPCResponse;
import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.types.ExpansionMode;
import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.events.DoubleClickEvent;
-import com.smartgwt.client.widgets.events.DoubleClickHandler;
-import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.HoverCustomizer;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.events.RecordCollapseEvent;
+import com.smartgwt.client.widgets.grid.events.RecordCollapseHandler;
+import com.smartgwt.client.widgets.grid.events.RecordExpandEvent;
+import com.smartgwt.client.widgets.grid.events.RecordExpandHandler;
import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
import org.rhq.core.domain.criteria.DriftDefinitionTemplateCriteria;
@@ -53,7 +56,6 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
-import org.rhq.enterprise.gui.coregui.client.components.table.StringIDTableSection;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
@@ -63,7 +65,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
* A view that displays a nested table view of a snapshot. The outer table is a list of
directories in the snapshot
@@ -72,8 +73,6 @@ import
org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
*
* @author Jay Shaughnessy
*/
-// TODO: Make this extend an abstract table so we can set up true master-detail
-//public class DriftSnapshotView extends
StringIDTableSection<DriftSnapshotDataSource> {
public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
private static final String DEFAULT_TITLE = MSG.view_drift_table_snapshot();
@@ -84,7 +83,6 @@ public class DriftSnapshotView extends
Table<DriftSnapshotDataSource> {
private boolean hasWriteAccess;
private String templateChangeSetId;
- private int templateResourceTypeId;
protected DriftSnapshotDataSource dataSource;
protected DriftSnapshotListGrid listGrid;
@@ -134,7 +132,7 @@ public class DriftSnapshotView extends
Table<DriftSnapshotDataSource> {
@Override
protected void onDraw() {
- // Drift def snapshot view
+ // Drift def snapshot view or template pinned snapshot?
if (null != this.driftDefId) {
DriftDefinitionCriteria defCriteria = new DriftDefinitionCriteria();
defCriteria.addFilterId(driftDefId);
@@ -177,7 +175,7 @@ public class DriftSnapshotView extends
Table<DriftSnapshotDataSource> {
String templateName = template.getName();
String title =
MSG.view_drift_table_title_templateSnapshot(templateName);
setTitleString(title);
- templateResourceTypeId = template.getResourceType().getId();
+
DriftSnapshotView.super.onDraw();
}
});
@@ -247,6 +245,9 @@ public class DriftSnapshotView extends
Table<DriftSnapshotDataSource> {
setCanExpandRecords(true);
setCanExpandMultipleRecords(true);
setExpansionMode(ExpansionMode.RELATED);
+
+ //setDefaultHeight(10);
+ //setAutoFitData(Autofit.VERTICAL);
}
@Override
@@ -258,7 +259,8 @@ public class DriftSnapshotView extends
Table<DriftSnapshotDataSource> {
}
}
- public class DirectoryView extends
StringIDTableSection<DirectoryView.DirectoryViewDataSource> {
+ //public class DirectoryView extends
StringIDTableSection<DirectoryView.DirectoryViewDataSource> {
+ public class DirectoryView extends Table<DirectoryView.DirectoryViewDataSource>
{
private String directory;
private DirectoryViewDataSource dataSource;
@@ -273,7 +275,8 @@ public class DriftSnapshotView extends
Table<DriftSnapshotDataSource> {
setShowFooter(false);
setWidth100();
- setHeight(250);
+ setAutoHeight();
+ setOverflow(Overflow.VISIBLE);
setDataSource(getDataSource());
}
@@ -289,56 +292,65 @@ public class DriftSnapshotView extends
Table<DriftSnapshotDataSource> {
}
@Override
+ protected LocatableListGrid createListGrid(String locatorId) {
+ return new DirectoryViewListGrid(locatorId);
+ }
+
+ @Override
protected void configureTable() {
ArrayList<ListGridField> dataSourceFields =
getDataSource().getListGridFields();
getListGrid().setFields(dataSourceFields.toArray(new
ListGridField[dataSourceFields.size()]));
super.configureTable();
+ }
- // TODO: when we have true detail support then we'll want to remove this.
- setListGridDoubleClickHandler(new DoubleClickHandler() {
- @Override
- public void onDoubleClick(DoubleClickEvent event) {
- ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
- if (selectedRows != null && selectedRows.length == 1) {
- String driftId = getId(selectedRows[0]);
- String link = (null == templateId) ?
LinkManager.getDriftCarouselSnapshotDriftLink(resourceId,
- driftDefId, version, driftId) :
LinkManager.getDriftTemplateSnapshotDriftLink(
- templateResourceTypeId, templateId, driftId);
- CoreGUI.goToView(link);
+ private class DirectoryViewListGrid extends LocatableListGrid {
- }
- }
- });
- }
+ public DirectoryViewListGrid(String locatorId) {
+ super(locatorId);
- @Override
- protected String getDetailsLinkColumnName() {
- return DriftDataSource.ATTR_CTIME;
- }
+ setCanExpandRecords(true);
+ setCanExpandMultipleRecords(true);
+ setExpansionMode(ExpansionMode.RELATED);
- @Override
- protected CellFormatter getDetailsLinkColumnCellFormatter() {
- // TODO: provide a drift detail view for the template snapshot view
- if (null == templateId) {
- return new CellFormatter() {
- public String format(Object value, ListGridRecord record, int i, int
i1) {
- String driftId = getId(record);
- String link = (null == templateId) ?
LinkManager.getDriftCarouselSnapshotDriftLink(resourceId,
- driftDefId, version, driftId) :
LinkManager.getDriftTemplateSnapshotDriftLink(
- templateResourceTypeId, templateId, driftId);
-
- String formattedValue = TimestampCellFormatter.format(value);
- return SeleniumUtility.getLocatableHref(link, formattedValue,
null);
+ setDefaultHeight(10);
+ setAutoFitData(Autofit.VERTICAL);
+
+ addRecordExpandHandler(new RecordExpandHandler() {
+
+ @Override
+ public void onRecordExpand(RecordExpandEvent event) {
+ event.getRecord().setAttribute("Expanded", true);
}
- };
- } else {
- return new CellFormatter() {
- public String format(Object value, ListGridRecord record, int i, int
i1) {
- return TimestampCellFormatter.format(value);
+ });
+
+ addRecordCollapseHandler(new RecordCollapseHandler() {
+
+ @Override
+ public void onRecordCollapse(RecordCollapseEvent event) {
+ event.getRecord().setAttribute("Expanded", false);
}
- };
+ });
+
+ }
+
+ @Override
+ protected String getCellCSSText(ListGridRecord record, int rowNum, int
colNum) {
+
+ if
(Boolean.TRUE.equals(record.getAttributeAsBoolean("Expanded"))) {
+ return "background-color:#ffffcc;";
+ }
+
+ return super.getCellCSSText(record, rowNum, colNum);
+
+ }
+
+ @Override
+ protected Canvas getExpansionComponent(ListGridRecord record) {
+
+ String driftId = record.getAttribute(DriftDataSource.ATTR_ID);
+
+ return new DriftSnapshotDriftDetailsView(extendLocatorId(driftId),
driftId);
}
}
@@ -491,11 +503,6 @@ public class DriftSnapshotView extends
Table<DriftSnapshotDataSource> {
return record;
}
}
-
- @Override
- public Canvas getDetailsView(String driftId) {
- return new DriftDetailsView(extendLocatorId("Details"), driftId);
- }
}
/**
@@ -513,21 +520,4 @@ public class DriftSnapshotView extends
Table<DriftSnapshotDataSource> {
return (i < 0) ? path.trim() : path.substring(++i).trim();
}
-
- // TODO: Make this extend an abstract table so we can set up true master-detail
-
- /*
- @Override
- public void renderView(ViewPath viewPath) {
- viewPath.next();
- super.renderView(viewPath);
- }
-
-
- @Override
- public Canvas getDetailsView(String driftId) {
- return new DriftDetailsView(extendLocatorId("Details"), driftId);
- }
- */
-
}
commit 21fd17d6c48ff7c8afee9213ca3cae8f6069d8ce
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Oct 28 12:55:34 2011 -0400
Log failures to reschedule EJB timers. If they don't get rescheduled bad
things can happen, server restart is probably going to be needed.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java
index 2de7bad..51ed428 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java
@@ -89,7 +89,13 @@ public class CacheConsistencyManagerBean implements
CacheConsistencyManagerLocal
log.error("Failed to reload server cache if needed - will try again
later. Cause: " + t);
} finally {
// reschedule ourself to trigger in another 30 seconds
- timerService.createTimer(30000, TIMER_DATA);
+ try {
+ timerService.createTimer(30000, TIMER_DATA);
+ } catch (Throwable t) {
+ log
+ .error("Failed to reschedule cache reload timer! Cache reload
handling will not work from this point. A server restart may be needed after issue is
resolved:"
+ + t);
+ }
}
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java
index be91c65..cc8c435 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java
@@ -119,10 +119,15 @@ public class ServerManagerBean implements ServerManagerLocal {
} catch (Throwable t) {
log.error("Failed to handle cloud heartbeat timer - will try again
later. Cause: " + t);
} finally {
- // reschedule ourself to trigger in another 30 seconds
- timerService.createTimer(30000, TIMER_DATA);
+ // reschedule ourself to trigger in another 30 seconds
+ try {
+ timerService.createTimer(30000, TIMER_DATA);
+ } catch (Throwable t) {
+ log
+ .error("Failed to reschedule cloud heartbeat timer! Server
status handling will not work from this point. A server restart may be needed after issue
is resolved:"
+ + t);
+ }
}
-
}
public int create(Server server) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
index 05d4649..44e48b5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
@@ -60,8 +60,8 @@ import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.domain.common.ServerDetails;
-import org.rhq.core.domain.common.ServerDetails.Detail;
import org.rhq.core.domain.common.SystemConfiguration;
+import org.rhq.core.domain.common.ServerDetails.Detail;
import org.rhq.core.domain.common.composite.SystemSetting;
import org.rhq.core.domain.common.composite.SystemSettings;
import org.rhq.core.domain.configuration.definition.PropertySimpleType;
@@ -152,7 +152,13 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
log.error("Failed to reload the system config cache - will try again
later. Cause: " + t);
} finally {
// reschedule ourself to trigger in another 60 seconds
- timerService.createTimer(60000L, TIMER_DATA);
+ try {
+ timerService.createTimer(60000L, TIMER_DATA);
+ } catch (Throwable t) {
+ log
+ .error("Failed to reschedule system config cache reload timer!
System config cache reload handling will not work from this point. A server restart may be
needed after issue is resolved:"
+ + t);
+ }
}
}
@@ -181,16 +187,16 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
@Deprecated
public Properties getSystemConfiguration(Subject subject) {
Properties copy = new Properties();
-
+
SystemSettings settings = getSystemSettings(subject);
- for(Map.Entry<SystemSetting, String> e : settings.entrySet()) {
+ for (Map.Entry<SystemSetting, String> e : settings.entrySet()) {
//transform the value back to the database format, because that's
//what this method always returned
String value = transformSystemConfigurationProperty(e.getKey(), e.getValue(),
false);
-
+
copy.put(e.getKey().getInternalName(), value);
}
-
+
return copy;
}
@@ -245,19 +251,22 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
//them to "false"/"true" and store that value to
database. This is a one way operation
//and therefore we need to compare the database-agnostic (i.e.
"true"/"false") and
//not database specific.
- String existingValue = transformSystemConfigurationProperty(prop,
existingConfig.getPropertyValue(), true);
-
+ String existingValue = transformSystemConfigurationProperty(prop,
existingConfig.getPropertyValue(),
+ true);
+
if ((existingValue == null && value != null) ||
!existingValue.equals(value)) {
//SystemSetting#isReadOnly should be a superset of the
"fReadOnly" field in the database
//but let's just be super paranoid here...
- if (prop.isReadOnly() || (existingConfig.getFreadOnly() != null
&& existingConfig.getFreadOnly().booleanValue())) {
+ if (prop.isReadOnly()
+ || (existingConfig.getFreadOnly() != null &&
existingConfig.getFreadOnly().booleanValue())) {
throw new IllegalArgumentException("The setting [" +
prop.getInternalName()
- + "] is read-only - you cannot change its current value!
Current value is [" + existingConfig.getPropertyValue() + "] while the new value
was [" + value + "].");
+ + "] is read-only - you cannot change its current value!
Current value is ["
+ + existingConfig.getPropertyValue() + "] while the new
value was [" + value + "].");
}
-
+
//transform to the database-specific format
value = transformSystemConfigurationProperty(prop, value, false);
-
+
existingConfig.setPropertyValue(value);
entityManager.merge(existingConfig);
}
@@ -288,9 +297,9 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
String value = transformSystemConfigurationProperty(prop, e.getValue(),
true);
e.setValue(value);
}
- }
+ }
}
-
+
private Map<String, String> getDriftServerPlugins() {
DriftServerPluginManager pluginMgr = getDriftServerPluginManager();
Map<String, String> plugins = new HashMap<String, String>();
@@ -362,9 +371,9 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
@Deprecated
public void setSystemConfiguration(Subject subject, Properties properties, boolean
skipValidation) throws Exception {
Map<String, String> map = toMap(properties);
-
+
transformToSystemSettingsFormat(map);
-
+
SystemSettings settings = SystemSettings.fromMap(map);
setSystemSettings(settings, skipValidation);
@@ -374,9 +383,9 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
public void validateSystemConfiguration(Subject subject, Properties properties)
throws InvalidSystemConfigurationException {
Map<String, String> map = toMap(properties);
-
+
transformToSystemSettingsFormat(map);
-
+
SystemSettings settings = SystemSettings.fromMap(map);
for (Map.Entry<SystemSetting, String> e : settings.entrySet()) {
SystemSetting prop = e.getKey();
@@ -389,7 +398,7 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
/**
* Call this to transform a system setting to a more appropriate value.
*/
- private String transformSystemConfigurationProperty(SystemSetting prop, String value,
boolean fromDb) {
+ private String transformSystemConfigurationProperty(SystemSetting prop, String value,
boolean fromDb) {
if (fromDb) {
// to support Oracle (whose booleans may be 1 or 0) transform the boolean
settings properly
switch (prop) {
@@ -414,13 +423,13 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
return Boolean.TRUE.toString();
}
}
- }
+ }
} else {
//toDB
//the 0,1 -> true false scenario is no problem here, because the values
are stored
//as string anyway (so no conversion is done). I assume the above is a
historical
//code that could be safely eliminated.
- switch(prop) {
+ switch (prop) {
case LDAP_BASED_JAAS_PROVIDER:
if (Boolean.parseBoolean(value)) {
return RHQConstants.LDAPJAASProvider;
@@ -435,7 +444,7 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
}
}
}
-
+
return value;
}
@@ -693,8 +702,7 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
public boolean isDebugModeEnabled() {
try {
Subject su = this.subjectManager.getOverlord();
- String setting = getSystemSettings(su).get(
- SystemSetting.DEBUG_MODE_ENABLED);
+ String setting =
getSystemSettings(su).get(SystemSetting.DEBUG_MODE_ENABLED);
if (setting == null) {
setting = "false";
}
@@ -707,8 +715,7 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
public boolean isExperimentalFeaturesEnabled() {
try {
Subject su = this.subjectManager.getOverlord();
- String setting = getSystemSettings(su).get(
- SystemSetting.EXPERIMENTAL_FEATURES_ENABLED);
+ String setting =
getSystemSettings(su).get(SystemSetting.EXPERIMENTAL_FEATURES_ENABLED);
if (setting == null) {
setting = "false";
}
@@ -733,7 +740,7 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
&& (((groupFilter != null) && groupFilter.trim().length()
> 0) || ((groupMember != null) && groupMember
.trim().length() > 0));
}
-
+
@RequiredPermission(Permission.MANAGE_SETTINGS)
public ServerDetails getServerDetails(Subject subject) {
CoreServerMBean coreServerMBean = LookupUtil.getCoreServer();