public abstract class AbstractResolver extends java.lang.Object implements DependencyResolver, HasLatestStrategy, Validatable
| Constructor and Description |
|---|
AbstractResolver() |
| Modifier and Type | Method and Description |
|---|---|
void |
abortPublishTransaction() |
void |
beginPublishTransaction(ModuleRevisionId module,
boolean overwrite) |
protected void |
checkInterrupted() |
protected ResolvedModuleRevision |
checkLatest(DependencyDescriptor dd,
ResolvedModuleRevision newModuleFound,
ResolveData data) |
void |
commitPublishTransaction() |
protected boolean |
doValidate(ResolveData data) |
ArtifactDownloadReport |
download(ArtifactOrigin artifact,
DownloadOptions options)
Default implementation downloads the artifact without taking advantage of its location
|
void |
dumpSettings() |
boolean |
exists(Artifact artifact)
Returns
true if the given artifact can be located by this resolver and actually
exist. |
protected ResolvedModuleRevision |
findModuleInCache(DependencyDescriptor dd,
ResolveData data) |
protected ResolvedModuleRevision |
findModuleInCache(DependencyDescriptor dd,
ResolveData data,
boolean anyResolver) |
protected Artifact |
fromSystem(Artifact artifact) |
protected DependencyDescriptor |
fromSystem(DependencyDescriptor dd) |
protected CacheDownloadOptions |
getCacheDownloadOptions(DownloadOptions options) |
protected CacheMetadataOptions |
getCacheOptions(ResolveData data) |
protected java.lang.String |
getChangingMatcherName() |
protected java.lang.String |
getChangingPattern() |
protected DownloadOptions |
getDownloadOptions(ResolveOptions options) |
EventManager |
getEventManager() |
java.lang.String |
getLatest() |
LatestStrategy |
getLatestStrategy() |
java.lang.String |
getName() |
Namespace |
getNamespace()
Returns the namespace associated with this resolver.
|
ParserSettings |
getParserSettings() |
RepositoryCacheManager |
getRepositoryCacheManager()
Returns the
RepositoryCacheManager used to manage the repository cache associated
with this dependency resolver. |
ResolverSettings |
getSettings() |
protected IvyNode |
getSystemNode(ResolveData data,
ModuleRevisionId resolvedMrid) |
TimeoutConstraint |
getTimeoutConstraint() |
java.lang.String |
getTypeName() |
java.lang.String |
hidePassword(java.lang.String name)
this method should remove sensitive information from a location to be displayed in a log
|
protected boolean |
isAfter(ResolvedModuleRevision rmr1,
ResolvedModuleRevision rmr2,
java.util.Date date)
Returns true if rmr1 is after rmr2, using the latest strategy to determine which is the
latest
|
boolean |
isValidate() |
ModuleEntry[] |
listModules(OrganisationEntry org) |
OrganisationEntry[] |
listOrganisations() |
RevisionEntry[] |
listRevisions(ModuleEntry module) |
java.util.Map<java.lang.String,java.lang.String>[] |
listTokenValues(java.lang.String[] tokens,
java.util.Map<java.lang.String,java.lang.Object> criteria)
Same as
DependencyResolver.listTokenValues(String, Map) but more generic. |
java.lang.String[] |
listTokenValues(java.lang.String token,
java.util.Map<java.lang.String,java.lang.String> otherTokenValues)
List all the values the given token can take if other tokens are set as
described in the otherTokenValues map.
|
ArtifactOrigin |
locate(Artifact artifact)
Default implementation actually download the artifact Subclasses should overwrite this to
avoid the download
|
void |
reportFailure()
Reports last resolve failure as Messages
|
void |
reportFailure(Artifact art)
Reports last artifact download failure as Messages
|
protected void |
saveModuleRevisionIfNeeded(DependencyDescriptor dd,
ResolvedModuleRevision newModuleFound) |
void |
setCache(java.lang.String cacheName) |
void |
setChangingMatcher(java.lang.String changingMatcherName) |
void |
setChangingPattern(java.lang.String changingPattern) |
void |
setCheckmodified(boolean check) |
void |
setEventManager(EventManager eventManager) |
void |
setLatest(java.lang.String strategyName) |
void |
setLatestStrategy(LatestStrategy latestStrategy) |
void |
setName(java.lang.String name)
Should only be used by configurator
|
void |
setNamespace(java.lang.String namespaceName) |
void |
setRepositoryCacheManager(RepositoryCacheManager repositoryCacheManager) |
void |
setSettings(ResolverSettings ivy) |
void |
setTimeoutConstraint(java.lang.String name) |
void |
setValidate(boolean validate) |
java.lang.String |
toString() |
protected Artifact |
toSystem(Artifact artifact) |
protected DependencyDescriptor |
toSystem(DependencyDescriptor dd) |
protected MetadataArtifactDownloadReport |
toSystem(MetadataArtifactDownloadReport report) |
protected ModuleDescriptor |
toSystem(ModuleDescriptor md) |
protected ModuleRevisionId |
toSystem(ModuleRevisionId resolvedMrid) |
protected ResolvedModuleRevision |
toSystem(ResolvedModuleRevision rmr) |
void |
validate()
Validates the Validatable, throwing an
IllegalStateException if the current state is
not valid. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdownload, findIvyFileRef, getDependency, publishpublic ResolverSettings getSettings()
public ParserSettings getParserSettings()
public void setSettings(ResolverSettings ivy)
setSettings in interface DependencyResolverpublic java.lang.String getName()
getName in interface DependencyResolverpublic void setName(java.lang.String name)
DependencyResolversetName in interface DependencyResolvername - the new name of the resolverpublic java.lang.String hidePassword(java.lang.String name)
name - locationprotected boolean doValidate(ResolveData data)
public boolean isValidate()
public void setValidate(boolean validate)
protected void checkInterrupted()
public void reportFailure()
DependencyResolverreportFailure in interface DependencyResolverpublic void reportFailure(Artifact art)
DependencyResolverreportFailure in interface DependencyResolverart - Artifactpublic java.lang.String[] listTokenValues(java.lang.String token,
java.util.Map<java.lang.String,java.lang.String> otherTokenValues)
DependencyResolver
Note that listing does not take into account namespaces, and return raw
information without any namespace transformation. The caller is
responsible for calling namespace transformation with the Namespace
returned by DependencyResolver.getNamespace().
listTokenValues in interface DependencyResolvertoken - StringotherTokenValues - Mappublic java.util.Map<java.lang.String,java.lang.String>[] listTokenValues(java.lang.String[] tokens,
java.util.Map<java.lang.String,java.lang.Object> criteria)
DependencyResolverDependencyResolver.listTokenValues(String, Map) but more generic.listTokenValues in interface DependencyResolvertokens - the tokens of the querycriteria - the token which have valuesnullpublic OrganisationEntry[] listOrganisations()
listOrganisations in interface DependencyResolverpublic ModuleEntry[] listModules(OrganisationEntry org)
listModules in interface DependencyResolverpublic RevisionEntry[] listRevisions(ModuleEntry module)
listRevisions in interface DependencyResolverpublic java.lang.String toString()
toString in class java.lang.Objectpublic void dumpSettings()
dumpSettings in interface DependencyResolverpublic java.lang.String getTypeName()
public TimeoutConstraint getTimeoutConstraint()
public void setTimeoutConstraint(java.lang.String name)
public ArtifactDownloadReport download(ArtifactOrigin artifact, DownloadOptions options)
download in interface DependencyResolverartifact - ArtifactOriginoptions - DownloadOptionspublic boolean exists(Artifact artifact)
DependencyResolvertrue if the given artifact can be located by this resolver and actually
exist.exists in interface DependencyResolverartifact - the artifact which should be tested.true if the given artifact can be located by this resolver and actually
exist.public ArtifactOrigin locate(Artifact artifact)
locate in interface DependencyResolverartifact - ArtifactOriginpublic LatestStrategy getLatestStrategy()
getLatestStrategy in interface HasLatestStrategypublic void setLatestStrategy(LatestStrategy latestStrategy)
setLatestStrategy in interface HasLatestStrategypublic void setLatest(java.lang.String strategyName)
public java.lang.String getLatest()
getLatest in interface HasLatestStrategypublic Namespace getNamespace()
DependencyResolvergetNamespace in interface DependencyResolverpublic void setNamespace(java.lang.String namespaceName)
protected ModuleDescriptor toSystem(ModuleDescriptor md)
protected MetadataArtifactDownloadReport toSystem(MetadataArtifactDownloadReport report)
protected ResolvedModuleRevision toSystem(ResolvedModuleRevision rmr)
protected ModuleRevisionId toSystem(ModuleRevisionId resolvedMrid)
protected DependencyDescriptor fromSystem(DependencyDescriptor dd)
protected DependencyDescriptor toSystem(DependencyDescriptor dd)
protected IvyNode getSystemNode(ResolveData data, ModuleRevisionId resolvedMrid)
protected ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd, ResolveData data)
protected ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd, ResolveData data, boolean anyResolver)
public void setChangingMatcher(java.lang.String changingMatcherName)
protected java.lang.String getChangingMatcherName()
public void setChangingPattern(java.lang.String changingPattern)
protected java.lang.String getChangingPattern()
public void setCheckmodified(boolean check)
public RepositoryCacheManager getRepositoryCacheManager()
DependencyResolverRepositoryCacheManager used to manage the repository cache associated
with this dependency resolver.getRepositoryCacheManager in interface DependencyResolverRepositoryCacheManager used to manage the repository cache associated
with this dependency resolver.public void setRepositoryCacheManager(RepositoryCacheManager repositoryCacheManager)
public void setCache(java.lang.String cacheName)
public void setEventManager(EventManager eventManager)
public EventManager getEventManager()
public void validate()
ValidatableIllegalStateException if the current state is
not valid.validate in interface Validatableprotected CacheMetadataOptions getCacheOptions(ResolveData data)
protected CacheDownloadOptions getCacheDownloadOptions(DownloadOptions options)
protected DownloadOptions getDownloadOptions(ResolveOptions options)
public void abortPublishTransaction()
throws java.io.IOException
abortPublishTransaction in interface DependencyResolverjava.io.IOExceptionpublic void commitPublishTransaction()
throws java.io.IOException
commitPublishTransaction in interface DependencyResolverjava.io.IOExceptionpublic void beginPublishTransaction(ModuleRevisionId module, boolean overwrite) throws java.io.IOException
beginPublishTransaction in interface DependencyResolverjava.io.IOExceptionprotected boolean isAfter(ResolvedModuleRevision rmr1, ResolvedModuleRevision rmr2, java.util.Date date)
rmr1 - ResolvedModuleRevisionrmr2 - ResolvedModuleRevisiondate - Dateprotected ResolvedModuleRevision checkLatest(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound, ResolveData data)
protected void saveModuleRevisionIfNeeded(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound)
Copyright ©2007-2022 The Apache Software Foundation, Licensed under Apache License, Version 2.0.