Brooklyn

brooklyn.entity.drivers.downloads
[Java] Interface DownloadResolverManager


public interface DownloadResolverManager

Used by an EntityDriver to obtain the download locations when installing an entity. Most commonly, the DownloadResolver's targets are URIs. However, an EntityDriver implementation is free to interpret the String however is appropriate (e.g. the name of a custom package to install from the enterprise's package manager repository). Also supports registering other "resolvers" for determining where to download the installers from, for different entities. When using resolve(brooklyn.entity.drivers.EntityDriver) to get the list of things to try (in-order until one succeeds), the manager will go through each of the registered resolvers in-order to get their contributions. These contributions are split into "primary" and "fallback". All of the primaries will be added to the list first, and then all of the fallbacks.

Authors:
aled


Nested Class Summary
interface DownloadResolverManager.DownloadRequirement

Gives artifact meta-data for what is required to be downloaded.

interface DownloadResolverManager.DownloadTargets

Describes the download locations, and their order, to try.

 
Method Summary
DownloadResolver newDownloader(EntityDriver driver)

For installing the main entity.

DownloadResolver newDownloader(EntityDriver driver, java.util.Map properties)

For installing the main entity.

DownloadResolver newDownloader(EntityDriver driver, java.lang.String addonName, java.util.Map addonProperties)

For installing an entity add-on.

void registerFilenameProducer(Function producer)

Registers a producer for generating the expected filename of the download artifact.

void registerPrimaryProducer(Function resolver)

Registers a producer, to be tried before all other producers.

void registerProducer(Function resolver)

Registers a producer, to be tried after all other registered producers have been tried.

 

Method Detail

newDownloader

public DownloadResolver newDownloader(EntityDriver driver)
For installing the main entity. Returns a list of options, to be tried in order until one of them works.


newDownloader

public DownloadResolver newDownloader(EntityDriver driver, java.util.Map properties)
For installing the main entity. Returns a list of options, to be tried in order until one of them works.


newDownloader

public DownloadResolver newDownloader(EntityDriver driver, java.lang.String addonName, java.util.Map addonProperties)
For installing an entity add-on. Returns a list of options, to be tried in order until one of them works. This is used for resolving the download for an "add-on" - e.g. an additional module required during an entity's installation. Common properties include:


registerFilenameProducer

public void registerFilenameProducer(Function producer)
Registers a producer for generating the expected filename of the download artifact. If all such registered producers return null, then default behaviour is to infer the download name from the first target in the resolve(brooklyn.entity.drivers.EntityDriver) result.


registerPrimaryProducer

public void registerPrimaryProducer(Function resolver)
Registers a producer, to be tried before all other producers. A "producer" will generate the download targets to be tried, when installing a given entity or entity add-on. The function should not return null (instead see BasicDownloadTargets.empty()).
See Also:
registerResolver(Function)


registerProducer

public void registerProducer(Function resolver)
Registers a producer, to be tried after all other registered producers have been tried. The function should not return null (instead see BasicDownloadTargets.empty()).


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.