rhq-project/rhq — pull request #103 by metlos (2014-07-31 22:49:50+00:00)
Title: BZ 1069547 / JON 3-10 Limit the choice of resource groups and destinations based on the bundle type.

This is an extension to JON 3-10 to support limiting the choice of targets to target the bundle deployment as well as the choice of resource groups available for the destination when creating one. This to implement the suggestions from the demo of the feature prior to its merge.

In agent plugin descriptor, `destination-base-dir` and `destination-definition`s now define `accepts` definitions that list the bundle types that a destination can accept. This is to limit the "targets" available on creation of destinations.

Further, in the agent plugin descriptor, the `bundle` element defining the agent-side bundle handler can define the `targets` element listing the resource types that bundle handler can accept.

I thought about leaving the decision about the applicable resource types and/or destinations on the server-side bundle plugins when they analyze the bundle version's descriptor. This would leave us with the largest "degree of freedom". But I believe that is unfortunately not possible without substantially changing the bundle creation workflow. The reason for this is that this way multiple bundle versions could declare different targetable resource types, but destinations don't limit the version that can be deployed to them (which wouldn't make sense). Currently we first create a destination and only then select the bundle version to deploy to it. So we could limit the resource types to the union of the targetable resource types of all available versions of the bundle but then that would exclude some versions from being deployed, which fact would the user only figure out once they moved to the step of actually selecting the version to deploy.