Based on the contents of brooklyn properties, sets up rules for resolving where to
download artifacts from, for installing entities.
By default, these rules override the DOWNLOAD_URL defined on the entities in code.
Global properties can be specified that apply to all entities. Entity-specific properties
can also be specified (which override the global properties for that entity type).
Below is an example of realistic configuration for an enterprise who have an in-house
repository that must be used for everything, rather than going out to the public internet.
// FIXME Check format for including addonname- only if addonname is non-null?
// FIXME Use this in a testng test case
brooklyn.downloads.all.url=http://downloads.acme.com/brookyn/repository/${simpletype}/${simpletype}-${addon?? addon-}${version}.${fileSuffix!.tar.gz}
To illustrate the features and variations one can use, below is an example of global
properties that can be specified. The semicolon-separated list of URLs will be tried in-order
until one succeeds. The fallback url says to use that if all other URLs fail (or no others are
specified).
brooklyn.downloads.all.url=http://myurl1/${simpletype}-${version}.tar.gz; http://myurl2/${simpletype}-${version}.tar.gz
brooklyn.downloads.all.fallbackurl=http://myurl3/${simpletype}-${version}.tar.gz
Similarly, entity-specific properties can be defined. All "global properties" will also apply
to this entity type, unless explicitly overridden.
brooklyn.downloads.entity.tomcatserver.url=http://mytomcaturl1/tomcat-${version}.tar.gz
brooklyn.downloads.entity.tomcatserver.fallbackurl=http://myurl2/tomcat-${version}.tar.gz
Downloads for entity-specific add-ons can also be defined. All "global properties" will also apply
to this entity type, unless explicitly overridden.
brooklyn.downloads.entity.nginxcontroller.addon.stickymodule.url=http://myurl1/nginx-stickymodule-${version}.tar.gz
brooklyn.downloads.entity.nginxcontroller.addon.stickymodule.fallbackurl=http://myurl2/nginx-stickymodule-${version}.tar.gz
If no explicit URLs are supplied, then by default it will use the DOWNLOAD_URL attribute
of the entity (if supplied), followed by the fallbackurl if that fails.
A URL can be a "template", where things of the form ${version} will be substituted for the value
of "version" provided for that entity. The freemarker template engine is used to convert URLs
(see
http://freemarker.org). For example, one could use the URL:
http://repo.acme.com/${simpletype}-${version}.${fileSuffix!tar.gz}
The following substitutions are available automatically for a template:
- entity: the
Entity
instance
- driver: the
EntityDriver
instance being used for the Entity
- simpletype: the unqualified name of the entity type
- type: the fully qualified name of the entity type
- addon: the name of the entity add-on, or null if it's the core entity artifact
- version: the version number of the entity to be installed (or of the add-on)