[rhq] modules/plugins
by Thomas Segismont
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java | 46 ++++++----
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java | 25 ++---
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerDiscovery.java | 10 --
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java | 2
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASDiscovery.java | 17 ---
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java | 17 ++-
6 files changed, 59 insertions(+), 58 deletions(-)
New commits:
commit 1d7b80e8beb26cfc457422894c9a9fa62e16d410
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Fri Oct 25 18:08:01 2013 +0200
Bug 1015665 - Remove bogus product name check
Introduced new pluginConfig property "expectedRuntimeProductName"
Will check this property while validating attributes
If a dependant plugin changes its product-name, it will be able to set this property in a discovery callback
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
index 876b1ac..85f409d 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
@@ -18,6 +18,8 @@
*/
package org.rhq.modules.plugins.jbossas7;
+import static java.lang.Boolean.FALSE;
+import static java.lang.Boolean.TRUE;
import static org.rhq.core.util.StringUtil.arrayToString;
import static org.rhq.core.util.StringUtil.isNotBlank;
@@ -205,6 +207,7 @@ public abstract class BaseProcessDiscovery implements ResourceDiscoveryComponent
String apiVersion = hostConfig.getDomainApiVersion();
JBossProductType productType = JBossProductType.determineJBossProductType(homeDir, apiVersion);
serverPluginConfig.setProductType(productType);
+ pluginConfig.setSimpleValue("expectedRuntimeProductName", productType.PRODUCT_NAME);
pluginConfig.setSimpleValue("hostXmlFileName", getHostXmlFileName(commandLine));
ProcessInfo agentProcess = discoveryContext.getSystemInformation().getThisProcess();
@@ -458,6 +461,7 @@ public abstract class BaseProcessDiscovery implements ResourceDiscoveryComponent
pluginConfig.put(new PropertySimple("manuallyAdded", true));
pluginConfig.put(new PropertySimple("productType",productType.name()));
+ pluginConfig.setSimpleValue("expectedRuntimeProductName", productType.PRODUCT_NAME);
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), key, name,
version, description, pluginConfig, null);
@@ -471,26 +475,36 @@ public abstract class BaseProcessDiscovery implements ResourceDiscoveryComponent
Configuration pluginConfiguration = inventoriedResource.getPluginConfiguration();
ServerPluginConfiguration serverPluginConfiguration = new ServerPluginConfiguration(pluginConfiguration);
- if (currentResourceKey.startsWith(LOCAL_RESOURCE_KEY_PREFIX)
- || currentResourceKey.startsWith(REMOTE_RESOURCE_KEY_PREFIX)) {
- // Resource key already in right format
- return null;
- }
-
ResourceUpgradeReport report = new ResourceUpgradeReport();
+ Boolean upgraded = FALSE;
+
+ if (!currentResourceKey.startsWith(LOCAL_RESOURCE_KEY_PREFIX)
+ && !currentResourceKey.startsWith(REMOTE_RESOURCE_KEY_PREFIX)) {
+ // Resource key in wrong format
+ upgraded = TRUE;
+ if (new File(currentResourceKey).isDirectory()) {
+ // Old key format for a local resource (key is base dir)
+ report.setNewResourceKey(createKeyForLocalResource(serverPluginConfiguration));
+ } else if (currentResourceKey.contains(":")) {
+ // Old key format for a remote (manually added) resource (key is base dir)
+ report.setNewResourceKey(createKeyForRemoteResource(currentResourceKey));
+ } else {
+ upgraded = FALSE;
+ log.warn("Unknown format, cannot upgrade resource key [" + currentResourceKey + "]");
+ }
+ }
- if (new File(currentResourceKey).isDirectory()) {
- // Old key format for a local resource (key is base dir)
- report.setNewResourceKey(createKeyForLocalResource(serverPluginConfiguration));
- } else if (currentResourceKey.contains(":")) {
- // Old key format for a remote (manually added) resource (key is base dir)
- report.setNewResourceKey(createKeyForRemoteResource(currentResourceKey));
- } else {
- log.warn("Unknown format, cannot upgrade resource key [" + currentResourceKey + "]");
- return null;
+ if (pluginConfiguration.getSimpleValue("expectedRuntimeProductName") == null) {
+ upgraded = TRUE;
+ pluginConfiguration.setSimpleValue("expectedRuntimeProductName",
+ serverPluginConfiguration.getProductType().PRODUCT_NAME);
+ report.setNewPluginConfiguration(pluginConfiguration);
}
- return report;
+ if (upgraded == TRUE) {
+ return report;
+ }
+ return null;
}
private String createKeyForRemoteResource(String hostPort) {
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
index 9c2a799..b226af0 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
@@ -45,7 +45,6 @@ import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
import org.rhq.core.pluginapi.availability.AvailabilityCollectorRunnable;
import org.rhq.core.pluginapi.availability.AvailabilityFacet;
-import org.rhq.core.pluginapi.component.ComponentInvocationContext;
import org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
@@ -205,22 +204,20 @@ public abstract class BaseServerComponent<T extends ResourceComponent<?>> extend
}
// Validate the product type (e.g. AS or EAP).
- JBossProductType runtimeType;
+ String expectedRuntimeProductName = pluginConfiguration.getSimpleValue("expectedRuntimeProductName");
try {
- String runtimeTypeString = readAttribute(getHostAddress(), "product-name");
- runtimeType = (runtimeTypeString != null && !runtimeTypeString.isEmpty()) ? JBossProductType
- .getValueByProductName(runtimeTypeString) : JBossProductType.AS;
- } catch (Exception e) {
- runtimeType = null;
- log.error("Failed to validate product type for " + getResourceDescription() + ".", e);
- }
- if (runtimeType != null) {
- JBossProductType type = serverPluginConfig.getProductType();
- if (runtimeType != type) {
+ String runtimeProductName = readAttribute(getHostAddress(), "product-name");
+ if (runtimeProductName == null || runtimeProductName.trim().isEmpty()) {
+ runtimeProductName = JBossProductType.AS.PRODUCT_NAME;
+ }
+ if (!runtimeProductName.equals(expectedRuntimeProductName)) {
throw new InvalidPluginConfigurationException(
- "The original product type discovered for this AS7 server was " + type
- + ", but the server is now reporting its product type is [" + runtimeType + "].");
+ "The original product type discovered for this server was " + expectedRuntimeProductName
+ + ", but the server is now reporting its product type is [" + runtimeProductName + "]");
}
+ } catch (Exception e) {
+ throw new InvalidPluginConfigurationException("Failed to validate product type for "
+ + getResourceDescription(), e);
}
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerDiscovery.java
index f4cbb40..92c9e31 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerDiscovery.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* 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.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7;
@@ -33,10 +33,6 @@ public class HostControllerDiscovery extends BaseProcessDiscovery {
private static final String DOMAIN_CONFIG_DIR_SYSPROP = "jboss.domain.config.dir";
private static final String DOMAIN_LOG_DIR_SYSPROP = "jboss.domain.log.dir";
- private static final String DEFAULT_HOST_CONFIG_FILE_NAME = "host.xml";
-
- private CommandLineOption HOST_CONFIG_OPTION = new CommandLineOption(null, "host-config");
-
@Override
protected AS7Mode getMode() {
return AS7Mode.DOMAIN;
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
index 05b72e3..fa73974 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JBossProductType.java
@@ -32,7 +32,7 @@ public enum JBossProductType {
AS("AS", "JBoss AS 7", "JBoss Application Server 7", "AS"),
EAP("EAP", "JBoss EAP 6", "JBoss Enterprise Application Platform 6", "EAP"),
- ISPN("ISPN", "Infinispan Server", "Infinispan Server", "ISPN"),
+ ISPN("ISPN", "Infinispan Server", "Infinispan Server", "Infinispan Server"),
JDG("JDG", "JBoss JDG 6", "JBoss Data Grid 6", "Data Grid"),
JPP("JPP", "JBoss JPP 6", "JBoss Portal Platform 6", "Portal Platform"),
SOA("SOA-P", "JBoss SOA-P 6", "Red Hat JBoss Fuse Service Works", "Red Hat JBoss Fuse Service Works"),
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASDiscovery.java
index 2978343..31ad026 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASDiscovery.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,13 +13,11 @@
* 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.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.core.system.ProcessInfo;
import org.rhq.modules.plugins.jbossas7.helper.HostPort;
@@ -76,15 +74,6 @@ public class StandaloneASDiscovery extends BaseProcessDiscovery {
}
@Override
- protected DiscoveredResourceDetails buildResourceDetails(ResourceDiscoveryContext discoveryContext,
- ProcessInfo process, AS7CommandLine commandLine) throws Exception {
-
- DiscoveredResourceDetails resourceDetails = super.buildResourceDetails(discoveryContext, process, commandLine);
-
- return resourceDetails;
- }
-
- @Override
protected ProcessInfo getPotentialStartScriptProcess(ProcessInfo process) {
// If the server was started via standalone.sh/bat, its parent process will be standalone.sh/bat.
return process.getParentProcess();
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java
index f34a554..6ff3d06 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractServerComponentTest.java
@@ -63,6 +63,7 @@ public abstract class AbstractServerComponentTest extends AbstractJBossAS7Plugin
static {
EAP6_VERSION_TO_AS7_VERSION_MAP.put("6.0.0", "7.1.2.Final-redhat-1");
EAP6_VERSION_TO_AS7_VERSION_MAP.put("6.0.1", "7.1.3.Final-redhat-4");
+ EAP6_VERSION_TO_AS7_VERSION_MAP.put("6.1.0", "7.2.0.Final-redhat-8");
}
private static final String RELEASE_VERSION_TRAIT_NAME = "_skm:release-version";
@@ -124,9 +125,13 @@ public abstract class AbstractServerComponentTest extends AbstractJBossAS7Plugin
Assert.assertNotNull(ipce, "InvalidPluginConfigurationException was not thrown by server component's "
+ "start() method due to invalid baseDir.");
- // Change the productType prop.
- JBossProductType originalProductType = serverPluginConfig.getProductType();
- serverPluginConfig.setProductType(originalProductType == JBossProductType.AS ? JBossProductType.EAP : JBossProductType.AS);
+ // Change the expectedRuntimeProductName property
+ String originalExpectedRuntimeProductName = pluginConfig.getSimpleValue("expectedRuntimeProductName");
+ if (originalExpectedRuntimeProductName.equals(JBossProductType.AS.PRODUCT_NAME)) {
+ pluginConfig.setSimpleValue("expectedRuntimeProductName", JBossProductType.EAP.PRODUCT_NAME);
+ } else {
+ pluginConfig.setSimpleValue("expectedRuntimeProductName", JBossProductType.AS.PRODUCT_NAME);
+ }
// Restart the server ResourceComponent so it picks up the changes we just made to the plugin config.
inventoryManager.deactivateResource(getServerResource());
@@ -137,9 +142,9 @@ public abstract class AbstractServerComponentTest extends AbstractJBossAS7Plugin
ipce = e;
}
- // Set the productType back to the original value and restart the component before making any assertions, to ensure
- // things aren't left in a corrupt state for remaining test methods.
- serverPluginConfig.setProductType(originalProductType);
+ // Set the expectedRuntimeProductName property back to the original value and restart the component before
+ // making any assertions, to ensure things aren't left in a corrupt state for remaining test methods.
+ pluginConfig.setSimpleValue("expectedRuntimeProductName", originalExpectedRuntimeProductName);
inventoryManager.activateResource(getServerResource(), serverContainer, true);
Assert.assertNotNull(ipce, "InvalidPluginConfigurationException was not thrown by server component's "
10 years, 7 months
[rhq] modules/plugins
by Jean-Frederic Clere
modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java | 46 ++++
modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml | 98 +++++++---
2 files changed, 112 insertions(+), 32 deletions(-)
New commits:
commit 7548d1752c8d518f43cf8b8deb496b793c9b1866
Author: Jean-Frederic Clere <jfclere(a)gmail.com>
Date: Fri Oct 25 17:57:38 2013 +0200
[BZ 956509] add storeconfig to EWS 2.0.1
diff --git a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java
index ab35743..98ce4fe 100644
--- a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java
+++ b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java
@@ -22,8 +22,6 @@
*/
package org.jboss.on.plugins.tomcat;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
import java.util.List;
import java.util.Set;
@@ -32,11 +30,12 @@ import org.apache.commons.logging.LogFactory;
import org.mc4j.ems.connection.EmsConnection;
import org.mc4j.ems.connection.bean.EmsBean;
import org.mc4j.ems.connection.bean.attribute.EmsAttribute;
-
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementReport;
@@ -264,6 +263,47 @@ public class TomcatConnectorComponent extends MBeanResourceComponent<TomcatServe
if (getResourceContext().getParentResourceComponent().getResourceContext().getVersion().startsWith("5")) {
report.getConfiguration().remove(CONFIG_V5_KEEP_ALIVE_TIMEOUT);
}
+
+ EmsBean bean = super.getEmsBean();
+ for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
+ EmsAttribute attribute = bean.getAttribute(key);
+ if (attribute == null) {
+ log.debug("Removing " + key + " does correspond to an attribut");
+ report.getConfiguration().remove(key);
+ continue; // skip unsupported attributes
+ }
+ PropertyDefinitionSimple def = configDef.getPropertyDefinitionSimple(key);
+ if (!def.isRequired()) {
+ PropertySimple prop = report.getConfiguration().getSimple(key);
+ if (prop instanceof PropertySimple) {
+ PropertySimple pro = (PropertySimple) prop;
+ if (pro.getStringValue() == null || (pro.getStringValue() != null && pro.getStringValue().equals("null"))) {
+ String p = context.getResourceType().getResourceConfigurationDefinition().getDefaultTemplate().getConfiguration().getSimpleValue(key);
+ log.debug("Using default value for " + key + " value: " + def.getDefaultValue());
+ switch (def.getType()) {
+ case INTEGER: {
+ pro.setIntegerValue(Integer.valueOf(p));
+ break;
+ }
+ case LONG: {
+ pro.setLongValue((long) Long.valueOf(p));
+ break;
+ }
+ case BOOLEAN: {
+ pro.setBooleanValue(Boolean.valueOf(p));
+ }
+ /* Other type are not used in storeconfig */
+ default:
+ if (p !=null)
+ pro.setStringValue(p);
+ else if (pro.getStringValue() != null)
+ pro.setStringValue(null);
+ break;
+ }
+ }
+ }
+ }
+ }
super.updateResourceConfiguration(report);
diff --git a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
index 2fd8931..74455a5 100644
--- a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
@@ -763,7 +763,8 @@
name="sharedExecutorName"
type="string"
description="If this Connector is configured to use a shared Executor for its thread pool, this is the name of that Executor. This is required to successfully collect threadpool metrics for the Connector. Leave this unset if the Connector is not using a shared Executor for its threadpool."
- required="false" />
+ required="false"
+ readOnly="true" />
</c:group>
<c:group
@@ -846,35 +847,45 @@
<c:simple-property
name="allowTrace"
type="boolean"
- description="A boolean value which can be used to enable or disable the TRACE HTTP method. If not specified, this attribute is set to false." />
+ description="A boolean value which can be used to enable or disable the TRACE HTTP method. If not specified, this attribute is set to false."
+ required="false"
+ default="false" />
<c:simple-property
name="connectionTimeout"
type="integer"
description="HTTP: The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be presented. The default value is 60000 (i.e. 60 seconds). AJP: The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be presented. The default value is infinite (i.e. no timeout)."
- required="false" />
+ required="false"
+ default="-1" />
<c:simple-property
name="emptySessionPath"
type="boolean"
description="If set to true, all paths for session cookies will be set to /. This can be useful for portlet specification implementations, but will greatly affect performance if many applications are accessed on a given server by the client. If not specified, this attribute is set to false. Note: Does not exist in Tomcat 7"
- required="false" />
+ required="false"
+ default="false" />
<c:simple-property
name="enableLookups"
type="boolean"
- description="Set to true if you want calls to request.getRemoteHost() to perform DNS lookups in order to return the actual host name of the remote client. Set to false to skip the DNS lookup and return the IP address in String form instead (thereby improving performance). By default, DNS lookups are enabled." />
+ description="Set to true if you want calls to request.getRemoteHost() to perform DNS lookups in order to return the actual host name of the remote client. Set to false to skip the DNS lookup and return the IP address in String form instead (thereby improving performance). By default, DNS lookups are enabled."
+ required="false"
+ default="false" />
<c:simple-property
name="keepAliveTimeout"
type="integer"
description="Ignored prior to Tomcat 6. HTTP: The number of milliseconds this Connector will wait for another HTTP request before closing the connection. The default value is to use the value that has been set for the connectionTimeout attribute. AJP: The number of milliseconds this Connector will wait for another AJP request before closing the connection. The default value is to use the value that has been set for the connectionTimeout attribute."
- required="false" />
+ required="false"
+ default="-1" />
<c:simple-property
name="maxPostSize"
type="integer"
- description="The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes)." />
+ description="The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes)."
+ required="false"
+ default="2097152" />
<c:simple-property
name="maxThreads"
type="integer"
description="HTTP: The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 40. If an executor is associated with this connector, this attribute is ignored as the connector will execute tasks using the executor rather than an internal thread pool. AJP: The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 200. If an executor is associated with this connector, this attribute is ignored as the connector will execute tasks using the executor rather than an internal thread pool."
- required="false" />
+ required="false"
+ default="200" />
<c:simple-property
name="protocol"
type="string"
@@ -888,11 +899,14 @@
name="proxyPort"
type="integer"
description="If this Connector is being used in a proxy configuration, configure this attribute to specify the server port to be returned for calls to request.getServerPort()."
- required="false" />
+ required="false"
+ default="0" />
<c:simple-property
name="redirectPort"
type="integer"
- description="If this Connector is supporting non-SSL requests, and a request is received for which a matching security-constraint requires SSL transport, Catalina will automatically redirect the request to the port number specified here." />
+ description="If this Connector is supporting non-SSL requests, and a request is received for which a matching security-constraint requires SSL transport, Catalina will automatically redirect the request to the port number specified here."
+ required="false"
+ default="0" />
<c:simple-property
name="scheme"
type="string"
@@ -902,82 +916,108 @@
name="secure"
type="boolean"
description="Set this attribute to true if you wish to have calls to request.isSecure() to return true for requests received by this Connector. You would want this on an SSL Connector or a non SSL connector that is receiving data from a SSL accelerator, like a crypto card, a SSL appliance or even a webserver. The default value is false"
- required="false" />
+ required="false"
+ default="false" />
<c:simple-property
name="tcpNoDelay"
displayName="TCP NoDelay"
type="boolean"
description="If set to true, the TCP_NO_DELAY option will be set on the server socket, which improves performance under most circumstances. This is set to true by default."
+ default="true"
required="false" />
<c:simple-property
name="URIEncoding"
displayName="URI Encoding"
type="string"
description="This specifies the character encoding used to decode the URI bytes, after %xx decoding the URL. If not specified, ISO-8859-1 will be used. "
- required="false" />
+ required="false"
+ default="ISO-8859-1" />
<c:simple-property
name="useBodyEncodingForURI"
displayName="Use Body Encoding for URI"
type="boolean"
- description="This specifies if the encoding specified in contentType should be used for URI query parameters, instead of using the URIEncoding. This setting is present for compatibility with Tomcat 4.1.x." />
+ description="This specifies if the encoding specified in contentType should be used for URI query parameters, instead of using the URIEncoding. This setting is present for compatibility with Tomcat 4.1.x."
+ default="false" />
<c:simple-property
name="xpoweredBy"
displayName="X-Powered-By"
type="boolean"
- description="Set this attribute to true to cause Tomcat to advertise support for the Servlet specification using the header recommended in the specification. The default value is false." />
- </c:group>
-
- <c:group name="HTTP" hiddenByDefault="true">
+ description="Set this attribute to true to cause Tomcat to advertise support for the Servlet specification using the header recommended in the specification. The default value is false."
+ required="false"
+ default="false" />
<c:simple-property
name="acceptCount"
type="integer"
description="The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 10."
- required="false" />
+ required="false"
+ default="100" />
<c:simple-property
- name="compression"
+ name="address"
type="string"
- description="The Connector may use HTTP/1.1 GZIP compression in an attempt to save server bandwidth. The acceptable values for the parameter is 'off' (disable compression), 'on' (allow compression, which causes text data to be compressed), 'force' (forces compression in all cases), or a numerical integer value (which is equivalent to 'on', but specifies the minimum amount of data before the output is compressed). If the content-length is not known and compression is set to 'on' or more aggressive, the output will also be compressed. If not specified, this attribute is set to 'off'."
- required="false" />
+ description="For servers with more than one IP address, this attribute specifies which address will be used for listening on the specified port. By default, this port will be used on all IP addresses associated with the server."
+ required="false" />
<c:simple-property
name="connectionLinger"
type="integer"
description="The number of milliseconds during which the sockets used by this Connector will linger when they are closed. (-1 socket linger is disabled)."
+ required="false"
+ default="-1" />
+ <c:simple-property
+ name="sharedExecutorName"
+ type="string"
+ description="If this Connector is configured to use a shared Executor for its thread pool, this is the name of that Executor. This is required to successfully collect threadpool metrics for the Connector. Leave this unset if the Connector is not using a shared Executor for its threadpool."
required="false" />
<c:simple-property
name="disableUploadTimeout"
type="boolean"
description="This flag allows the servlet container to use a different, longer connection timeout while a servlet is being executed, which in the end allows either the servlet a longer amount of time to complete its execution, or a longer timeout during data upload. If not specified, this attribute is set to true."
- required="false" />
+ required="false"
+ default="true" />
<c:simple-property
name="maxHttpHeaderSize"
type="integer"
description="The maximum size of the request and response HTTP header, specified in bytes. If not specified, this attribute is set to 4096 (4 KB)."
- required="false" />
+ required="false"
+ default="8192" />
<c:simple-property
name="maxKeepAliveRequests"
type="integer"
description="The maximum number of HTTP requests which can be pipelined until the connection is closed by the server. Setting this attribute to 1 will disable HTTP/1.0 keep-alive, as well as HTTP/1.1 keep-alive and pipelining. Setting this to -1 will allow an unlimited amount of pipelined or keep-alive HTTP requests. If not specified, this attribute is set to 100."
- required="false" />
+ required="false"
+ default="100" />
<c:simple-property
name="maxSpareThreads"
type="integer"
description="The maximum number of unused request processing threads that will be allowed to exist until the thread pool starts stopping the unnecessary threads. The default value is 50."
- required="false" />
+ required="false"
+ default="50" />
<c:simple-property
name="minSpareThreads"
type="integer"
description="The number of request processing threads that will be created when this Connector is first started. The connector will also make sure it has the specified number of idle processing threads available. This attribute should be set to a value smaller than that set for maxThreads. The default value is 4."
- required="false" />
+ required="false"
+ default="4" />
<c:simple-property
name="strategy"
type="string"
description="The thread pooling strategy which will be used. The default strategy does not use a master thread, but a more conventional strategy using a master listener thread can be used by setting 'ms' as this attribute's value. The master strategy will work significantly better using the threadPriority attribute, which will apply only to the thread which listens on the server socket. This is set to 'lf' by default."
- required="false" />
+ required="false"
+ default="lf" />
<c:simple-property
name="threadPriority"
type="integer"
description="The priority of the request processing threads within the JVM. The default value is java.lang.Thread#NORM_PRIORITY. See the JavaDoc for the java.lang.Thread class for more details on what this priority means."
- required="false" />
+ required="false"
+ default="5" />
+ </c:group>
+
+ <c:group name="HTTP" hiddenByDefault="true">
+ <c:simple-property
+ name="compression"
+ type="string"
+ description="The Connector may use HTTP/1.1 GZIP compression in an attempt to save server bandwidth. The acceptable values for the parameter is 'off' (disable compression), 'on' (allow compression, which causes text data to be compressed), 'force' (forces compression in all cases), or a numerical integer value (which is equivalent to 'on', but specifies the minimum amount of data before the output is compressed). If the content-length is not known and compression is set to 'on' or more aggressive, the output will also be compressed. If not specified, this attribute is set to 'off'."
+ required="false"
+ default="true" />
</c:group>
<c:group name="HTTP SSL" hiddenByDefault="true">
@@ -1260,4 +1300,4 @@
</server>
-</plugin>
\ No newline at end of file
+</plugin>
10 years, 7 months
[rhq] modules/helpers
by Heiko W. Rupp
modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java | 28 ++++++----
modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties | 6 +-
2 files changed, 21 insertions(+), 13 deletions(-)
New commits:
commit 5e2f32dc602a7ccd0f6f5363481a01d4ff0a8115
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Oct 25 14:37:30 2013 +0200
BZ 1012266 Use a random directory to work in.
diff --git a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java
index 6160643..7b2d891 100644
--- a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java
+++ b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java
@@ -43,6 +43,7 @@ import freemarker.template.TemplateException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.core.util.file.FileUtil;
import org.rhq.core.util.stream.StreamUtil;
/**
@@ -76,15 +77,20 @@ public class BundleGen {
String bundleTargetDirectory = "/tmp"; // TODO ask user?
- String tmpDirPath = System.getProperty("java.io.tmpdir");
- log.debug("Java Tmp dir is " + tmpDirPath);
- String genPath = tmpDirPath + "/" + "bundleGen";
- File tmpDir = new File(genPath); // TODO path separator
- if (!tmpDir.exists() && !tmpDir.mkdir()) {
- log.error(resourceBundle.getString("no.tmp.dir"));
- System.exit(1);
- }
+ File tmpDir = null;
+ try {
+ String tmpDirPath = System.getProperty("java.io.tmpdir");
+ tmpDir = FileUtil.createTempDirectory("bundle", null, new File(tmpDirPath));
+ tmpDir.setReadable(true);
+ tmpDir.setWritable(true);
+ tmpDir.setExecutable(true);
+ tmpDir.deleteOnExit();
+ } catch (IOException e) {
+ log.error(resourceBundle.getString("no.tmp.dir"));
+ System.exit(1);
+ }
+ String genPath = tmpDir.getAbsolutePath();
createFile(props,"deployMain","deploy.xml", genPath);
@@ -101,10 +107,12 @@ public class BundleGen {
File targetFile = new File(bundleTargetDirectory + "/" + "generatedBundle.zip");
boolean success = outFile.renameTo(targetFile);
- if (success)
+ if (success) {
+ targetFile.setReadable(true);
log.info(MessageFormat.format(resourceBundle.getString("bundle.ready"), targetFile.getAbsolutePath()));
+ }
else {
- log.debug("Could not rename file to ["+ targetFile.getAbsolutePath()+"]");
+ log.debug("Could not rename file to [" + targetFile.getAbsolutePath() + "]");
log.info(MessageFormat.format(resourceBundle.getString("bundle.ready"), outFile.getAbsolutePath()));
}
diff --git a/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties b/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties
index 867c63f..b4ddda7 100644
--- a/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties
+++ b/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties
@@ -1,5 +1,5 @@
-no.help.available=Hierfr gibt es leider keine Hilfe
+no.help.available=HierfÃŒr gibt es leider keine Hilfe
yes.no=(j/N)
-no.tmp.dir=Kann kein temporres Verzeichnis zum Schreiben erzeugen
-bundle.ready=Das Bundle ist in [{0}]\\ verfgbar
+no.tmp.dir=Kann kein temporÀres Verzeichnis zum Schreiben erzeugen
+bundle.ready=Das Bundle ist in [{0}] verfÃŒgbar
yes.key=j
\ No newline at end of file
10 years, 7 months
[rhq] Branch 'bug/1016175' - modules/core modules/enterprise
by Jiri Kremser
modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageClusterSettings.java | 2 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/admin/storage/ClusterConfigurationEditor.java | 17 ++++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
New commits:
commit 9c99d1a367b758a7030ad35446dc3a6b05b007f3
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Fri Oct 25 14:26:16 2013 +0200
Workaround to SmartGWT bug: password validators were changing the focus after each user input making it unusable
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageClusterSettings.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageClusterSettings.java
index 52b17b5..a2251fa 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageClusterSettings.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageClusterSettings.java
@@ -88,6 +88,6 @@ public class StorageClusterSettings implements Serializable {
@Override
public String toString() {
return "StorageClusterSettings[cqlPort=" + cqlPort + ", gossipPort=" + gossipPort + ", automaticDeployment="
- + automaticDeployment + ", username=" + username + ", passwordHash=********]";
+ + automaticDeployment + ", username (read-only)=" + username + ", passwordHash=********]";
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/admin/storage/ClusterConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/admin/storage/ClusterConfigurationEditor.java
index 6834c1b..18079e1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/admin/storage/ClusterConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/admin/storage/ClusterConfigurationEditor.java
@@ -147,7 +147,8 @@ public class ClusterConfigurationEditor extends EnhancedVLayout implements Refre
private void prepareForms() {
setWidth100();
- clusterForm = buildForm("<div align='left'><span style='font-family: Arial, Verdana, sans-serif !important;'><b>Cluster Settings</b></span><br/>On save, these setting will not be propagated to existing Storage"
+ clusterForm = buildForm("<div align='left'><span style='font-family: Arial, Verdana, sans-serif !important;'>"
+ + "<b>Cluster Settings</b></span><br/>On save, these setting will not be propagated to existing Storage"
+ " Nodes. Please review the documentation on how update the CQL and Gossip ports for all Storage Nodes.</div>");
List<FormItem> items = buildHeaderItems();
@@ -182,7 +183,8 @@ public class ClusterConfigurationEditor extends EnhancedVLayout implements Refre
items.addAll(gossipPortItems);
clusterForm.setFields(items.toArray(new FormItem[items.size()]));
- deploymentForm = buildForm("<div align='left'><span style='font-family: Arial, Verdana, sans-serif !important;'><b>Deployment Settings</b></span><br/>Only applies to new installations.</div>");
+ deploymentForm = buildForm("<div align='left'><span style='font-family: Arial, Verdana, sans-serif !important;'>"
+ + "<b>Deployment Settings</b></span><br/>Only applies to new installations.</div>");
FormItemBuilder.resetOddRow();
items = buildHeaderItems();
@@ -206,7 +208,8 @@ public class ClusterConfigurationEditor extends EnhancedVLayout implements Refre
items.addAll(automaticDeploymentItems);
deploymentForm.setFields(items.toArray(new FormItem[items.size()]));
- credentialsForm = buildForm("<div align='left'><span style='font-family: Arial, Verdana, sans-serif !important;'><b>Cluster Credentials</b></span><br/>Password changes are propagated to the Storage Cluster.</div>");
+ credentialsForm = buildForm("<div align='left'><span style='text-align: left; font-family: Arial, Verdana, sans-serif !important;'>"
+ + "<b>Cluster Credentials</b></span><br/>Password changes are propagated to the Storage Cluster.</div>");
FormItemBuilder.resetOddRow();
items = buildHeaderItems();
@@ -223,6 +226,9 @@ public class ClusterConfigurationEditor extends EnhancedVLayout implements Refre
// password field
StringLengthValidator passwordValidator1 = new StringLengthValidator(6, 100, false);
+ passwordValidator1.setErrorMessage("The password length must be at least 6 characters.");
+ // due to SmartGWT bug that changes focus after each input (https://code.google.com/p/smartgwt/issues/detail?id=309)
+ passwordValidator1.setValidateOnChange(false);
builder = new FormItemBuilder();
List<FormItem> passwordItems = builder
.withName(FIELD_PASSWORD)
@@ -237,9 +243,14 @@ public class ClusterConfigurationEditor extends EnhancedVLayout implements Refre
// password_verify field
builder = new FormItemBuilder();
+ passwordValidator1 = new StringLengthValidator(6, 100, false);
+ passwordValidator1.setErrorMessage("The password length must be at least 6 characters.");
MatchesFieldValidator passwordValidator2 = new MatchesFieldValidator();
passwordValidator2.setOtherField(FIELD_PASSWORD);
passwordValidator2.setErrorMessage("This should be the same string as in the Password field.");
+ // due to same bug in SmartGWT as above
+ passwordValidator1.setValidateOnChange(false);
+ passwordValidator2.setValidateOnChange(false);
List<FormItem> passwordVerifyItems = builder.withName(FIELD_PASSWORD_VERIFY).withTitle("Verify Password")
.withValue(settings.getPasswordHash()).withDescription("Validation (needs to match Password)")
.withReadOnlySetTo(readOnly).withValidators(passwordValidator1, passwordValidator2)
10 years, 7 months
[rhq] Branch 'release/jon3.2.x' - modules/enterprise
by Heiko W. Rupp
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 8e7dd7c8d8f7a5b337882ba3d3e1484bb9ce40bb
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Oct 24 22:46:51 2013 +0200
BZ 1012996 - create a "random" tmp directory for the drift files.
(cherry picked from commit fc417de310356c100710eeacf74fee41ce7bbe47)
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
index 5d149a1..3ab5da5 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
@@ -87,7 +87,7 @@ import org.rhq.enterprise.server.util.CriteriaQueryRunner;
/**
* The SLSB method implementation needed to support the JPA (RHQ Default) Drift Server Plugin.
- *
+ *
* @author Jay Shaughnessy
* @author John Sanda
*/
@@ -153,7 +153,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
JPADriftChangeSetCriteria jpaCriteria = (criteria instanceof JPADriftChangeSetCriteria) ? (JPADriftChangeSetCriteria) criteria
: new JPADriftChangeSetCriteria(criteria);
- // If looking for the initial change set make sure version is to to 0
+ // If looking for the initial change set make sure version is to to 0
if (criteria.getFilterCategory() != null && criteria.getFilterCategory() == COVERAGE) {
// If fetching Drifts then make sure we go through the DriftSet. Note that there is no guarantee
@@ -313,7 +313,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
// a List to be populated by storeChangeSetInNewTransaction for use in ackChangeSetInNewTransaction
List<JPADriftFile> driftFilesToRequest = new ArrayList<JPADriftFile>();
- // a 1 element array so storeChangeSetInNewTransaction can return the Headers for use in ackChangeSetInNewTransaction
+ // a 1 element array so storeChangeSetInNewTransaction can return the Headers for use in ackChangeSetInNewTransaction
Headers[] headers = new Headers[1];
DriftChangeSetSummary result = JPADriftServer.storeChangeSetInNewTransaction(subject, resourceId, changeSetZip,
@@ -482,7 +482,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
result = entityManager.find(JPADriftFile.class, sha256);
// if the JPADriftFile is not yet in the db then persist it, and mark it requested if content is to be fetched
// note - by immediately setting the initial status to REQUESTED we avoid a future update and a
- // potential deadlock scenario where the REQUESTED and LOADED status updates can happen simultaneously
+ // potential deadlock scenario where the REQUESTED and LOADED status updates can happen simultaneously
if (null == result) {
JPADriftFile driftFile = new JPADriftFile(sha256);
if (addToList) {
@@ -521,7 +521,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
String zipFileName = filesZip.getName();
File tmpDir = new File(System.getProperty("java.io.tmpdir"));
- File dir = new File(tmpDir, zipFileName.substring(0, zipFileName.indexOf(".")));
+ File dir = FileUtil.createTempDirectory(zipFileName.substring(0, zipFileName.indexOf(".")),null,tmpDir);
dir.mkdir();
ZipUtil.unzipFile(filesZip, dir);
10 years, 7 months
[rhq] modules/enterprise
by Heiko W. Rupp
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 7a3a9db23a17639e118d611b4e61c9abb8391b39
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Oct 24 22:46:51 2013 +0200
BZ 1012996
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
index 5d149a1..3ab5da5 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
@@ -87,7 +87,7 @@ import org.rhq.enterprise.server.util.CriteriaQueryRunner;
/**
* The SLSB method implementation needed to support the JPA (RHQ Default) Drift Server Plugin.
- *
+ *
* @author Jay Shaughnessy
* @author John Sanda
*/
@@ -153,7 +153,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
JPADriftChangeSetCriteria jpaCriteria = (criteria instanceof JPADriftChangeSetCriteria) ? (JPADriftChangeSetCriteria) criteria
: new JPADriftChangeSetCriteria(criteria);
- // If looking for the initial change set make sure version is to to 0
+ // If looking for the initial change set make sure version is to to 0
if (criteria.getFilterCategory() != null && criteria.getFilterCategory() == COVERAGE) {
// If fetching Drifts then make sure we go through the DriftSet. Note that there is no guarantee
@@ -313,7 +313,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
// a List to be populated by storeChangeSetInNewTransaction for use in ackChangeSetInNewTransaction
List<JPADriftFile> driftFilesToRequest = new ArrayList<JPADriftFile>();
- // a 1 element array so storeChangeSetInNewTransaction can return the Headers for use in ackChangeSetInNewTransaction
+ // a 1 element array so storeChangeSetInNewTransaction can return the Headers for use in ackChangeSetInNewTransaction
Headers[] headers = new Headers[1];
DriftChangeSetSummary result = JPADriftServer.storeChangeSetInNewTransaction(subject, resourceId, changeSetZip,
@@ -482,7 +482,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
result = entityManager.find(JPADriftFile.class, sha256);
// if the JPADriftFile is not yet in the db then persist it, and mark it requested if content is to be fetched
// note - by immediately setting the initial status to REQUESTED we avoid a future update and a
- // potential deadlock scenario where the REQUESTED and LOADED status updates can happen simultaneously
+ // potential deadlock scenario where the REQUESTED and LOADED status updates can happen simultaneously
if (null == result) {
JPADriftFile driftFile = new JPADriftFile(sha256);
if (addToList) {
@@ -521,7 +521,7 @@ public class JPADriftServerBean implements JPADriftServerLocal {
String zipFileName = filesZip.getName();
File tmpDir = new File(System.getProperty("java.io.tmpdir"));
- File dir = new File(tmpDir, zipFileName.substring(0, zipFileName.indexOf(".")));
+ File dir = FileUtil.createTempDirectory(zipFileName.substring(0, zipFileName.indexOf(".")),null,tmpDir);
dir.mkdir();
ZipUtil.unzipFile(filesZip, dir);
10 years, 7 months
[rhq] Branch 'release/jon3.2.x' - 2 commits - modules/enterprise modules/plugins
by John Sanda
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java | 1
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java | 14 ++--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java | 2
modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java | 29 +++++++++-
modules/plugins/rhq-storage/pom.xml | 7 ++
modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java | 17 +++++
modules/plugins/rhq-storage/src/main/resources/rhq-storage.properties | 2
7 files changed, 60 insertions(+), 12 deletions(-)
New commits:
commit efa81f784ae2b313b208c0818dd8a768f763a332
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Oct 24 21:23:51 2013 -0400
[BZ 1022775] get the compression time metric from MetricsServer
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java
index d08daef..7e1f6f2 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java
@@ -264,7 +264,6 @@ public class MeasurementCompressionManagerBean implements MeasurementCompression
watch.reset();
rows = insStmt.executeUpdate();
- MeasurementMonitor.getMBean().incrementMeasurementCompressionTime(watch.getElapsed());
} finally {
JDBCUtil.safeClose(conn, insStmt, null);
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
index 93feca3..f36840c 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
@@ -24,6 +24,7 @@ import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ejb.ConcurrencyManagement;
import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Singleton;
import javax.ejb.Startup;
@@ -34,8 +35,10 @@ import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
import org.rhq.core.util.ObjectNameFactory;
+import org.rhq.enterprise.server.storage.StorageClientManagerBean;
import org.rhq.enterprise.server.util.JMXUtil;
import org.rhq.enterprise.server.util.LookupUtil;
+import org.rhq.server.metrics.MetricsServer;
/**
* @author Greg Hinkle
@@ -48,6 +51,9 @@ import org.rhq.enterprise.server.util.LookupUtil;
public class MeasurementMonitor implements MeasurementMonitorMBean {
private static final ObjectName OBJECT_NAME = ObjectNameFactory.create("rhq:service=MeasurementMonitor");
+ @EJB
+ private StorageClientManagerBean storageClientManager;
+
private AtomicLong measurementInsertTime = new AtomicLong();
private AtomicLong measurementsInserted = new AtomicLong();
@@ -64,8 +70,6 @@ public class MeasurementMonitor implements MeasurementMonitorMBean {
private AtomicLong fullAvailabilityReports = new AtomicLong();
- private AtomicLong compressionTime = new AtomicLong();
-
private AtomicLong purgeTime = new AtomicLong();
private AtomicLong baselineCalculationTime = new AtomicLong();
@@ -179,11 +183,7 @@ public class MeasurementMonitor implements MeasurementMonitorMBean {
}
public long getMeasurementCompressionTime() {
- return compressionTime.get();
- }
-
- public void incrementMeasurementCompressionTime(long delta) {
- this.compressionTime.addAndGet(delta);
+ return storageClientManager.getMetricsServer().getTotalAggregationTime();
}
public long getPurgeTime() {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java
index df7b05c..f3d5a1e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java
@@ -47,8 +47,6 @@ public interface MeasurementMonitorMBean {
long getMeasurementCompressionTime();
- void incrementMeasurementCompressionTime(long delta);
-
long getBaselineCalculationTime();
void incrementBaselineCalculationTime(long delta);
diff --git a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
index 886155f..bcb77df 100644
--- a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
+++ b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
@@ -33,10 +33,13 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
+import com.google.common.base.Stopwatch;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
@@ -74,6 +77,8 @@ public class MetricsServer {
private Long mostRecentRawDataPriorToStartup;
+ private AtomicLong totalAggregationTime = new AtomicLong();
+
public void setDAO(MetricsDAO dao) {
this.dao = dao;
}
@@ -142,6 +147,14 @@ public class MetricsServer {
return dao.findLatestRawMetric(scheduleId);
}
+ /**
+ * @return The total aggregation time in milliseconds since server start. This property is updated after each of
+ * raw, one hour, and six hour data are aggregated.
+ */
+ public long getTotalAggregationTime() {
+ return totalAggregationTime.get();
+ }
+
public Iterable<MeasurementDataNumericHighLowComposite> findDataForResource(int scheduleId, long beginTime,
long endTime, int numberOfBuckets) {
@@ -391,7 +404,7 @@ public class MetricsServer {
}
}
- private Iterable<AggregateNumericMetric> calculateAggregates(long startTime) {
+ private List<AggregateNumericMetric> calculateAggregates(long startTime) {
DateTime dt = new DateTime(startTime);
DateTime currentHour = dateTimeService.getTimeSlice(dt, configuration.getRawTimeSliceDuration());
DateTime lastHour = currentHour.minus(configuration.getRawTimeSliceDuration());
@@ -419,15 +432,20 @@ public class MetricsServer {
// The last step in the work flow is to update the metrics
// index for the newly persisted aggregates.
- Iterable<AggregateNumericMetric> newOneHourAggregates = null;
+ List<AggregateNumericMetric> newOneHourAggregates = null;
+ Stopwatch stopwatch = new Stopwatch().start();
List<AggregateNumericMetric> updatedSchedules = aggregateRawData(lastHour);
newOneHourAggregates = updatedSchedules;
if (!updatedSchedules.isEmpty()) {
dao.deleteMetricsIndexEntries(MetricsTable.ONE_HOUR, lastHour.getMillis());
updateMetricsIndex(MetricsTable.SIX_HOUR, updatedSchedules, configuration.getOneHourTimeSliceDuration());
}
+ stopwatch.stop();
+ totalAggregationTime.addAndGet(stopwatch.elapsed(TimeUnit.MILLISECONDS));
+ stopwatch.reset();
+ stopwatch.start();
updatedSchedules = calculateAggregates(MetricsTable.ONE_HOUR, MetricsTable.SIX_HOUR, sixHourTimeSlice,
configuration.getOneHourTimeSliceDuration());
if (!updatedSchedules.isEmpty()) {
@@ -435,12 +453,19 @@ public class MetricsServer {
updateMetricsIndex(MetricsTable.TWENTY_FOUR_HOUR, updatedSchedules,
configuration.getSixHourTimeSliceDuration());
}
+ stopwatch.stop();
+ totalAggregationTime.addAndGet(stopwatch.elapsed(TimeUnit.MILLISECONDS));
+ stopwatch.reset();
+ stopwatch.start();
updatedSchedules = calculateAggregates(MetricsTable.SIX_HOUR, MetricsTable.TWENTY_FOUR_HOUR,
twentyFourHourTimeSlice, configuration.getSixHourTimeSliceDuration());
if (!updatedSchedules.isEmpty()) {
dao.deleteMetricsIndexEntries(MetricsTable.TWENTY_FOUR_HOUR, twentyFourHourTimeSlice);
}
+ stopwatch.stop();
+ totalAggregationTime.addAndGet(stopwatch.elapsed(TimeUnit.MILLISECONDS));
+ stopwatch.reset();
return newOneHourAggregates;
}
commit d2248f965a5db3be7c533f29377ebda41d14121f
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Oct 24 21:21:27 2013 -0400
[BZ 1021660] set the version and description fields during discovery
diff --git a/modules/plugins/rhq-storage/pom.xml b/modules/plugins/rhq-storage/pom.xml
index 2aad5b4..a79a3bf 100644
--- a/modules/plugins/rhq-storage/pom.xml
+++ b/modules/plugins/rhq-storage/pom.xml
@@ -85,6 +85,13 @@
</dependencies>
<build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
diff --git a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java
index c0f7b6c..d07118d 100644
--- a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java
+++ b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java
@@ -22,9 +22,14 @@
*/
package org.rhq.plugins.storage;
+import java.io.IOException;
import java.util.HashSet;
+import java.util.Properties;
import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.resource.ResourceUpgradeReport;
@@ -38,6 +43,8 @@ import org.rhq.plugins.cassandra.CassandraNodeDiscoveryComponent;
*/
public class StorageNodeDiscoveryComponent extends CassandraNodeDiscoveryComponent {
+ private final Log log = LogFactory.getLog(StorageNodeDiscoveryComponent.class);
+
private static final String RESOURCE_NAME = "RHQ Storage Node";
@SuppressWarnings({ "rawtypes" })
@@ -57,6 +64,16 @@ public class StorageNodeDiscoveryComponent extends CassandraNodeDiscoveryCompone
discoveredResource.setResourceKey(resourceKey);
discoveredResource.setResourceName(resourceName);
+ try {
+ Properties properties = new Properties();
+ properties.load(getClass().getResourceAsStream("/rhq-storage.properties"));
+
+ discoveredResource.setResourceDescription(properties.getProperty("rhq.storage.description"));
+ discoveredResource.setResourceVersion(properties.getProperty("rhq.storage.version"));
+ } catch (IOException e) {
+ log.warn("Failed to load rhq-storage.properties. Some resource details will not be set.", e);
+ }
+
storageNodes.add(discoveredResource);
}
}
diff --git a/modules/plugins/rhq-storage/src/main/resources/rhq-storage.properties b/modules/plugins/rhq-storage/src/main/resources/rhq-storage.properties
new file mode 100644
index 0000000..7a5733c
--- /dev/null
+++ b/modules/plugins/rhq-storage/src/main/resources/rhq-storage.properties
@@ -0,0 +1,2 @@
+rhq.storage.description=RHQ Storage Node
+rhq.storage.version=${project.version}
\ No newline at end of file
10 years, 7 months
[rhq] 2 commits - modules/enterprise modules/plugins
by John Sanda
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java | 1
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java | 14 ++--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java | 2
modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java | 29 +++++++++-
modules/plugins/rhq-storage/pom.xml | 7 ++
modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java | 17 +++++
modules/plugins/rhq-storage/src/main/resources/rhq-storage.properties | 2
7 files changed, 60 insertions(+), 12 deletions(-)
New commits:
commit d3917363da8cb7cda1500ee7f195c7b1a333650d
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Oct 24 21:23:51 2013 -0400
[BZ 1022775] get the compression time metric from MetricsServer
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java
index d08daef..7e1f6f2 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementCompressionManagerBean.java
@@ -264,7 +264,6 @@ public class MeasurementCompressionManagerBean implements MeasurementCompression
watch.reset();
rows = insStmt.executeUpdate();
- MeasurementMonitor.getMBean().incrementMeasurementCompressionTime(watch.getElapsed());
} finally {
JDBCUtil.safeClose(conn, insStmt, null);
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
index 93feca3..f36840c 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
@@ -24,6 +24,7 @@ import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ejb.ConcurrencyManagement;
import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Singleton;
import javax.ejb.Startup;
@@ -34,8 +35,10 @@ import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
import org.rhq.core.util.ObjectNameFactory;
+import org.rhq.enterprise.server.storage.StorageClientManagerBean;
import org.rhq.enterprise.server.util.JMXUtil;
import org.rhq.enterprise.server.util.LookupUtil;
+import org.rhq.server.metrics.MetricsServer;
/**
* @author Greg Hinkle
@@ -48,6 +51,9 @@ import org.rhq.enterprise.server.util.LookupUtil;
public class MeasurementMonitor implements MeasurementMonitorMBean {
private static final ObjectName OBJECT_NAME = ObjectNameFactory.create("rhq:service=MeasurementMonitor");
+ @EJB
+ private StorageClientManagerBean storageClientManager;
+
private AtomicLong measurementInsertTime = new AtomicLong();
private AtomicLong measurementsInserted = new AtomicLong();
@@ -64,8 +70,6 @@ public class MeasurementMonitor implements MeasurementMonitorMBean {
private AtomicLong fullAvailabilityReports = new AtomicLong();
- private AtomicLong compressionTime = new AtomicLong();
-
private AtomicLong purgeTime = new AtomicLong();
private AtomicLong baselineCalculationTime = new AtomicLong();
@@ -179,11 +183,7 @@ public class MeasurementMonitor implements MeasurementMonitorMBean {
}
public long getMeasurementCompressionTime() {
- return compressionTime.get();
- }
-
- public void incrementMeasurementCompressionTime(long delta) {
- this.compressionTime.addAndGet(delta);
+ return storageClientManager.getMetricsServer().getTotalAggregationTime();
}
public long getPurgeTime() {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java
index df7b05c..f3d5a1e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java
@@ -47,8 +47,6 @@ public interface MeasurementMonitorMBean {
long getMeasurementCompressionTime();
- void incrementMeasurementCompressionTime(long delta);
-
long getBaselineCalculationTime();
void incrementBaselineCalculationTime(long delta);
diff --git a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
index d13106f..f030ce7 100644
--- a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
+++ b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
@@ -33,10 +33,13 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
+import com.google.common.base.Stopwatch;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
@@ -74,6 +77,8 @@ public class MetricsServer {
private Long mostRecentRawDataPriorToStartup;
+ private AtomicLong totalAggregationTime = new AtomicLong();
+
public void setDAO(MetricsDAO dao) {
this.dao = dao;
}
@@ -142,6 +147,14 @@ public class MetricsServer {
return dao.findLatestRawMetric(scheduleId);
}
+ /**
+ * @return The total aggregation time in milliseconds since server start. This property is updated after each of
+ * raw, one hour, and six hour data are aggregated.
+ */
+ public long getTotalAggregationTime() {
+ return totalAggregationTime.get();
+ }
+
public Iterable<MeasurementDataNumericHighLowComposite> findDataForResource(int scheduleId, long beginTime,
long endTime, int numberOfBuckets) {
@@ -391,7 +404,7 @@ public class MetricsServer {
}
}
- private Iterable<AggregateNumericMetric> calculateAggregates(long startTime) {
+ private List<AggregateNumericMetric> calculateAggregates(long startTime) {
DateTime dt = new DateTime(startTime);
DateTime currentHour = dateTimeService.getTimeSlice(dt, configuration.getRawTimeSliceDuration());
DateTime lastHour = currentHour.minus(configuration.getRawTimeSliceDuration());
@@ -419,15 +432,20 @@ public class MetricsServer {
// The last step in the work flow is to update the metrics
// index for the newly persisted aggregates.
- Iterable<AggregateNumericMetric> newOneHourAggregates = null;
+ List<AggregateNumericMetric> newOneHourAggregates = null;
+ Stopwatch stopwatch = new Stopwatch().start();
List<AggregateNumericMetric> updatedSchedules = aggregateRawData(lastHour);
newOneHourAggregates = updatedSchedules;
if (!updatedSchedules.isEmpty()) {
dao.deleteMetricsIndexEntries(MetricsTable.ONE_HOUR, lastHour.getMillis());
updateMetricsIndex(MetricsTable.SIX_HOUR, updatedSchedules, configuration.getOneHourTimeSliceDuration());
}
+ stopwatch.stop();
+ totalAggregationTime.addAndGet(stopwatch.elapsed(TimeUnit.MILLISECONDS));
+ stopwatch.reset();
+ stopwatch.start();
updatedSchedules = calculateAggregates(MetricsTable.ONE_HOUR, MetricsTable.SIX_HOUR, sixHourTimeSlice,
configuration.getOneHourTimeSliceDuration());
if (!updatedSchedules.isEmpty()) {
@@ -435,12 +453,19 @@ public class MetricsServer {
updateMetricsIndex(MetricsTable.TWENTY_FOUR_HOUR, updatedSchedules,
configuration.getSixHourTimeSliceDuration());
}
+ stopwatch.stop();
+ totalAggregationTime.addAndGet(stopwatch.elapsed(TimeUnit.MILLISECONDS));
+ stopwatch.reset();
+ stopwatch.start();
updatedSchedules = calculateAggregates(MetricsTable.SIX_HOUR, MetricsTable.TWENTY_FOUR_HOUR,
twentyFourHourTimeSlice, configuration.getSixHourTimeSliceDuration());
if (!updatedSchedules.isEmpty()) {
dao.deleteMetricsIndexEntries(MetricsTable.TWENTY_FOUR_HOUR, twentyFourHourTimeSlice);
}
+ stopwatch.stop();
+ totalAggregationTime.addAndGet(stopwatch.elapsed(TimeUnit.MILLISECONDS));
+ stopwatch.reset();
return newOneHourAggregates;
}
commit 7e9a84a8c22aa3725b5d38bc4761a89cc85017a5
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Oct 24 21:21:27 2013 -0400
[BZ 1021660] set the version and description fields during discovery
diff --git a/modules/plugins/rhq-storage/pom.xml b/modules/plugins/rhq-storage/pom.xml
index bf3eabd..885ab14 100644
--- a/modules/plugins/rhq-storage/pom.xml
+++ b/modules/plugins/rhq-storage/pom.xml
@@ -85,6 +85,13 @@
</dependencies>
<build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
diff --git a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java
index c0f7b6c..d07118d 100644
--- a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java
+++ b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeDiscoveryComponent.java
@@ -22,9 +22,14 @@
*/
package org.rhq.plugins.storage;
+import java.io.IOException;
import java.util.HashSet;
+import java.util.Properties;
import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.resource.ResourceUpgradeReport;
@@ -38,6 +43,8 @@ import org.rhq.plugins.cassandra.CassandraNodeDiscoveryComponent;
*/
public class StorageNodeDiscoveryComponent extends CassandraNodeDiscoveryComponent {
+ private final Log log = LogFactory.getLog(StorageNodeDiscoveryComponent.class);
+
private static final String RESOURCE_NAME = "RHQ Storage Node";
@SuppressWarnings({ "rawtypes" })
@@ -57,6 +64,16 @@ public class StorageNodeDiscoveryComponent extends CassandraNodeDiscoveryCompone
discoveredResource.setResourceKey(resourceKey);
discoveredResource.setResourceName(resourceName);
+ try {
+ Properties properties = new Properties();
+ properties.load(getClass().getResourceAsStream("/rhq-storage.properties"));
+
+ discoveredResource.setResourceDescription(properties.getProperty("rhq.storage.description"));
+ discoveredResource.setResourceVersion(properties.getProperty("rhq.storage.version"));
+ } catch (IOException e) {
+ log.warn("Failed to load rhq-storage.properties. Some resource details will not be set.", e);
+ }
+
storageNodes.add(discoveredResource);
}
}
diff --git a/modules/plugins/rhq-storage/src/main/resources/rhq-storage.properties b/modules/plugins/rhq-storage/src/main/resources/rhq-storage.properties
new file mode 100644
index 0000000..7a5733c
--- /dev/null
+++ b/modules/plugins/rhq-storage/src/main/resources/rhq-storage.properties
@@ -0,0 +1,2 @@
+rhq.storage.description=RHQ Storage Node
+rhq.storage.version=${project.version}
\ No newline at end of file
10 years, 7 months
[rhq] Branch 'release/jon3.2.x' - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 43f068a8b4e50f7dd0e86595cb71ca8556957c5d
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Oct 24 14:14:30 2013 -0700
[BZ 1017434] - Compare Metrics Broken for Group Metrics (gives 404). Due to portal.war naming changes with BZ 1000065.
(cherry picked from commit dee3ffc6ded7eab40f9df77ba030ef1ab27ee9d1)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
index 86b6065..8a9eda6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
@@ -78,7 +78,7 @@ public class GroupMembersHealthView extends MembersView {
}
//build portal.war chart page to iFrame
- String destination = "/resource/common/monitor/Visibility.do?mode=compareMetrics&&groupId=" + groupId;
+ String destination = "/portal/resource/common/monitor/Visibility.do?mode=compareMetrics&&groupId=" + groupId;
for (int rId : resourceIds) {
destination += "&r=" + rId;
}
10 years, 7 months
[rhq] modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit dee3ffc6ded7eab40f9df77ba030ef1ab27ee9d1
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Oct 24 14:14:30 2013 -0700
[BZ 1017434] - Compare Metrics Broken for Group Metrics (gives 404). Due to portal.war naming changes with BZ 1000065.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
index 86b6065..8a9eda6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/inventory/groups/detail/monitoring/table/GroupMembersHealthView.java
@@ -78,7 +78,7 @@ public class GroupMembersHealthView extends MembersView {
}
//build portal.war chart page to iFrame
- String destination = "/resource/common/monitor/Visibility.do?mode=compareMetrics&&groupId=" + groupId;
+ String destination = "/portal/resource/common/monitor/Visibility.do?mode=compareMetrics&&groupId=" + groupId;
for (int rId : resourceIds) {
destination += "&r=" + rId;
}
10 years, 7 months