public interface DownloadResolverManager
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(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.Modifier and Type | Interface and Description |
---|---|
static interface |
DownloadResolverManager.DownloadRequirement
Gives artifact meta-data for what is required to be downloaded.
|
static interface |
DownloadResolverManager.DownloadTargets
Describes the download locations, and their order, to try.
|
Modifier and Type | Method and Description |
---|---|
DownloadResolver |
newDownloader(EntityDriver driver)
For installing the main entity.
|
DownloadResolver |
newDownloader(EntityDriver driver,
java.util.Map<java.lang.String,?> properties)
For installing the main entity.
|
DownloadResolver |
newDownloader(EntityDriver driver,
java.lang.String addonName,
java.util.Map<java.lang.String,?> addonProperties)
For installing an entity add-on.
|
void |
registerFilenameProducer(com.google.common.base.Function<? super DownloadResolverManager.DownloadRequirement,java.lang.String> producer)
Registers a producer for generating the expected filename of the download artifact.
|
void |
registerPrimaryProducer(com.google.common.base.Function<? super DownloadResolverManager.DownloadRequirement,? extends DownloadResolverManager.DownloadTargets> resolver)
Registers a producer, to be tried before all other producers.
|
void |
registerProducer(com.google.common.base.Function<? super DownloadResolverManager.DownloadRequirement,? extends DownloadResolverManager.DownloadTargets> resolver)
Registers a producer, to be tried after all other registered producers have been tried.
|
DownloadResolver newDownloader(EntityDriver driver)
DownloadResolver newDownloader(EntityDriver driver, java.util.Map<java.lang.String,?> properties)
DownloadResolver newDownloader(EntityDriver driver, java.lang.String addonName, java.util.Map<java.lang.String,?> addonProperties)
void registerPrimaryProducer(com.google.common.base.Function<? super DownloadResolverManager.DownloadRequirement,? extends DownloadResolverManager.DownloadTargets> resolver)
BasicDownloadTargets.empty()
).registerResolver(Function)
void registerProducer(com.google.common.base.Function<? super DownloadResolverManager.DownloadRequirement,? extends DownloadResolverManager.DownloadTargets> resolver)
BasicDownloadTargets.empty()
).void registerFilenameProducer(com.google.common.base.Function<? super DownloadResolverManager.DownloadRequirement,java.lang.String> producer)
resolve(EntityDriver)
result.