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) |
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[] |
listTokenValues(java.lang.String[] tokens,
java.util.Map criteria)
Same as
DependencyResolver.listTokenValues(String, Map) but more generic. |
java.lang.String[] |
listTokenValues(java.lang.String token,
java.util.Map 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 |
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, wait
download, findIvyFileRef, getDependency, publish
public ResolverSettings getSettings()
public ParserSettings getParserSettings()
public void setSettings(ResolverSettings ivy)
setSettings
in interface DependencyResolver
public java.lang.String getName()
getName
in interface DependencyResolver
public void setName(java.lang.String name)
DependencyResolver
setName
in interface DependencyResolver
name
- 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()
DependencyResolver
reportFailure
in interface DependencyResolver
public void reportFailure(Artifact art)
DependencyResolver
reportFailure
in interface DependencyResolver
public java.lang.String[] listTokenValues(java.lang.String token, java.util.Map 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 DependencyResolver
public java.util.Map[] listTokenValues(java.lang.String[] tokens, java.util.Map criteria)
DependencyResolver
DependencyResolver.listTokenValues(String, Map)
but more generic.listTokenValues
in interface DependencyResolver
tokens
- the tokens of the querycriteria
- the token which have valuesnull
public OrganisationEntry[] listOrganisations()
listOrganisations
in interface DependencyResolver
public ModuleEntry[] listModules(OrganisationEntry org)
listModules
in interface DependencyResolver
public RevisionEntry[] listRevisions(ModuleEntry module)
listRevisions
in interface DependencyResolver
public java.lang.String toString()
toString
in class java.lang.Object
public void dumpSettings()
dumpSettings
in interface DependencyResolver
public java.lang.String getTypeName()
public ArtifactDownloadReport download(ArtifactOrigin artifact, DownloadOptions options)
download
in interface DependencyResolver
artifact
- the location of the artifact to download. Must not be null
.options
- options to apply for this download. Must not be null
.null
.public boolean exists(Artifact artifact)
DependencyResolver
true
if the given artifact can be located by this resolver and actually
exist.exists
in interface DependencyResolver
artifact
- 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 DependencyResolver
artifact
- the artifact which should be locatednull
if it can't be located by this resolver
or doesn't exist.public LatestStrategy getLatestStrategy()
getLatestStrategy
in interface HasLatestStrategy
public void setLatestStrategy(LatestStrategy latestStrategy)
setLatestStrategy
in interface HasLatestStrategy
public void setLatest(java.lang.String strategyName)
public java.lang.String getLatest()
getLatest
in interface HasLatestStrategy
public Namespace getNamespace()
DependencyResolver
getNamespace
in interface DependencyResolver
public 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()
DependencyResolver
RepositoryCacheManager
used to manage the repository cache associated
with this dependency resolver.getRepositoryCacheManager
in interface DependencyResolver
RepositoryCacheManager
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()
Validatable
IllegalStateException
if the current state is
not valid.validate
in interface Validatable
protected CacheMetadataOptions getCacheOptions(ResolveData data)
protected CacheDownloadOptions getCacheDownloadOptions(DownloadOptions options)
protected DownloadOptions getDownloadOptions(ResolveOptions options)
public void abortPublishTransaction() throws java.io.IOException
abortPublishTransaction
in interface DependencyResolver
java.io.IOException
public void commitPublishTransaction() throws java.io.IOException
commitPublishTransaction
in interface DependencyResolver
java.io.IOException
public void beginPublishTransaction(ModuleRevisionId module, boolean overwrite) throws java.io.IOException
beginPublishTransaction
in interface DependencyResolver
java.io.IOException
protected boolean isAfter(ResolvedModuleRevision rmr1, ResolvedModuleRevision rmr2, java.util.Date date)
rmr1
- rmr2
- protected ResolvedModuleRevision checkLatest(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound, ResolveData data)
protected void saveModuleRevisionIfNeeded(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound)