[BZ 1069691] (JON3-25, PRODMGT-368) DomainDeployments should be managed in a
single menu option in domain mode

Deploymet resource has been removed from Server-Group level. Now we have
only DomainDeployment (living under DC) and Deployment (discovered under
ManagedServer). We manage everything related to ServerGroups within
DomainDeployment's configuration and operations. Operation 'promote' remains
(although not needed anymore)

To assign DomainDeployment with Server-Group user adds new Configuration map
item, select SG, runtime-name and enabled/disabled state.

To enable/disable deployment on given SG user edits particular configite and
changes enabled boolean attribute

To remove DomainDeployment from SG user just removes given map item.

Given domain deployment cannot be assigned to same server group more than
once (even with different runtime-name) - EAP restriction. runtime-name
cannot be changed on existing map items (it's documented and ignored)

New operation for DomainDeployment resource called 'restart' was introduced.
User can restart deployment in particular SG or in all assigned SGs.

DomainDeplooyment's getAvailability() was also changed to return MISSING
instead of DOWN when deployment is not found on EAP.

DomainDeployments get discovered only under master DomainController, not
slave HostControllers
[BZ 1101770,1101773] make sure we do not process agent commands
fix test failure
some minor code cleanup
on HosctController component hold info if given HC is DC as well

This value is updated on component start and also by availability code, when
going from DOWN to UP (to handle cases, when HC was reconfigured to DC)
Access to HC Component property is synchronized, because value is updated by
avail code and can read by discovery code
[BZ 1069545] - addendum to subcategory work
When removing tables from our schema those obsolete tables must be added to
obsolete-schema.xml in order to properly support db overwrite.
- This should also fix test failures resulting from this omission in the
  original work.
Merge pull request #40 from lzoubek/feature/JON3-25

[BZ 1069691] (JON3-25, PRODMGT-368) DomainDeployments should be managed in a single menu option in domain mode
[BZ 1015706,1092756] check for invalid max and update it with the avg

We also log a warning to indicate that we have come across an invalid metric.
We then update and persist the max.

Conflicts:
	modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
Remove protection from weird metrics like avg > high or avg < low now that BZ1015706, and BZ1092756 are fixed.
Looks like I had already removed the high value check but still had the low value check in place.
[1103375] Viewing operation details for operations with no results throws uncaught exception in GUI
- Handled cases where null results are returned from an operation excecution.
- Fixed one op history update path where [results] data could be lost.
make sure we drop the legacy metrics_index table during schema update

The metrics_index table wasn't getting dropped for new installs. Fixing this
created a problem in TopologyManager where it sets gc_grace_seconds for each of
the tables. This commit modifies the logic in TopologyManager as well so that
it no longer tries to update gc_grace_seconds for metrics_index and so that it
does set it for metrics_cache and metrics_cache_index.
[BZ 1104916] add logic for reducing cluster size from > 4 nodes

The case for the previous cluster size > 4 was missing which resulted in an
IllegalStateException, which in turns causes the undeploy process to fail.
refactoring cache index querying and making raw data age limit configurable

I have introduced paging when querying the index for the current time slice.
The query is against a single partition which can get large and cause read
timeouts. Paging should help guard against that.

I have also made the age limit for raw data that is ingested configurable.
This means for example, that the user can decide whether or not the server
should accept or reject measurement reports with data that is already 5 days
old.
[BZ 1104888] fix bucket aggregation code for calculating max
[BZ 1092756] fix calculation of aggregate metrics

The max value for aggregate metrics could get computed incorrectly as a result
of an if else statement that should have been an if statement. The error
manifests itself only for 6 and 24 hour data. It would occur only when the min
and the max fall on the same data point.
[BZ 1069545] Clip bad last character.
[BZ 1069648] Update JAVA_OPTS from connection settings for Standalone servers.
[BZ 1069648] The JAVA_OPTS are now added to the bottom of the file and is additive to existing settings. This is a safer approach.
[BZ 1069648] First level name refactoring due to logic changes.
[BZ 1069648] Additional name refactoring.