[rhq] 3 commits - modules/enterprise
by Heiko W. Rupp
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java | 24 ++++++++--
modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl | 2
modules/enterprise/server/jar/src/main/resources/rest_templates/group.ftl | 2
modules/enterprise/server/jar/src/main/resources/rest_templates/groupDefinition.ftl | 2
modules/enterprise/server/jar/src/main/resources/rest_templates/metricDefinition.ftl | 2
modules/enterprise/server/jar/src/main/resources/rest_templates/metricSchedule.ftl | 2
modules/enterprise/server/jar/src/main/resources/rest_templates/reportIndex.ftl | 2
modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl | 14 ++---
8 files changed, 34 insertions(+), 16 deletions(-)
New commits:
commit d8058d49522a9e9c0fa3e75cbc59ec3589f9f423
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jun 4 14:58:55 2013 +0200
BZ 970592 make sure resourceId and scheduleId are rendered in decimal
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl
index 42d5385..462ae98 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl
@@ -55,4 +55,4 @@
<a href="/rest/alert/${var.id?c}/definition.html">Alert Definition</a>
<a href="/rest/alert/${var.id?c}/conditions.html">Condition Logs</a>
<a href="/rest/alert/${var.id?c}/notifications.html">Notification Logs</a>
-<a href="/rest/resource/${var.resource.getResourceId()}.html">Resource</a>
\ No newline at end of file
+<a href="/rest/resource/${var.resource.getResourceId()?c}.html">Resource</a>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/group.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/group.ftl
index f74f545..a7b58b4 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/group.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/group.ftl
@@ -38,7 +38,7 @@
</tr>
<#if var.resourceTypeId??>
<tr>
- <td>ResourceType id</td><td></td>
+ <td>ResourceType id</td><td>${var.resourceTypeId?c}</td>
</tr>
</#if>
<tr>
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/groupDefinition.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/groupDefinition.ftl
index 14fa596..2aae342 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/groupDefinition.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/groupDefinition.ftl
@@ -31,7 +31,7 @@
<td>Name</td><td>${var.name}</td>
</tr>
<tr>
- <td>Id</td><td>${var.id}</td>
+ <td>Id</td><td>${var.id?c}</td>
</tr>
<tr>
<td>Description</td><td>${var.description}</td>
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/metricDefinition.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/metricDefinition.ftl
index df277e1..ee63ba9 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/metricDefinition.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/metricDefinition.ftl
@@ -26,7 +26,7 @@
<th>Name</th><th>Value</th>
</tr>
<tr>
- <td>Id</td><td>${var.scheduleId}</td>
+ <td>Id</td><td>${var.scheduleId?c}</td>
</tr>
<tr>
<td>Internal Name</td><td>${var.scheduleName}</td>
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/metricSchedule.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/metricSchedule.ftl
index ae7b559..bb41d67 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/metricSchedule.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/metricSchedule.ftl
@@ -26,7 +26,7 @@
<th>Name</th><th>Value</th>
</tr>
<tr>
- <td>Id</td><td>${var.scheduleId}</td>
+ <td>Id</td><td>${var.scheduleId?c}</td>
</tr>
<tr>
<td>Internal Name</td><td>${var.scheduleName}</td>
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
index 523a34f..c9d1722 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
@@ -29,7 +29,7 @@
<td>Name</td><td>${var.resourceName}</td>
</tr>
<tr>
- <td>Id</td><td><a href="/rest/resource/${var.resourceId}.html">${var.resourceId}</a></td>
+ <td>Id</td><td><a href="/rest/resource/${var.resourceId?c}.html">${var.resourceId?c}</a></td>
</tr>
<tr>
<td>Type name</td><td>${var.typeName}</td>
@@ -46,9 +46,9 @@
</tr>
</#if>
</table>
- <a href="/rest/resource/${var.resourceId}/children.html">Children</a><br/>
- <a href="/rest/resource/${var.resourceId}/schedules.html">Schedules</a><br/>
- <a href="/rest/resource/${var.resourceId}/availability.html">Current availability</a><br/>
- <a href="/rest/resource/${var.resourceId}/availability/history.html">Availability History</a><br/>
- <a href="/rest/alert.html?resourceId=${var.resourceId}">Up to 20 Alerts for this resource</a><br/>
- <a href="/rest/operation/history.html?resourceId=${var.resourceId}">Operations history</a>
+ <a href="/rest/resource/${var.resourceId?c}/children.html">Children</a><br/>
+ <a href="/rest/resource/${var.resourceId?c}/schedules.html">Schedules</a><br/>
+ <a href="/rest/resource/${var.resourceId?c}/availability.html">Current availability</a><br/>
+ <a href="/rest/resource/${var.resourceId?c}/availability/history.html">Availability History</a><br/>
+ <a href="/rest/alert.html?resourceId=${var.resourceId?c}">Up to 20 Alerts for this resource</a><br/>
+ <a href="/rest/operation/history.html?resourceId=${var.resourceId?c}">Operations history</a>
commit a737bc574bbb7f0ae0adf0390ed1803a11887a0d
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jun 4 14:58:03 2013 +0200
BZ 970593 do not prepend the links with /rest
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/reportIndex.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/reportIndex.ftl
index 4ed802e..82e8726 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/reportIndex.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/reportIndex.ftl
@@ -26,7 +26,7 @@
<ul>
<#list var as var>
<li>
- <a href="/rest/${var.href}.csv">${var.rel}</a>
+ <a href="${var.href}.csv">${var.rel}</a>
</li>
</#list>
</ul>
commit 764f68b56741816ddded326f4b2001bca90fbebe
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jun 4 14:30:40 2013 +0200
BZ 970517 - return a message that LDAP users need to register first.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java
index 1099679..4dff5ad 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/CustomExceptionMapper.java
@@ -18,6 +18,8 @@
*/
package org.rhq.enterprise.server.rest;
+import java.lang.reflect.UndeclaredThrowableException;
+
import javax.ejb.EJBException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
@@ -52,6 +54,7 @@ public class CustomExceptionMapper implements ExceptionMapper<Exception> {
Response.ResponseBuilder builder;
Response.Status status;
+ String message = null;
if (e instanceof StuffNotFoundException) {
status =Response.Status.NOT_FOUND;
@@ -67,14 +70,29 @@ public class CustomExceptionMapper implements ExceptionMapper<Exception> {
status = Response.Status.NOT_ACCEPTABLE;
} else if (e instanceof PermissionException) {
status = Response.Status.FORBIDDEN;
- } else if (e instanceof EJBException && e.getCause()!=null && e.getCause() instanceof IllegalArgumentException) {
- status = Response.Status.NOT_ACCEPTABLE;
+ } else if (e instanceof EJBException && e.getCause()!=null) {
+ Throwable cause = e.getCause();
+ if (cause instanceof IllegalArgumentException) {
+ status = Response.Status.NOT_ACCEPTABLE;
+ } else if (cause instanceof UndeclaredThrowableException ) {
+ if (cause.getCause() != null && cause.getCause() instanceof IllegalAccessException) {
+ status = Response.Status.FORBIDDEN;
+ message = "User was authorized, but has no rights for the operation."+
+ " If this is an LDAP user, the user needs to log in to the UI and complete registration.";
+ } else {
+ status = Response.Status.SERVICE_UNAVAILABLE;
+ }
+ } else {
+ status = Response.Status.SERVICE_UNAVAILABLE;
+ }
} else {
status = Response.Status.SERVICE_UNAVAILABLE;
}
builder = Response.status(status);
- String message = e.getMessage();
+ if (message == null) {
+ message = e.getMessage();
+ }
wrapMessage(builder, message);
return builder.build();
}
11 years
[rhq] modules/common
by John Sanda
modules/common/cassandra-schema/src/main/resources/topology/0001.xml | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
New commits:
commit 99770bd1b3b6a252a4eb090971bbe9159524f505
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Jun 3 21:14:28 2013 -0400
do not update the system schema directly
The changes to update the replication_factor do not get applied when directly
updating the system.schema_keyspaces table. The actual RowMutation to make the
schema change against the respective column is never generated and applied via
MigrationManager.
diff --git a/modules/common/cassandra-schema/src/main/resources/topology/0001.xml b/modules/common/cassandra-schema/src/main/resources/topology/0001.xml
index f4382dc..cbae01f 100644
--- a/modules/common/cassandra-schema/src/main/resources/topology/0001.xml
+++ b/modules/common/cassandra-schema/src/main/resources/topology/0001.xml
@@ -1,13 +1,9 @@
<updatePlan>
<step>
- UPDATE system.schema_keyspaces SET
- strategy_options='{"replication_factor":"%s"}'
- WHERE keyspace_name='rhq'
+ ALTER KEYSPACE rhq WITH replication = {'class': 'SimpleStrategy', 'replication_factor': %s};
</step>
<step>
- UPDATE system.schema_keyspaces SET
- strategy_options='{"replication_factor":"%s"}'
- WHERE keyspace_name='system_auth'
+ ALTER KEYSPACE system_auth WITH replication = {'class': 'SimpleStrategy', 'replication_factor': %s};
</step>
</updatePlan>
\ No newline at end of file
11 years
[rhq] modules/enterprise
by mazz
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java | 62
modules/enterprise/server/server-control/src/main/resources/agent-configuration.xml | 1101 ----------
2 files changed, 37 insertions(+), 1126 deletions(-)
New commits:
commit 87d03beb500145c7526066294a25cb2362151ac3
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Jun 3 17:44:36 2013 -0400
* do not maintain a second agent-config .xml file for fear we will go out of sync over time (as proof, we've already diverged from the main agent xml copy).
* do not clean the top rhq-agent pref node - that will purge everything and could effect other agents running with non-default nodes (we use this for agentcopy/agetnspawn for example) - just purge the rhq-agent/default node since we'll install using that as the default
* fallback to the agent to determine its default server binding address to use - this allows the agent to do its default behavior (which uses the "rhqserver" DNS alias or, if that is unknown, using the local canonical host as a fallback)
* do not purge the security token, if one exists - this lets us (poorly) do upgrades as well as do a clean install - problem is if its an upgrade, we should still keep all settings. We should consider not doing clearAgentPreferences() in org.rhq.server.control.command.Install
diff --git a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
index d6b6156..eb39b3e 100644
--- a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
+++ b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
@@ -26,21 +26,15 @@
package org.rhq.server.control.command;
import java.io.BufferedReader;
-import java.io.BufferedWriter;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.InetAddress;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
-import java.util.TreeMap;
import java.util.prefs.Preferences;
import org.apache.commons.cli.CommandLine;
@@ -50,7 +44,6 @@ import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.Executor;
import org.apache.commons.exec.PumpStreamHandler;
-import org.rhq.core.util.TokenReplacingReader;
import org.rhq.core.util.stream.StreamUtil;
import org.rhq.server.control.ControlCommand;
import org.rhq.server.control.RHQControlException;
@@ -499,25 +492,23 @@ public class Install extends ControlCommand {
}
private void configureAgent(File agentBasedir, CommandLine commandLine) throws Exception {
+ // If the user provided us with an agent configuration, we will use it completely. Otherwise,
+ // We are going to accept all defaults from the out-of-box agent.
+ // Because we want to accept all defaults and consider the agent fully configured, we need to set
+ // rhq.agent.configuration-setup-flag
+ // to "true". This tells the agent not to attempt to ask any setup questions at startup.
try {
log.info("Configuring the RHQ agent");
if (commandLine.hasOption(AGENT_CONFIG_OPTION)) {
replaceAgentConfigIfNecessary(commandLine);
} else {
- File agentConfDir = new File(agentBasedir, "conf");
- File agentConfigFile = new File(agentConfDir, "agent-configuration.xml");
- agentConfigFile.delete();
-
- Map<String, String> tokens = new TreeMap<String, String>();
- tokens.put("rhq.agent.server.bind-address", InetAddress.getLocalHost().getHostName());
-
- InputStream inputStream = getClass().getResourceAsStream("/agent-configuration.xml");
- TokenReplacingReader reader = new TokenReplacingReader(new InputStreamReader(inputStream), tokens);
- BufferedWriter writer = new BufferedWriter(new FileWriter(agentConfigFile));
-
- StreamUtil.copy(reader, writer);
- log.info("Finished configuring the agent");
+ String setupPref = "rhq.agent.configuration-setup-flag";
+ Preferences prefs = getAgentPreferences();
+ prefs.putBoolean(setupPref, true);
+ prefs.flush();
+ prefs.sync();
}
+ log.info("Finished configuring the agent");
} catch (Exception e) {
log.error("An error occurred while configuring the agent: " + e.getMessage());
throw e;
@@ -525,11 +516,32 @@ public class Install extends ControlCommand {
}
private void clearAgentPreferences() throws Exception {
- log.info("Removing any existing agent preferences");
- Preferences agentPrefs = Preferences.userRoot().node("/rhq-agent");
- agentPrefs.removeNode();
- agentPrefs.flush();
- Preferences.userRoot().sync();
+ log.info("Removing any existing agent preferences from default preference node");
+
+ // remove everything EXCEPT the security token
+ Preferences agentPrefs = getAgentPreferences();
+ String[] prefKeys = null;
+
+ try {
+ prefKeys = agentPrefs.keys();
+ } catch (Exception e) {
+ log.warn("Failed to get agent preferences - cannot clear them: " + e);
+ }
+
+ if (prefKeys != null && prefKeys.length > 0) {
+ for (String prefKey : prefKeys) {
+ if (!prefKey.equals("rhq.agent.security-token")) {
+ agentPrefs.remove(prefKey);
+ }
+ }
+ agentPrefs.flush();
+ Preferences.userRoot().sync();
+ }
+ }
+
+ private Preferences getAgentPreferences() {
+ Preferences agentPrefs = Preferences.userRoot().node("rhq-agent/default");
+ return agentPrefs;
}
private void startAgent(File agentBasedir) throws Exception {
diff --git a/modules/enterprise/server/server-control/src/main/resources/agent-configuration.xml b/modules/enterprise/server/server-control/src/main/resources/agent-configuration.xml
deleted file mode 100644
index f055bbe..0000000
--- a/modules/enterprise/server/server-control/src/main/resources/agent-configuration.xml
+++ /dev/null
@@ -1,1101 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>
-
-<!--
-==============================================================================
-RHQ Agent Configuration
-
-This configuration file defines the initial defaults for an agent that is not
-yet fully configured. Once the agent is completely configured (e.g. when
-you answer the setup questions asked by the agent when it starts up the
-very first time), this configuration file is no longer read or used to define
-the agent's behavior.
-
-After you provide the agent the answers to the setup questions, it will store
-the configuration in Java Preferences and will thereafter no longer need this
-configuration file. See the Java documentation on the Java Preferences API
-for more information as to where the persisted configuration is stored for
-your particular platform the agent is running on.
-
-When you start the agent for the very first time it will not yet have any
-configuration preferences defined. It is only under this condition when this
-configuration file is actually used automatically by the agent.
-Please keep this in mind whenever you make changes to this configuration file
-(to be more clear - do not assume that when you change this file that the
-agent's configuration will actually change - it normally will not).
-
-If you do want to change the agent's configuration by making changes to this
-file, you must tell the agent to re-configure itself with the file by
-passing in the command line option "-c agent-configuration.xml".
-
-If you want to fully configure the agent with this configuration file and
-not be asked those setup questions (even during the very first time you
-start the agent) make sure that you set the configuration preference named
-"rhq.agent.configuration-setup-flag" to the value of "true" in this file
-(of course, if you do this, you must make sure this configuration file
-contains all valid configuration for all settings since you opted not to be
-asked the setup questions).
-
-If you are interested in learning about additional ways in which you can
-configure the agent, please see the help documentation on the agent prompt
-commands named "config", "setconfig" and "setup" and the command line options
--l (cleanconfig), -c (config), -p (prefs), -s (setup) and -a (advanced).
-==============================================================================
--->
-
-<preferences EXTERNAL_XML_VERSION="1.0">
- <root type="user">
- <map />
- <node name="rhq-agent">
- <map />
- <node name="\${rhq.agent.preferences-node}">
- <map>
- <!--
- _______________________________________________________________
- rhq.agent.configuration-schema-version
-
- Defines what version of the agent configuration schema this
- file conforms to. This is the schema for the rhq.agent
- preferences.
- -->
- <entry key="rhq.agent.configuration-schema-version" value="6" />
-
- <!--
- _______________________________________________________________
- rhq.agent.configuration-setup-flag
-
- If true, the agent will assume it is fully configured and
- will not ask setup questions when it starts up. If false,
- the agent assumes the configuration is not complete and
- will ask a series of setup questions to the user in order
- to be fully configured.
-
- If you write your own custom agent configuration file, you
- will probably want to set this flag to true since you
- probably will set all of your configuration right in the
- configuration file itself. However, you may wish to
- distribute agent configuration files with only a subset
- of configuration preferences set and rely on each agent's
- startup setup mechanism to finish its configuration - in this
- case, you'll want to leave this as false.
- -->
- <entry key="rhq.agent.configuration-setup-flag" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.agent.name
-
- Explicitly defines what the agent's name is. This will
- default to the agent's fully qualified domain name (that is,
- the FQDN of the platform where the agent is running). However,
- you can set this to any value you want, so long as it is
- unique among all other agents. You will need to explicitly set
- this if the agent platform's FQDN cannot be reliably determined
- at runtime.
- -->
- <!--
- <entry key="rhq.agent.name" value="my.hostname.com"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.server.transport
- rhq.agent.server.bind-address
- rhq.agent.server.bind-port
- rhq.agent.server.transport-params
- rhq.agent.server.alias
-
- The RHQ Server endpoint configuration.
-
- Note that because this is an XML file, you must specify
- "&" in the transport-params value when needing an ampersand
- to separate the transport parameters.
-
- Note that the server address is left undefined - the agent
- will default to the DNS alias (see rhq.agent.server.alias)
- and if that is not defined, it will default to the localhost
- or 127.0.0.1.
- -->
- <entry key="rhq.agent.server.transport" value="servlet" />
- <entry key="rhq.agent.server.bind-port" value="7080" />
- <entry key="rhq.agent.server.bind-address" value="${rhq.agent.server.bind-address}" />
- <entry key="rhq.agent.server.transport-params" value="/jboss-remoting-servlet-invoker/ServerInvokerServlet" />
- <entry key="rhq.agent.server.alias" value="rhqserver" />
-
- <!--
- _______________________________________________________________
- rhq.agent.server-auto-detection
-
- If true, the agent will attempt to auto-detect the RHQ Server
- coming online and going offline. This is more efficient
- than server polling but it requires multicast traffic to be
- enabled on your network and also requires the multicast
- detector be enabled.
- -->
- <entry key="rhq.agent.server-auto-detection" value="false" />
-
- <!--
- _______________________________________________________________
- rhq.agent.register-with-server-at-startup
-
- If true, the agent will attempt to register itself with the
- RHQ Server when the agent starts up. If false, the agent will
- not automatically register itself at startup; the agent must
- be manually registered via some other mechanism (e.g. the
- 'register' prompt command). The agent must be registered
- at least once in order to notify the RHQ Server about its
- existence and to assign the agent a valid security token.
- Note that even if this is true, the registration may not happen
- immediately if the RHQ Server itself is not up - once the RHQ
- Server comes up, the registration attempt will occur.
- -->
- <entry key="rhq.agent.register-with-server-at-startup" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.agent.wait-for-server-at-startup-msecs
-
- This defines how many milliseconds the agent should wait at
- startup for the RHQ Server to be detected. If the RHQ Server
- has not started up in the given amount of time, the agent will
- continue initializing and expect the server to come up later.
- If this is 0, the agent will not wait at all.
- -->
- <entry key="rhq.agent.wait-for-server-at-startup-msecs" value="60000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.update-plugins-at-startup
-
- If true, the agent will attempt to update its current set
- of plugins to their latest versions at startup. If false, the
- agent will not automatically update the plugins; the agent
- will use its current plugins. To update the plugins, you must
- manually do so via some other mechanism (e.g. the
- 'plugins' prompt command).
- Note that even if this is true, the update may not happen
- immediately if the RHQ Server itself is not up - once the RHQ
- Server comes up, the update attempt will occur.
- -->
- <entry key="rhq.agent.update-plugins-at-startup" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.agent.test-failover-list-at-startup
-
- If true, the agent will test connectivity to all server
- endpoints found in the agent's failover list. This helps
- provide a mechanism to quickly detect problems with the
- public endpoints configured for all RHQ Servers.
- The default is false.
- -->
- <entry key="rhq.agent.test-failover-list-at-startup" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.agent.agent-update.enabled
-
- If true, the agent will be allowed to update itself if it
- finds there is a new agent update binary available.
- If this feature is not enabled, the agent will never
- be allowed to update itself.
- -->
- <entry key="rhq.agent.agent-update.enabled" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.agent.agent-update.version-url
-
- If this is defined, it will be the URL the agent uses when it
- needs to retrieve information about the latest available
- agent update binary. If this is not defined, the agent will
- ask its server for the agent update binary version information.
- -->
- <!--
- <entry key="rhq.agent.agent-update.version-url" value="http://127.0.0.1:7080/agentupdate/version" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.agent-update.download-url
-
- If this is defined, it will be the URL the agent uses when it
- needs to download the latest available agent update binary.
- If this is not defined, the agent will download the agent
- update binary from its server.
- -->
- <!--
- <entry key="rhq.agent.agent-update.download-url" value="http://127.0.0.1:7080/agentupdate/download" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.primary-server-switchover-check-interval-msecs
-
- The agent will periodically check to ensure that the server
- it is connected to is its primary server (as opposed to one
- of its failover servers). This preference defines how many
- milliseconds the agent should wait in between these checks.
- A side-effect of this check is that the agent will also
- download an updated version of its failover list. So if
- new servers have been added to the cloud, the agent will
- now know about it.
-
- If this is 0, this check is never performed. You should never
- set this to 0 unless your agent will never participate in
- an RHQ HA environment.
- -->
- <entry key="rhq.agent.primary-server-switchover-check-interval-msecs" value="3600000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.vm-health-check.interval-msecs
-
- The agent will periodically check the health of its JVM if
- this preference is larger than 0. This check will allow the
- agent to attempt to correct possibly fatal problems that are
- detected (such as the JVM getting critically low on memory).
- The value of this preference, if larger than 0, is the number
- of milliseconds the agent should wait in between checks.
- -->
- <entry key="rhq.agent.vm-health-check.interval-msecs" value="5000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.vm-health-check.low-heap-mem-threshold
- rhq.agent.vm-health-check.low-nonheap-mem-threshold
-
- The threshold percentage (as a floating decimal) that must be
- crossed if the agent's VM health check thread is to consider
- the JVM with critically low memory. For example, if
- the agent's maximum heap size is 100MB and the heap
- threshold is set to 0.90, the agent's VM health check thread
- will consider the agent critically low on memory if the agent
- is using over 90MB of heap space.
- Note that the heap and non-heap memory thresholds are specified
- as separate preferences.
- -->
- <entry key="rhq.agent.vm-health-check.low-heap-mem-threshold" value="0.90" />
- <entry key="rhq.agent.vm-health-check.low-nonheap-mem-threshold" value="0.90" />
-
- <!--
- _______________________________________________________________
- rhq.agent.data-directory
-
- Location of a directory where the agent can write its internal
- cache of data.
- -->
- <entry key="rhq.agent.data-directory" value="data" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.queue-size
-
- The maximum size of the client command queue - this is the
- maximum number of commands that can be queued for sending to
- the server. If this is 0, then the queue is unbounded.
- WARNING! Setting this to 0 could lead to resources being used
- up if for some reason commands keep getting queued but are
- not getting sent.
- -->
- <entry key="rhq.agent.client.queue-size" value="50000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.max-concurrent
-
- The maximum number of concurrent commands that can be in the
- process of being sent to the server at any one time.
- -->
- <entry key="rhq.agent.client.max-concurrent" value="5" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-timeout-msecs
-
- The time in milliseconds that the client sender will wait
- before aborting a command. This is the amount of time in
- milliseconds that the server has in order to process commands.
- This value is only the default if a command has not specified
- its own timeout. A command can override this by setting its
- own timeout in the command's configuration, so this value may
- not be used for all commands that are sent. If this value is
- less than or equal to 0, there will be no default timeout
- and commands will therefore be allowed to take as long as they
- need (again, this is the default, individual commands may
- override this and set their own timeout). While this infinite
- timeout default could conceivably cause a thread to hang
- waiting for a rogue command that never finishes, it also reduces
- the amount of threads created by the system and may
- slightly increase throughput.
- -->
- <entry key="rhq.agent.client.command-timeout-msecs" value="600000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.retry-interval-msecs
-
- This is the minimum amount of time, in milliseconds, the client
- sender will wait before trying to resend a guaranteed command
- that previously failed. This is not a guarantee of when
- a command is retried - all that can be inferred is that a
- command that fails to be sent will not be retried until at
- least this amount of time passes.
- Note: if the sender is currently waiting in this retry pause
- period, the agent will not be able to be shutdown until that
- retry period is over. In other words, if the agent is asked
- to shutdown, it will wait for those commands waiting in this
- retry interval to wake up. This is to help ensure those
- commands are not lost. Keep this time period short enough
- to make agent shutdowns fairly responsive but long enough
- to avoid spinning the process with continuous resending of
- commands during periods of RHQ Server downtime. It is
- recommended to use auto-detection or server polling in order
- to automatically stop the client sender from continuously
- trying to retry commands during long periods of RHQ
- Server downtime.
- -->
- <entry key="rhq.agent.client.retry-interval-msecs" value="15000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.max-retries
-
- If a guaranteed delivery message is sent, but the agent fails
- to connect to the server and deliver the message, it will
- always be retried. However, if the error was something other
- than a "cannot connect" error, the command will only be retried
- this amount of times before the command is dropped. When this
- happens, the guaranteed command will never be delivered. This
- will normally happen under very odd and rare circumstances.
- Also, this setting only effects asynchronous messages that
- are sent with guaranteed delivery. This setting has no effect
- on other messages.
- -->
- <entry key="rhq.agent.client.max-retries" value="10" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.server-polling-interval-msecs
-
- If this value is larger than 0, it indicates the client sender
- should periodically poll the RHQ Server to make sure it's still
- up or (if it was down) see when it comes back up. The value is
- the number of milliseconds to wait in between polls. If the
- value is 0 or less, server polling is disabled. Server polling
- is less efficient that the agent's auto-detection mechanism,
- but server polling does not use multicasting, and thus might
- be the only way for the agent to detect the server.
- -->
- <entry key="rhq.agent.client.server-polling-interval-msecs" value="60000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-spool-file.name
-
- This defines the name of the command spool file. This
- file must be located in the data directory (if one does not
- exist, it will be created). Note that if you do not define
- this setting, the default is to not spool commands to disk
- and thus implicitly disable guaranteed delivery.
- -->
- <entry key="rhq.agent.client.command-spool-file.name" value="command-spool.dat" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-spool-file.params
-
- This defines the parameters for the command spool file.
- The spool file is where the agent persists commands that
- are flagged for guaranteed delivery and need to be sent.
- The format is defined as "max-file-size:purge-percentage".
- The first number is the size, in bytes, of the maximum file
- size threshold. If the spool file grows larger than this, a
- "purge" will be triggered in order to shrink the file.
- The second number is the purge percentage which indicates how
- large the file is allowed to be after a purge. This is
- specified as a percentage of the first parameter - the max
- file size threshold. For example, if the max file size is
- 100000 (i.e. 100KB) and the purge percentage is 90, then when
- the spool file grows larger than 100KB, a purge will be
- triggered and the file will be shrunk to no more than
- 90% of 100KB - which is 90KB. In effect, 10KB will be freed
- to allow room for new commands to be spooled. When this
- occurs, unused space is freed first and if that does not
- free up enough space, the oldest commands in the spool file
- will be sacrificed in order to make room for the newer
- commands.
- -->
- <entry key="rhq.agent.client.command-spool-file.params" value="10000000:75" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-spool-file.compressed
-
- If this flag is true, the commands stored in the spool file
- will be compressed. This can potentially save about 30%-40% in
- disk space (give or take), however, it slows down the
- persistence mechanism considerably. Recommended setting for
- this should be true unless something on the agent deployment
- box warrants persistence performance over disk-saving . The
- performance hit will only appear when unusual conditions occur,
- such as shutting down while some guaranteed commands have not
- been sent yet or if the RHQ Server is down. It will not affect
- the agent under normal conditions (while running with the RHQ
- Server up and successfully communicating with the agent).
- In those unusual/rare conditions, having performance degradation
- may not be as important.
- -->
- <entry key="rhq.agent.client.command-spool-file.compressed" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.send-throttling
-
- If this setting is defined, it will enable send throttling to
- occur while sending commands to the server. The format is
- defined as "max-commands:quiet-period-milliseconds"
- where the maximum commands defines the maximum number
- of commands that will be sent before the start of a quiet
- period. The quiet period defines the number of milliseconds
- in which no commands should be sent. After this duration
- expires, commands can again be sent, up to the maximum defined.
- Note that send throttling only affects those commands that
- are "throttle-able". Some commands are sent as soon as
- possible, regardless of the throttling settings.
-
- This affects sending commands synchronously and asynchronously.
- -->
- <entry key="rhq.agent.client.send-throttling" value="100:1000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.queue-throttling
-
- If this setting is defined, it will enable queue throttling to
- occur while sending commands to the server. The format is
- defined as "max-commands-per-burst:burst-period-milliseconds"
- where the maximum commands per burst defines the maximum number
- of commands that can be dequeued within a burst period. The
- burst period defines the number of milliseconds in which the
- defined maximum number of commands can be dequeued. If more
- than the maximum number of commands are queued within this
- time period, they will wait until the next burst period starts
- before being able to be dequeued.
-
- This does not affect sending commands synchronously. It only
- effects commands queued to be sent asynchronously.
- -->
- <entry key="rhq.agent.client.queue-throttling" value="200:2000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-preprocessors
-
- Defines what class or classes will handle preprocessing of all
- commands that are sent by the agent. To define multiple
- classes, separate them with colon characters (:).
- You should never have to change this unless you know what
- you are doing.
- -->
- <entry key="rhq.agent.client.command-preprocessors" value="org.rhq.enterprise.agent.SecurityTokenCommandPreprocessor:org.rhq.enterprise.agent.ExternalizableStrategyCommandPreprocessor" />
-
- <!--
- _______________________________________________________________
- rhq.agent.disable-native-system
-
- The agent has a native system (JNI native libraries) on certain
- supported platforms to help the plugin container perform
- discovery of native components on those platforms. If the
- native libraries are causing errors within the agent or if you
- simply do not want to load native components in the agent,
- you can disable this native system by setting this preference
- setting to true.
- -->
- <entry key="rhq.agent.disable-native-system" value="false"/>
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.directory
-
- Defines where the plugins can be located.
- -->
- <entry key="rhq.agent.plugins.directory" value="plugins"/>
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.operation-invocation-timeout-secs
-
- When an operation is invoked, it will be aborted if it takes
- longer than the given amount of seconds. This is just the
- default operation invocation timeout - a plugin can override
- this default by defining its own timeout in the operation
- metadata within its plugin descriptor.
- -->
- <!--
- <entry key="rhq.agent.plugins.operation-invocation-timeout-secs" value="600"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.operation-invoker.threadpool-size
-
- When an operation is to be invoked, the execution of the
- operation will be performed by threads from a thread pool.
- This defines the number of threads within that thread pool,
- effectively defining the number of operations that can be
- invoked concurrently.
- -->
- <!--
- <entry key="rhq.agent.plugins.operation-invoker.threadpool-size" value="5"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.server-discovery.initial-delay-secs
-
- Defines the delay before the first server discovery scan is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.server-discovery.initial-delay-secs" value="10"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.server-discovery.period-secs
-
- Defines how often a server discovery scan is run. This type
- of scan is used to determine changes in the platform
- as well as to find new servers that have been added or
- old server that have been removed. The value is specified
- in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.server-discovery.period-secs" value="900"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.service-discovery.initial-delay-secs
-
- Defines the delay before the first service discovery scan is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.service-discovery.initial-delay-secs" value="20"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.service-discovery.period-secs
-
- Defines how often a service discovery scan is run. This type
- of scan is used to find new services that have been added or
- removed from existing platforms and servers. Technically,
- this kind of discovery is used to find any child resource
- to an existing parent resource (like a platform or server).
- The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.service-discovery.period-secs" value="86400"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.child-discovery.delay-secs
-
- Defines the delay between merging newly committed or modified resources with
- the inventory and kicking off a discovery to discover their child resources.
- Once the RHQ administrator imports a server or platform into the inventory,
- or a connection settings change is made on a resource, the agent is notified
- about that action and such resources are "merged" into the agent's inventory
- with a "committed" status and updated details.
- This setting defines the delay between the agent notifying such change and
- performing the discovery to find if the change made any difference in the
- children of the resources in question.
- Note that in the case of newly imported resources, their immediate children
- are discovered immediately. It is only the further levels that are governed
- by this setting.
- The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.child-discovery.delay-secs" value="5"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.availability-scan.initial-delay-secs
-
- Defines the delay before the first availability scan is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.availability-scan.initial-delay-secs" value="5"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.availability-scan.period-secs
-
- Defines how often an availability scan is run. This type
- of scan is used to determine what resources are up and running
- and what resources have gone down. The value is specified in
- seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.availability-scan.period-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.measurement-collection.threadpool-size
-
- When measurement's are scheduled for collection, the collection
- will be performed by threads from a thread pool. This defines
- the number of threads within that thread pool, effectively
- defining the number of measurements that can be collected
- concurrently.
- -->
- <!--
- <entry key="rhq.agent.plugins.measurement-collection.threadpool-size" value="5"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.measurement-collection.initial-delay-secs
-
- Defines the delay before the first measurement collection is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.measurement-collection.initial-delay-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.drift-detection.initial-delay-secs
-
- Defines the delay before the first drift detection scan is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.drift-detection.initial-delay-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.drift-detection.period-secs
-
- Defines how often a drift detection scan is run. This type
- of scan is used to determine what, if any, file changes (such
- as additions, deletions, modifications) occurred within
- specific file system locations that are being monitored.
- If this value is 0 or less, drift detection will be disabled.
- -->
- <!--
- <entry key="rhq.agent.plugins.drift-detection.period-secs" value="60"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.content-discovery.threadpool-size
-
- When plugins are scheduled to discover content, the discovery
- will be performed by threads from a thread pool. This defines
- the number of threads within that thread pool.
- -->
- <!--
- <entry key="rhq.agent.plugins.content-discovery.threadpool-size" value="10"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.content-discovery.initial-delay-secs
-
- Defines the delay before the first content discovery is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.content-discovery.initial-delay-secs" value="60"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.content-discovery.period-secs
-
- Defines how often content discoveries are run. The value is
- specified in seconds. If this value is 0 or less, content
- discovery will be disabled. Content discovery is used to
- detect new or changed content that are associated with
- resources in inventory.
- -->
- <!--
- <entry key="rhq.agent.plugins.content-discovery.period-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.configuration-discovery.initial-delay-secs
-
- Defines the delay before the first configuration discovery is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.configuration-discovery.initial-delay-secs" value="300"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.configuration-discovery.period-secs
-
- Defines how often configuration discoveries are run. The value is
- specified in seconds. If this value is 0 or less, configuration
- discovery will be disabled. Configuration discovery is
- performed to detect changes in a managed resource's
- configuration settings.
- -->
- <!--
- <entry key="rhq.agent.plugins.configuration-discovery.period-secs" value="3600"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.event-sender.initial-delay-secs
-
- Defines the delay before the first event report gets sent
- to the server. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.event-sender.initial-delay-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.event-sender.period-secs
-
- Defines how often event reports get sent to the server. The
- value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.event-sender.period-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.event-report.max-per-source
-
- Defines the maximum number of events for any given event source
- that can be placed in a single event report that is sent up
- to the server. If this number is larger than the max-total
- setting, then this setting is ignored.
- -->
- <!--
- <entry key="rhq.agent.plugins.event-report.max-per-source" value="200"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.event-report.max-total
-
- Defines the total maximum number of events that can be placed
- in a single event report that is sent up to the server.
- -->
- <!--
- <entry key="rhq.agent.plugins.event-report.max-total" value="400"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.disabled
-
- Defines the names of the plugins that are to be disabled.
- This is a comma-separated list of plugin names, where a
- plugin name is found in the name attribute in the root XML
- element in the plugin descriptor. A disabled plugin will
- simply not be loaded in the plugin container.
-
- By default, all plugins are enabled. If a plugin was marked
- as disabled by the server, the agent will not download it and
- will not load it, regardless of the value of this preference.
- If a plugin is enabled on the server, this
- preference will override that enable setting (in other words,
- an agent is able to disable a plugin, effectively overriding
- the server setting, by placing the plugin name in this
- preference). If the agent already has a plugin jar in
- its local plugins directory, but that plugin is disabled
- via this preference, that local plugin jar file will be
- deleted and the plugin will not be loaded.
- -->
- <!--
- <entry key="rhq.agent.plugins.disabled" value=""/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.disabled-resource-types
-
- Defines the names of the resource types to be disabled.
- This is a vertical-bar-separated list of type names, where a
- type name is the plugin name (found in the name attribute
- in the root XML element in the plugin descriptor) followed by
- a series of ">" followed by type names (which follow the
- type hierarchy defined in the plugin).
-
- Example:
- Platform>Network Adapter|JBossAS Server>Web Application (WAR)>Web Application Context
- -->
- <!--
- <entry key="rhq.agent.plugins.disabled-resource-types" value=""/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.configuration-schema-version
-
- Defines what version of the agent configuration schema this
- file conforms to. This is the schema for the
- rhq.communications preferences.
- -->
- <entry key="rhq.communications.configuration-schema-version" value="1" />
-
- <!--
- _______________________________________________________________
- rhq.communications.service-container.mbean-server-name
-
- Name of the MBean Server that houses the communications MBean
- services. This is actually the default domain name of the
- MBean Server and if an MBean Server has already been registered
- with this name, it will be used to house the communications
- services. If an MBean Server has not yet been registered with
- this name as its default domain, one will be created. Typically
- this can be left undefined which means the fallback MBeanServer
- to be used is the built-in JVM platform MBeanServer.
- -->
- <!--
- <entry key="rhq.communications.service-container.mbean-server-name" value="jboss-on" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.data-directory
-
- The location where the communication services write internal
- data files. If not defined, the data directory will be the
- same as the agent's.
- -->
- <!--
- <entry key="rhq.communications.data-directory" value="data" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.global-concurrency-limit
-
- The maximum number of incoming commands that are allowed to be
- received concurrently. Zero or less indicates there is to
- be no limit and the agent can accept as many incoming
- commands as possible. By default, there is no limit
- and you typically did not have to change this from its
- default.
- -->
- <entry key="rhq.communications.global-concurrency-limit" value="-1" />
-
- <!--
- _______________________________________________________________
- rhq.communications.multicast-detector.enabled
- rhq.communications.multicast-detector.multicast-address
- rhq.communications.multicast-detector.bind-address
- rhq.communications.multicast-detector.port
- rhq.communications.multicast-detector.default-time-delay
- rhq.communications.multicast-detector.heartbeat-time-delay
-
- The multicast detector configuration. This is the service that
- listens for new remote servers coming on and going offline and
- is required if you want server auto-detection. If you do not
- have server auto-detection enabled or your network will not
- support multicast traffic, you should disable the multicast
- detector.
-
- The multicast-address is used to broadcast detection messages.
- To be more specific, it is the IP address of the
- multicast group the detector will join. The bind-address
- is the IP that is bound by the network interface.
-
- The detector will send heartbeat messages every X milliseconds
- (this is the heartbeat-time-delay). If external servers'
- detectors do not send their heartbeat messages within the
- default-time-delay, our detector will assume that external
- server has gone down. These settings affect the timeliness
- of our auto-detection mechanism.
- -->
- <entry key="rhq.communications.multicast-detector.enabled" value="false" />
- <entry key="rhq.communications.multicast-detector.multicast-address" value="224.16.16.16" />
- <entry key="rhq.communications.multicast-detector.bind-address" value="0.0.0.0" />
- <entry key="rhq.communications.multicast-detector.port" value="16162" />
- <entry key="rhq.communications.multicast-detector.default-time-delay" value="5000" />
- <entry key="rhq.communications.multicast-detector.heartbeat-time-delay" value="1000" />
-
- <!--
- _______________________________________________________________
- rhq.communications.connector.rhqtype
- rhq.communications.connector.transport
- rhq.communications.connector.bind-port
- rhq.communications.connector.bind-address
- rhq.communications.connector.transport-params
- rhq.communications.connector.lease-period
-
- The agent's connector configuration. This is the service that
- listens for incoming client requests and passes them to the
- appropriate server-side components for processing. See the
- JBoss/Remoting documentation for a full list of options
- that can be specified. Note that because this is an XML file,
- you must specify "&" in the transport-params value
- when needing an ampersand to separate the parameters.
-
- If you do not define the bind-address, the agent will, at
- runtime, pick an address to bind to based on the network
- adapters that are available. If you want the agent to use
- a specific IP or address, then you must define the
- bind-address here.
-
- Notice about bind-address and bind-port:
- If you use transport param "serverBindAddress", that will
- actually be the address the agent will use to bind its
- socket and the rhq.communications.connector.bind-address
- will be the public address the RHQ Server will use to
- talk to the agent.
- If you use transport param "serverBindPort", that will
- actually be the port the agent will use for its server
- socket and the rhq.communications.connector.bind-port
- will be the public port the RHQ Server will use to
- talk to the agent.
- -->
- <entry key="rhq.communications.connector.rhqtype" value="agent" />
- <entry key="rhq.communications.connector.transport" value="socket" />
- <entry key="rhq.communications.connector.bind-port" value="16163" />
- <!--
- <entry key="rhq.communications.connector.bind-address" value="127.0.0.1" />
- <entry key="rhq.communications.connector.transport-params" value="serverBindAddress=127.0.0.1&serverBindPort=16163&numAcceptThreads=3&maxPoolSize=303&clientMaxPoolSize=304&socketTimeout=60000&enableTcpNoDelay=true&backlog=200" />
- <entry key="rhq.communications.connector.lease-period" value="5000" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.connector.security.secure-socket-protocol
- rhq.communications.connector.security.keystore.file
- rhq.communications.connector.security.keystore.algorithm
- rhq.communications.connector.security.keystore.type
- rhq.communications.connector.security.keystore.password
- rhq.communications.connector.security.keystore.key-password
- rhq.communications.connector.security.keystore.alias
- rhq.communications.connector.security.truststore.file
- rhq.communications.connector.security.truststore.algorithm
- rhq.communications.connector.security.truststore.type
- rhq.communications.connector.security.truststore.password
- rhq.communications.connector.security.client-auth-mode
-
- rhq.agent.client.security.secure-socket-protocol
- rhq.agent.client.security.keystore.file
- rhq.agent.client.security.keystore.algorithm
- rhq.agent.client.security.keystore.type
- rhq.agent.client.security.keystore.password
- rhq.agent.client.security.keystore.key-password
- rhq.agent.client.security.keystore.alias
- rhq.agent.client.security.truststore.file
- rhq.agent.client.security.truststore.algorithm
- rhq.agent.client.security.truststore.type
- rhq.agent.client.security.truststore.password
- rhq.agent.client.security.server-auth-mode-enabled
-
- These are the settings that are used if SSL is to be used for
- either the server or client communications. These can be left
- unset since the defaults will normally suffice. These
- properties are here just in case some use case occurs that
- require one or more of these settings to be customized.
-
- Note that if client-auth-mode is specified, it must be one of:
- "none", "want", "need".
- -->
- <!--
- <entry key="rhq.communications.connector.security.secure-socket-protocol" value="TLS" />
- <entry key="rhq.communications.connector.security.keystore.file" value="data/keystore.dat" />
- <entry key="rhq.communications.connector.security.keystore.algorithm" value="SunX509" />
- <entry key="rhq.communications.connector.security.keystore.type" value="JKS" />
- <entry key="rhq.communications.connector.security.keystore.password" value="rhqpwd" />
- <entry key="rhq.communications.connector.security.keystore.key-password" value="rhqpwd" />
- <entry key="rhq.communications.connector.security.keystore.alias" value="rhq" />
- <entry key="rhq.communications.connector.security.truststore.file" value="data/truststore.dat" />
- <entry key="rhq.communications.connector.security.truststore.algorithm" value="SunX509" />
- <entry key="rhq.communications.connector.security.truststore.type" value="JKS" />
- <entry key="rhq.communications.connector.security.truststore.password" value="" />
- <entry key="rhq.communications.connector.security.client-auth-mode" value="none" />
-
- <entry key="rhq.agent.client.security.secure-socket-protocol" value="TLS" />
- <entry key="rhq.agent.client.security.keystore.file" value="data/keystore.dat" />
- <entry key="rhq.agent.client.security.keystore.algorithm" value="SunX509" />
- <entry key="rhq.agent.client.security.keystore.type" value="JKS" />
- <entry key="rhq.agent.client.security.keystore.password" value="rhqpwd" />
- <entry key="rhq.agent.client.security.keystore.key-password" value="rhqpwd" />
- <entry key="rhq.agent.client.security.keystore.alias" value="rhq" />
- <entry key="rhq.agent.client.security.truststore.file" value="data/truststore.dat" />
- <entry key="rhq.agent.client.security.truststore.algorithm" value="SunX509" />
- <entry key="rhq.agent.client.security.truststore.type" value="JKS" />
- <entry key="rhq.agent.client.security.truststore.password" value="" />
- <entry key="rhq.agent.client.security.server-auth-mode-enabled" value="false" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.remote-stream-max-idle-time-msecs
-
- The maximum amount of milliseconds a remoted stream
- is allowed to be idle before it is automatically closed and
- removed from the server. This means that a client must
- attempt to access the remoted stream every X milliseconds
- (where X is the value of this setting) or that stream will no
- longer be available. Note that this does not mean a client
- must read or write the entire stream in this amount of time,
- it only means a client must make a request on the stream every
- X milliseconds (be it to read or write one byte, see how many
- bytes are available to be read, etc).
- -->
- <entry key="rhq.communications.remote-stream-max-idle-time-msecs" value="300000" />
-
- <!--
- _______________________________________________________________
- rhq.communications.command-service-directory.allow-dynamic-discovery
-
- Flag to allow new command services to be added to the command
- services directory during runtime. If this is false, only
- those services defined in the
- rhq.communications.command-services preference will be available
- during the lifetime of the command service directory.
- -->
- <entry key="rhq.communications.command-service-directory.allow-dynamic-discovery" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.communications.command-services
-
- Command Services that are to be added immediately at startup.
- -->
- <entry key="rhq.communications.command-services" value="org.rhq.enterprise.communications.command.impl.echo.server.EchoCommandService, org.rhq.enterprise.communications.command.impl.identify.server.IdentifyCommandService" />
-
- <!--
- _______________________________________________________________
- rhq.communications.remote-pojos
-
- Objects that are to be created and their remote interfaces
- deployed immediately at startup. The format of the value is
- a comma separated list of implementation/interface names:
- class.to.instantiate.via.noarg.constructor:interface.to.expose
- -->
- <entry key="rhq.communications.remote-pojos" value="org.rhq.enterprise.communications.PingImpl:org.rhq.enterprise.communications.Ping" />
-
- </map>
- </node>
- </node>
- </root>
-</preferences>
11 years
[rhq] modules/plugins
by John Sanda
modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java | 51 ++++++++--
modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java | 34 +++---
2 files changed, 59 insertions(+), 26 deletions(-)
New commits:
commit 88e64408f6498276ac1db7b01b120a3b50033196
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Jun 3 16:24:11 2013 -0400
adding error handling to updateSeedsList operation
Also making the seeds list update part of the addNodeMaintenance operation
optional.
diff --git a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
index eb4dd5c..61ca3ae 100644
--- a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
+++ b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
@@ -29,9 +29,11 @@ import static org.rhq.core.system.OperatingSystemType.WINDOWS;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -39,8 +41,6 @@ import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Cluster.Builder;
import com.datastax.driver.core.Session;
-import org.apache.cassandra.config.Config;
-import org.apache.cassandra.config.SeedProviderDef;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hyperic.sigar.SigarException;
@@ -48,9 +48,7 @@ import org.mc4j.ems.connection.EmsConnection;
import org.mc4j.ems.connection.bean.EmsBean;
import org.mc4j.ems.connection.bean.operation.EmsOperation;
import org.yaml.snakeyaml.DumperOptions;
-import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.Yaml;
-import org.yaml.snakeyaml.representer.Representer;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.Property;
@@ -69,6 +67,7 @@ import org.rhq.core.system.ProcessInfo.ProcessInfoSnapshot;
import org.rhq.core.system.SystemInfo;
import org.rhq.core.util.StringUtil;
import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.core.util.stream.StreamUtil;
import org.rhq.plugins.jmx.JMXServerComponent;
/**
@@ -296,15 +295,47 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
Map seedProvider = (Map) seedProviderList.get(0);
List paramsList = (List) seedProvider.get("parameters");
Map params = (Map) paramsList.get(0);
- String seeds = (String) params.get("seeds");
params.put("seeds", StringUtil.listToString(addresses));
- // remove the original file
- // TODO create a backup first in case something goes wrong so we can rollback
- yamlFile.delete();
+ // create a backup of the configuration file in preparation of writing out the changes
+ File yamlFileBackup = new File(yamlProp + ".bak" + new Date().getTime());
+ StreamUtil.copy(new FileInputStream(yamlFile), new FileOutputStream(yamlFileBackup), true);
+
+ if (!yamlFile.delete()) {
+ String msg = "Failed to delete [" + yamlFile + "] in preparation of writing updated configuration. The " +
+ "changes will be aborted.";
+ log.error(msg);
+ deleteYamlBackupFile(yamlFileBackup);
+ throw new IOException(msg);
+ }
+
FileWriter writer = new FileWriter(yamlFile);
- yaml.dump(cassandraConfig, writer);
- writer.close();
+ try {
+ yaml.dump(cassandraConfig, writer);
+ deleteYamlBackupFile(yamlFileBackup);
+ } catch (Exception e) {
+ log.error("An error occurred while trying to write the updated configuration back to " + yamlFile, e);
+ log.error("Reverting changes to " + yamlFile);
+
+ if (yamlFile.delete()) {
+ StreamUtil.copy(new FileInputStream(yamlFileBackup), new FileOutputStream(yamlFile));
+ deleteYamlBackupFile(yamlFileBackup);
+ } else {
+ String msg = "Failed updates to " + yamlFile.getName() + " cannot be rolled back. The file cannot be " +
+ "deleted. " + yamlFile + " should be replaced by " + yamlFileBackup;
+ log.error(msg);
+ throw new IOException(msg);
+ }
+ } finally {
+ writer.close();
+ }
+ }
+
+ private void deleteYamlBackupFile(File yamlBackup) {
+ if (!yamlBackup.delete()) {
+ log.warn("Failed to delete Cassandra configuration backup file [" + yamlBackup + "]. This file " +
+ "should be deleted.");
+ }
}
private String getStartScript() {
diff --git a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java
index a6b5e48..606499f 100644
--- a/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java
+++ b/modules/plugins/rhq-storage/src/main/java/org/rhq/plugins/storage/StorageNodeComponent.java
@@ -63,6 +63,7 @@ public class StorageNodeComponent extends CassandraNodeComponent implements Oper
private OperationResult nodeAdded(Configuration params) {
boolean runRepair = params.getSimple("runRepair").getBooleanValue();
+ boolean updateSeedsList = params.getSimple("updateSeedsList").getBooleanValue();
EmsConnection emsConnection = getEmsConnection();
KeyspaceService keyspaceService = new KeyspaceService(emsConnection);
@@ -100,23 +101,24 @@ public class StorageNodeComponent extends CassandraNodeComponent implements Oper
}
resultsList.add(toPropertyMap(opResult));
- // update seeds list...
- List<String> addresses = getAddresses(params.getList("seedsList"));
- try {
- opResult = new OpResult();
- opResult.operation = "Update seeds list";
- updateSeedsList(addresses);
- opResult.succeeded = true;
- } catch (Exception e) {
- log.error("An error occurred while updating the seeds lists for " + getResourceContext().getResourceKey(),
- e);
- opResult.succeeded = false;
-
- Throwable rootCause = ThrowableUtil.getRootCause(e);
- opResult.details = "An error occurred while updating the seeds list: " +
- ThrowableUtil.getStackAsString(rootCause);
+ if (updateSeedsList) {
+ List<String> addresses = getAddresses(params.getList("seedsList"));
+ try {
+ opResult = new OpResult();
+ opResult.operation = "Update seeds list";
+ updateSeedsList(addresses);
+ opResult.succeeded = true;
+ } catch (Exception e) {
+ log.error("An error occurred while updating the seeds lists for " + getResourceContext().getResourceKey(),
+ e);
+ opResult.succeeded = false;
+
+ Throwable rootCause = ThrowableUtil.getRootCause(e);
+ opResult.details = "An error occurred while updating the seeds list: " +
+ ThrowableUtil.getStackAsString(rootCause);
+ }
+ resultsList.add(toPropertyMap(opResult));
}
- resultsList.add(toPropertyMap(opResult));
resultConfig.put(resultsList);
11 years
[rhq] 2 commits - modules/common modules/enterprise
by mazz
modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java | 24 ++++++++++
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java | 4 +
2 files changed, 28 insertions(+)
New commits:
commit 9587b1c32289edd3d3d412308989857bfbd62304
Merge: a0b7697 c233a66
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Jun 3 15:05:09 2013 -0400
Merge remote-tracking branch 'origin/master'
commit a0b7697fc6adac4ebd50b3330b651a11041b0932
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Jun 3 15:04:33 2013 -0400
BZ 970230 - remove ExampleDS from RHQ Server during install
diff --git a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java
index 5228b2e..e238e14 100644
--- a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java
+++ b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java
@@ -42,6 +42,30 @@ public class DatasourceJBossASClient extends JBossASClient {
super(client);
}
+ /**
+ * Completely removes the named datasource. If the datasource does not exist,
+ * this returns silently (in other words, no exception is thrown).
+ *
+ * Note that no distinguishing between XA and non-XA datasource is needed - if any datasource
+ * (XA or non-XA) exists with the given name, it will be removed.
+ *
+ * @param name the name of the datasource to remove
+ * @throws Exception
+ */
+ public void removeDatasource(String name) throws Exception {
+ Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_DATASOURCES);
+ if (isDatasource(name)) {
+ addr.add(DATA_SOURCE, name);
+ } else if (isXADatasource(name)) {
+ addr.add(XA_DATA_SOURCE, name);
+ } else {
+ return; // there is no datasource (XA or non-XA) with the given name, just return silently
+ }
+
+ remove(addr);
+ return;
+ }
+
public boolean isDatasourceEnabled(String name) throws Exception {
return isDatasourceEnabled(false, name);
}
diff --git a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index 8a503db..fd99474 100644
--- a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++ b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -35,6 +35,7 @@ import org.jboss.as.controller.client.ModelControllerClient;
import org.rhq.cassandra.schema.SchemaManager;
import org.rhq.common.jbossas.client.controller.CoreJBossASClient;
+import org.rhq.common.jbossas.client.controller.DatasourceJBossASClient;
import org.rhq.common.jbossas.client.controller.DeploymentJBossASClient;
import org.rhq.common.jbossas.client.controller.WebJBossASClient;
import org.rhq.core.db.DatabaseTypeFactory;
@@ -1080,6 +1081,9 @@ public class InstallerServiceImpl implements InstallerService {
// we don't want users to access the admin console
new CoreJBossASClient(mcc).setEnableAdminConsole(false);
+ // no need for the example datasource - if it exists, remove it
+ new DatasourceJBossASClient(mcc).removeDatasource("ExampleDS");
+
} catch (Exception e) {
log("deployServices failed", e);
throw new Exception("Failed to deploy services: " + ThrowableUtil.getAllMessages(e));
11 years
[rhq] modules/plugins
by John Sanda
modules/plugins/cassandra/pom.xml | 4 -
modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java | 32 ++++++----
2 files changed, 23 insertions(+), 13 deletions(-)
New commits:
commit c233a668c0c3e38b2ff6994c29c258ee6b40d7c0
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Jun 3 13:58:54 2013 -0400
fix parsing/writing the cassandra yaml config document
diff --git a/modules/plugins/cassandra/pom.xml b/modules/plugins/cassandra/pom.xml
index 4a938d0..6c1fd4a 100644
--- a/modules/plugins/cassandra/pom.xml
+++ b/modules/plugins/cassandra/pom.xml
@@ -22,7 +22,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
- <version>1.12</version>
+ <version>1.6</version>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
@@ -96,7 +96,7 @@
<artifactItem>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
- <version>1.12</version>
+ <version>1.6</version>
</artifactItem>
<artifactItem>
<groupId>io.netty</groupId>
diff --git a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
index 9bfb1b0..eb4dd5c 100644
--- a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
+++ b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
@@ -274,26 +274,36 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
"non-existent file.");
}
- org.yaml.snakeyaml.constructor.Constructor constructor = new org.yaml.snakeyaml.constructor.Constructor(Config.class);
- TypeDescription seedDesc = new TypeDescription(SeedProviderDef.class);
- seedDesc.putMapPropertyType("parameters", String.class, String.class);
- constructor.addTypeDescription(seedDesc);
+ // Cassandra uses strong typing when reading and parsing cassandra.yaml. The
+ // document is parsed into a org.apache.cassandra.config.Config object. I tried
+ // using the config classes but ran into a couple different problems. When writing
+ // the config back out to cassandra.yaml, the generated yaml is not correct for the
+ // seed_provider property. The snakeyaml parser cannot even load the document
+ // because the SeedProviderDef class cannot be instantiated since it does not define
+ // a no-args constructor. Once I fixed that, I still was not able to get past the
+ // problems with the yaml generated for the seed_provider provider. Subsequent reads
+ // of cassandra.yaml would result in parsing errors. Given these problems, I decided
+ // to go with the untyped approach for updating cassandra.yaml for now.
+ //
+ // jsanda
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
+ Yaml yaml = new Yaml(options);
+ Map cassandraConfig = (Map) yaml.load(new FileInputStream(yamlFile));
- Yaml yaml = new Yaml(constructor, new Representer(), options);
- Config conf = (Config)yaml.load(new FileInputStream(yamlFile));
-
- SeedProviderDef seedProviderDef = conf.seed_provider;
- seedProviderDef.parameters.put("seeds", StringUtil.listToString(addresses));
- Map<String, String> params = seedProviderDef.parameters;
+ List seedProviderList = (List) cassandraConfig.get("seed_provider");
+ Map seedProvider = (Map) seedProviderList.get(0);
+ List paramsList = (List) seedProvider.get("parameters");
+ Map params = (Map) paramsList.get(0);
+ String seeds = (String) params.get("seeds");
+ params.put("seeds", StringUtil.listToString(addresses));
// remove the original file
// TODO create a backup first in case something goes wrong so we can rollback
yamlFile.delete();
FileWriter writer = new FileWriter(yamlFile);
- yaml.dump(conf, writer);
+ yaml.dump(cassandraConfig, writer);
writer.close();
}
11 years
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 68321e33da47b1094198c56e4550f55c435a2732
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 3 13:25:40 2013 -0400
Add a little more help to rhqctl
diff --git a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
index 54dc98e..542708f 100644
--- a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
+++ b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
@@ -47,9 +47,11 @@ public class RHQControl {
HelpFormatter helpFormatter = new HelpFormatter();
String syntax = "rhqctl <cmd> [options]";
String header = "\nwhere <cmd> is one of:";
+ String footer = "\n* For help on a specific command: rhqctl <cmd> --help\n" //
+ + "\n* Limit commands to a single component with one of: --storage, --server, --agent";
helpFormatter.setOptPrefix("");
- helpFormatter.printHelp(syntax, header, commands.getOptions(), null);
+ helpFormatter.printHelp(syntax, header, commands.getOptions(), footer);
}
public void exec(String[] args) {
@@ -62,7 +64,7 @@ public class RHQControl {
command.exec(getCommandLine(commandName, args));
}
- } catch(UsageException e) {
+ } catch (UsageException e) {
printUsage();
} catch (RHQControlException e) {
log.error(e.getMessage() + " [Cause: " + e.getCause() + "]");
11 years
[rhq] modules/enterprise modules/integration-tests
by Heiko W. Rupp
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java | 12 ++
modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java | 44 ++++++++++
2 files changed, 54 insertions(+), 2 deletions(-)
New commits:
commit 9037e401b48077a6294ccc01d6332c93af0af0ed
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Jun 3 18:01:18 2013 +0200
BZ 967448 - keep the prefix on redirect and also return alert definitions as XML
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
index b0be87c..fcf5485 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertDefinitionHandlerBean.java
@@ -137,7 +137,9 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
@ApiOperation(value = "Redirects to /alert/definitions")
public Response redirectDefinitionToDefinitions(@Context UriInfo uriInfo) {
UriBuilder uriBuilder = uriInfo.getRequestUriBuilder();
- uriBuilder.replacePath("/rest/alert/definitions"); // TODO there needs to be a better way
+ String path = uriInfo.getPath();
+ path = path.replace("/definition","/definitions");
+ uriBuilder.replacePath("/rest" + path);
Response.ResponseBuilder builder = Response.seeOther(uriBuilder.build());
return builder.build();
}
@@ -174,7 +176,13 @@ public class AlertDefinitionHandlerBean extends AbstractRestBean {
wrapForPaging(builder,uriInfo,defs,ret);
} else {
createPagingHeader(builder,uriInfo,defs);
- builder.entity(ret); // TODO generic entity for XML
+ if (mediaType.equals(MediaType.APPLICATION_XML_TYPE)) {
+ GenericEntity<List<AlertDefinitionRest>> list = new GenericEntity<List<AlertDefinitionRest>>(ret) {
+ };
+ builder.entity(list);
+ } else {
+ builder.entity(ret);
+ }
}
return builder.build();
diff --git a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
index 355adcd..a8b4ebc 100644
--- a/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
+++ b/modules/integration-tests/rest-api/src/test/java/org/rhq/modules/integrationTests/restApi/AlertTest.java
@@ -19,6 +19,8 @@
package org.rhq.modules.integrationTests.restApi;
+import com.jayway.restassured.config.RedirectConfig;
+import com.jayway.restassured.config.RestAssuredConfig;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.path.xml.XmlPath;
import com.jayway.restassured.response.Response;
@@ -37,6 +39,7 @@ import static com.jayway.restassured.RestAssured.expect;
import static com.jayway.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
@@ -209,6 +212,47 @@ public class AlertTest extends AbstractBase {
}
@Test
+ public void testListAllAlertDefinitionsRedirects() throws Exception {
+
+ given()
+ .config(RestAssuredConfig.config().redirect(RedirectConfig.redirectConfig().followRedirects(false)))
+ .expect()
+ .statusCode(303)
+ .log().ifError()
+ .header("Location",endsWith("rest/alert/definitions"))
+ .when()
+ .get("/alert/definition");
+
+ given()
+ .config(RestAssuredConfig.config().redirect(RedirectConfig.redirectConfig().followRedirects(false)))
+ .expect()
+ .statusCode(303)
+ .log().ifError()
+ .header("Location",endsWith("rest/alert/definitions.json"))
+ .when()
+ .get("/alert/definition.json");
+
+ // This time follow redirect
+ expect()
+ .statusCode(200)
+ .log().ifError()
+ .when()
+ .get("/alert/definition.json");
+
+ expect()
+ .statusCode(200)
+ .log().ifError()
+ .when()
+ .get("/alert/definition");
+
+ expect()
+ .statusCode(200)
+ .log().ifError()
+ .when()
+ .get("/alert/definition.xml");
+ }
+
+ @Test
public void testListAllAlertDefinitionsWithWrapping() throws Exception {
given()
11 years
[rhq] modules/core
by Jay Shaughnessy
modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 457acd0719ab64c35eefe3eb01b3678071970f50
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 3 11:48:41 2013 -0400
add more info to exception
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java
index e967549..3245e83 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java
@@ -40,7 +40,6 @@ import javax.persistence.PrePersist;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
-import org.rhq.core.domain.measurement.MeasurementSchedule;
import org.rhq.core.domain.resource.Resource;
/**
@@ -269,7 +268,8 @@ public class StorageNode implements Serializable {
public void parseNodeInformation(String s) {
String[] params = s.split("\\|");
if (params.length != 3) {
- throw new IllegalArgumentException("Expected string of the form, hostname|jmxPort|nativeTransportPort");
+ throw new IllegalArgumentException("Expected string of the form, hostname|jmxPort|nativeTransportPort: ["
+ + s + "]");
}
this.setAddress(params[0]);
11 years
[rhq] 2 commits - modules/core modules/enterprise
by Jiri Kremser
modules/core/domain/intentional-api-changes-since-4.7.0.xml | 43 ++++++++++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml | 20 +++-
2 files changed, 60 insertions(+), 3 deletions(-)
New commits:
commit d356df3a1c7a9514d01c5bdb1f6233df873d187d
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Mon Jun 3 17:40:35 2013 +0200
RHQDomain GWT module now takes into consideration properties gwt.locale and gwt.userAgent. It decreases the compilation time in for the dev profile (provided only 1 user agent and 1 locale is set).
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
index afa622f..e594e11 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/core/RHQDomain.gwt.xml
@@ -2,6 +2,7 @@
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/cor...">
<module>
+ <entry-point class='org.rhq.core.client.RHQDomain'/>
<inherits name='com.google.gwt.user.User'/>
@@ -25,10 +26,23 @@
is "ie6,ie8,ie9,gecko,gecko1_8,safari,opera" (i.e. all supported browsers).
To override this value, specify the user.agent property on the mvn
command line (e.g. -Duser.agent=gecko1_8) or in your ~/.m2/settings.xml.
-
+ -->
<set-property name="user.agent" value="${gwt.userAgent}"/>
- -->
- <entry-point class='org.rhq.core.client.RHQDomain'/>
+
+
+ <!--
+ A comma-separated list of the supported locales.
+ Each of the locales, aside from the default locale (en) must have a message
+ bundle properties file suffixed with _<locale>.properties in the same package
+ in which the corresponding GWT i18n interface class resides.
+
+ The gwt.locale property is substituted by the Maven resources plugin
+ during the resources phase. The default value for gwt.locale, defined in
+ coregui/pom.xml, includes all of the locales for which we currently have
+ message bundles. To override this value, specify the gwt.locale property on the
+ mvn command line (e.g. -Dgwt.locale=default) or in your ~/.m2/settings.xml.
+ -->
+ <extend-property name="locale" values="${gwt.locale}" />
<super-source path="gwtoverrides"/>
<source path="client"/>
commit 820a32ec451024cc4f0af532cce5eb890f6f76a6
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Mon Jun 3 17:12:18 2013 +0200
Fixing the rhq-master-api-check jenkins job. Only harmless changes were introduced by commit 85f75e0
diff --git a/modules/core/domain/intentional-api-changes-since-4.7.0.xml b/modules/core/domain/intentional-api-changes-since-4.7.0.xml
new file mode 100644
index 0000000..ba46837
--- /dev/null
+++ b/modules/core/domain/intentional-api-changes-since-4.7.0.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<differences>
+ <difference>
+ <className>org/rhq/core/domain/common/ServerDetails$Detail</className>
+ <differenceType>6001</differenceType><!-- removed field -->
+ <field>CURRENT_MEASUREMENT_TABLE</field>
+ <justification>
+ Removing ServerDetails.Detail.CURRENT_MEASUREMENT_TABLE. It is no longer needed after Cassandra integration.
+ </justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/common/ServerDetails$Detail</className>
+ <differenceType>6001</differenceType> <!-- removed field -->
+ <field>NEXT_MEASUREMENT_TABLE_ROTATION</field>
+ <justification>
+ Removing ServerDetails.Detail.NEXT_MEASUREMENT_TABLE_ROTATION. It is no longer needed after Cassandra integration.
+ </justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/measurement/MeasurementBaseline</className>
+ <differenceType>6001</differenceType><!-- removed field -->
+ <field>NATIVE_QUERY_CALC_FIRST_AUTOBASELINE_ORACLE</field>
+ <justification>
+ Removing MeasurementBaseline.NATIVE_QUERY_CALC_FIRST_AUTOBASELINE_ORACLE. The constants for native queries shouldn't be exposed at all.
+ </justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/measurement/MeasurementBaseline</className>
+ <differenceType>6001</differenceType><!-- removed field -->
+ <field>NATIVE_QUERY_CALC_FIRST_AUTOBASELINE_POSTGRES</field>
+ <justification>
+ Removing MeasurementBaseline.NATIVE_QUERY_CALC_FIRST_AUTOBASELINE_POSTGRES. The constants for native queries shouldn't be exposed at all.
+ </justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/measurement/MeasurementBaseline</className>
+ <differenceType>6001</differenceType><!-- removed field -->
+ <field>NATIVE_QUERY_CALC_FIRST_AUTOBASELINE_SQLSERVER</field>
+ <justification>
+ Removing MeasurementBaseline.NATIVE_QUERY_CALC_FIRST_AUTOBASELINE_SQLSERVER. The constants for native queries shouldn't be exposed at all.
+ </justification>
+ </difference>
+</differences>
11 years