org.apache.ivy.plugins.resolver

Class AbstractResolver

public abstract class AbstractResolver extends Object implements DependencyResolver, HasLatestStrategy, Validatable

This abstract resolver only provides handling for resolver name
Method Summary
voidabortPublishTransaction()
voidbeginPublishTransaction(ModuleRevisionId module, boolean overwrite)
protected voidcheckInterrupted()
protected ResolvedModuleRevisioncheckLatest(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound, ResolveData data)
voidcommitPublishTransaction()
protected booleandoValidate(ResolveData data)
ArtifactDownloadReportdownload(ArtifactOrigin artifact, DownloadOptions options)
Default implementation downloads the artifact without taking advantage of its location
voiddumpSettings()
booleanexists(Artifact artifact)
protected ResolvedModuleRevisionfindModuleInCache(DependencyDescriptor dd, ResolveData data)
protected ResolvedModuleRevisionfindModuleInCache(DependencyDescriptor dd, ResolveData data, boolean anyResolver)
protected ArtifactfromSystem(Artifact artifact)
protected DependencyDescriptorfromSystem(DependencyDescriptor dd)
protected CacheDownloadOptionsgetCacheDownloadOptions(DownloadOptions options)
protected CacheMetadataOptionsgetCacheOptions(ResolveData data)
protected StringgetChangingMatcherName()
protected StringgetChangingPattern()
protected DownloadOptionsgetDownloadOptions(ResolveOptions options)
EventManagergetEventManager()
StringgetLatest()
LatestStrategygetLatestStrategy()
StringgetName()
NamespacegetNamespace()
RepositoryCacheManagergetRepositoryCacheManager()
ResolverSettingsgetSettings()
protected IvyNodegetSystemNode(ResolveData data, ModuleRevisionId resolvedMrid)
StringgetTypeName()
StringhidePassword(String name)
this method should remove sensitive information from a location to be displayed in a log
protected booleanisAfter(ResolvedModuleRevision rmr1, ResolvedModuleRevision rmr2, Date date)
Returns true if rmr1 is after rmr2, using the latest strategy to determine which is the latest
booleanisValidate()
ModuleEntry[]listModules(OrganisationEntry org)
OrganisationEntry[]listOrganisations()
RevisionEntry[]listRevisions(ModuleEntry module)
String[]listTokenValues(String token, Map otherTokenValues)
Map[]listTokenValues(String[] tokens, Map criteria)
ArtifactOriginlocate(Artifact artifact)
Default implementation actually download the artifact Subclasses should overwrite this to avoid the download
voidreportFailure()
voidreportFailure(Artifact art)
protected voidsaveModuleRevisionIfNeeded(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound)
voidsetCache(String cacheName)
voidsetChangingMatcher(String changingMatcherName)
voidsetChangingPattern(String changingPattern)
voidsetCheckmodified(boolean check)
voidsetEventManager(EventManager eventManager)
voidsetLatest(String strategyName)
voidsetLatestStrategy(LatestStrategy latestStrategy)
voidsetName(String name)
voidsetNamespace(String namespaceName)
voidsetRepositoryCacheManager(RepositoryCacheManager repositoryCacheManager)
voidsetSettings(ResolverSettings ivy)
voidsetValidate(boolean validate)
StringtoString()
protected ModuleDescriptortoSystem(ModuleDescriptor md)
protected ArtifacttoSystem(Artifact artifact)
protected MetadataArtifactDownloadReporttoSystem(MetadataArtifactDownloadReport report)
protected ResolvedModuleRevisiontoSystem(ResolvedModuleRevision rmr)
protected ModuleRevisionIdtoSystem(ModuleRevisionId resolvedMrid)
protected DependencyDescriptortoSystem(DependencyDescriptor dd)
voidvalidate()

Method Detail

abortPublishTransaction

public void abortPublishTransaction()

beginPublishTransaction

public void beginPublishTransaction(ModuleRevisionId module, boolean overwrite)

checkInterrupted

protected void checkInterrupted()

checkLatest

protected ResolvedModuleRevision checkLatest(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound, ResolveData data)

