Bug 1130392 - Sigar cannot detect kernel thread names

Sigar does detect the name of kernel threads, it's RHQ that has been filtering
them out.

The fix is simply removing the check for filename existence, and kernel thread
names don't have files anyway.
BZ 1130341 - Agent can be stuck waiting for startup

The agent can block forever in a JBoss remoting callback if it receives a
message that triggers a wait on the latch. Change to wait a finite amount of
time, then throw an exception.

Also, clean up the CommandProcessor to use CopyOnWriteArrayList, no need to
copy lists like this.
Move purge settings to a new "Advanced Purge Settings" group (hidden by default)
Bug 1145776 - RHQ_PARTITION_EVENT data not purged automatically

Added partition event and partition event details purge
It's disabled by default and configurable through System Settings.

Added partition event test in DataPurgeJobTest

Also, refactoring DataPurgeJob and DataPurgeJobTest
Bug 1139433 - Deadlock in deletion of RHQ_RESOURCE_ERROR, possibly in resource upgrade?

When saving a resource error, we first delete existing errors if the error type is one of:
* INVALID_PLUGIN_CONFIGURATION
* AVAILABILITY_CHECK
* UPGRADE
I'm not sure why we don't if the error type is DISABLED_TYPE.

The goal is to keep only one copy of these error types.

Here's my analysis of the deadlock report attached to the BZ.

Due to the type of locks (row locks) and the queries involved, it looks like the deadlock is the consequence of concurrent calls to ResourceManagerBean#clearResourceConfigErrorByType with the same parameters. Such concurrent calls would not necessarily lead to a deadlock. It would happen only if the row locking order is different. My knowledge of Oracle is limited but I'd say this is possible if the two queries get a different execution plan. I tried to figure out why the same query could lead to a different execution plan and one possible reason would be that one is using the index on resourceId and the other one is not.

This commit addresses the issue by changing the way previous errors are deleted. Now before delete we select an ordered list of primary keys. Then we delete the rows by primary key. Consequently, two competing sessions will never lock rows in different orders.

There's another issue due to the way resource errors are implemented. Two competing sessions will delete previous errors but both will insert a row. A DataPurgeJob task has been added to remove such duplicates, if any.
Bug 1139433 - Deadlock in deletion of RHQ_RESOURCE_ERROR, possibly in resource upgrade?

I checked Git history. From the looks of it, DISABLED_TYPE was added later in the game.
To me there's no reason why we let more than DISABLED_TYPE error per resource be persisted.
Bug 1145778 - Purge RHQ_RESOURCE_ERROR table as well

The fix for "Bug 1139433 - Deadlock in deletion of RHQ_RESOURCE_ERROR, possibly in resource upgrade?" enforces "only single error of a type for a given resource".

This change is to clear stale AVAILABILITY_CHECK errors (if a resource AVAIL is up, then there's no need to keep the resource error)

* INVALID_PLUGIN_CONFIGURATION -> auto cleaned when the agent starts the resource container.
* UPGRADE -> we need to keep it to inform the user
* DISABLED_TYPE -> we need to keep it to inform the user
Bug 1131726 - Data from RHQ_CONFIG_UPDATE never purged

Remove old resource config and group resource config updates from the
database.

The configuration and configuration properties entities get removed as
well.

An old config update may stay in the database if it is the last successful one.

An old group config update may stay in the database if one of the
children config update is the last succesful one for the target resource.
For timeout at startup, use 30 seconds (fixed)
Use NotProcessedException to indicate startup latch timed out
Include rhqapi.js as CLI module
Ensure that the server and agent scripts propagate SIGTERM in foreground mode

Supervisord requires that programs (1) don't daemonize themselves and
(2) respond to SIGTERM by properly shutting down. Requirement (1) is satisfied
provided one uses the following commands:
- rhq-server/rhq-storage/bin/cassandra -f
- rhq-server/bin/internal/rhq-server.sh console
- rhq-agent/bin/rhq-agent.sh -d
This patch modifies rhq-server.sh and rhq-agent.sh so that they also satisfy
requirement (2). Note that Cassandra already satisfies that requirement because
the script uses exec to launch the JVM.

With this change, RHQ can be properly configured to run under Supervisord, e.g.
in a Docker container.
Merge pull request #146 from lzoubek/master

Include rhqapi.js as CLI module
Bug 1119802 - RFE: Support for resource type name change

Added displayName optional attribute to resource type. This does allow to
change resource type name (by specifying this attribute in plugin
descriptor) and at the same time does not require to drop & re-create whole
resource type on server when performing plugin upgrade. I've updated all
coregui code, to show displayName instead of just name, legacy gui was not
updated as it is no long used.
Merge pull request #98 from lzoubek/bugs/1119802

Bug 1119802 - RFE: Support for resource type name change
Merge branch 'purgepurgepurge' of https://github.com/tsegismont/rhq into tsegismont-purgepurgepurge

Conflicts:
	modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
	modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_de.properties
	modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ja.properties
	modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ru.properties
Bug 1133590 - Unable to login in to 'Red Hat Access' in IE

revert commit b333a0250
Bug 1133590 - Unable to login in to 'Red Hat Access' in IE

    finish reverting commit b333a0250 - semicolon removed
Merge branch 'tsegismont-purgepurgepurge'
[BZ 1070262] Added all the tomcat password related properties to the ServerConfigurationConstants file and the upgrade code. Both of these should be pickedup by the upgrade and usage code automatically.