commitPublishTransaction

public void commitPublishTransaction()

doValidate

protected boolean doValidate(ResolveData data)

download

public ArtifactDownloadReport download(ArtifactOrigin artifact, DownloadOptions options)
Default implementation downloads the artifact without taking advantage of its location

dumpSettings

public void dumpSettings()

exists

public boolean exists(Artifact artifact)

findModuleInCache

protected ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd, ResolveData data)

findModuleInCache

protected ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd, ResolveData data, boolean anyResolver)

fromSystem

protected Artifact fromSystem(Artifact artifact)

fromSystem

protected DependencyDescriptor fromSystem(DependencyDescriptor dd)

getCacheDownloadOptions

protected CacheDownloadOptions getCacheDownloadOptions(DownloadOptions options)

getCacheOptions

protected CacheMetadataOptions getCacheOptions(ResolveData data)

getChangingMatcherName

protected String getChangingMatcherName()

getChangingPattern

protected String getChangingPattern()

getDownloadOptions

protected DownloadOptions getDownloadOptions(ResolveOptions options)

getEventManager

public EventManager getEventManager()

getLatest

public String getLatest()

getLatestStrategy

public LatestStrategy getLatestStrategy()

getName

public String getName()

getNamespace

public Namespace getNamespace()

getRepositoryCacheManager

public RepositoryCacheManager getRepositoryCacheManager()

getSettings

public ResolverSettings getSettings()

getSystemNode

protected IvyNode getSystemNode(ResolveData data, ModuleRevisionId resolvedMrid)

getTypeName

public String getTypeName()

hidePassword

public String hidePassword(String name)
this method should remove sensitive information from a location to be displayed in a log

Parameters: name location

Returns: location with sensitive data replaced by stars

isAfter

protected boolean isAfter(ResolvedModuleRevision rmr1, ResolvedModuleRevision rmr2, Date date)
Returns true if rmr1 is after rmr2, using the latest strategy to determine which is the latest

Parameters: rmr1 rmr2

Returns:

isValidate

public boolean isValidate()

listModules

public ModuleEntry[] listModules(OrganisationEntry org)

listOrganisations

public OrganisationEntry[] listOrganisations()

listRevisions

public RevisionEntry[] listRevisions(ModuleEntry module)

listTokenValues

public String[] listTokenValues(String token, Map otherTokenValues)

listTokenValues

public Map[] listTokenValues(String[] tokens, Map criteria)

locate

public ArtifactOrigin locate(Artifact artifact)
Default implementation actually download the artifact Subclasses should overwrite this to avoid the download

reportFailure

public void reportFailure()

reportFailure

public void reportFailure(Artifact art)

saveModuleRevisionIfNeeded

protected void saveModuleRevisionIfNeeded(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound)

setCache

public void setCache(String cacheName)

setChangingMatcher

public void setChangingMatcher(String changingMatcherName)

setChangingPattern

public void setChangingPattern(String changingPattern)

setCheckmodified

public void setCheckmodified(boolean check)

setEventManager

public void setEventManager(EventManager eventManager)

setLatest

public void setLatest(String strategyName)

setLatestStrategy

public void setLatestStrategy(LatestStrategy latestStrategy)

setName

public void setName(String name)

setNamespace

public void setNamespace(String namespaceName)

setRepositoryCacheManager

public void setRepositoryCacheManager(RepositoryCacheManager repositoryCacheManager)

setSettings

public void setSettings(ResolverSettings ivy)

setValidate

public void setValidate(boolean validate)

toString

public String toString()

toSystem

protected ModuleDescriptor toSystem(ModuleDescriptor md)

toSystem

protected Artifact toSystem(Artifact artifact)

toSystem

protected MetadataArtifactDownloadReport toSystem(MetadataArtifactDownloadReport report)

toSystem

protected ResolvedModuleRevision toSystem(ResolvedModuleRevision rmr)

toSystem

protected ModuleRevisionId toSystem(ModuleRevisionId resolvedMrid)

toSystem

protected DependencyDescriptor toSystem(DependencyDescriptor dd)

validate

public void validate()