Class AbstractResolver
java.lang.Object
org.apache.ivy.plugins.resolver.AbstractResolver
- All Implemented Interfaces:
Validatable, DependencyResolver, HasLatestStrategy
- Direct Known Subclasses:
AbstractWorkspaceResolver, BasicResolver, ChainResolver, DualResolver
public abstract class AbstractResolver
extends Object
implements DependencyResolver, HasLatestStrategy, Validatable
This abstract resolver only provides handling for resolver name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbeginPublishTransaction(ModuleRevisionId module, boolean overwrite) protected voidprotected ResolvedModuleRevisioncheckLatest(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound, ResolveData data) voidprotected booleandoValidate(ResolveData data) download(ArtifactOrigin artifact, DownloadOptions options) Default implementation downloads the artifact without taking advantage of its locationvoidbooleanReturnstrueif the given artifact can be located by this resolver and actually exist.protected ResolvedModuleRevisionfindModuleInCache(DependencyDescriptor dd, ResolveData data) protected ResolvedModuleRevisionfindModuleInCache(DependencyDescriptor dd, ResolveData data, boolean anyResolver) protected ArtifactfromSystem(Artifact artifact) protected DependencyDescriptorprotected CacheDownloadOptionsgetCacheDownloadOptions(DownloadOptions options) protected CacheMetadataOptionsgetCacheOptions(ResolveData data) protected Stringprotected Stringprotected DownloadOptionsgetDownloadOptions(ResolveOptions options) getName()Returns the namespace associated with this resolver.Returns theRepositoryCacheManagerused to manage the repository cache associated with this dependency resolver.protected IvyNodegetSystemNode(ResolveData data, ModuleRevisionId resolvedMrid) hidePassword(String name) this method should remove sensitive information from a location to be displayed in a logprotected booleanisAfter(ResolvedModuleRevision rmr1, ResolvedModuleRevision rmr2, Date date) Returns true if rmr1 is after rmr2, using the latest strategy to determine which is the latestbooleanlistRevisions(ModuleEntry module) listTokenValues(String[] tokens, Map<String, Object> criteria) Same asDependencyResolver.listTokenValues(String, Map)but more generic.String[]listTokenValues(String token, Map<String, String> otherTokenValues) List all the values the given token can take if other tokens are set as described in the otherTokenValues map.Default implementation actually download the artifact Subclasses should overwrite this to avoid the downloadvoidReports last resolve failure as MessagesvoidreportFailure(Artifact art) Reports last artifact download failure as Messagesprotected voidsaveModuleRevisionIfNeeded(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound) voidvoidsetChangingMatcher(String changingMatcherName) voidsetChangingPattern(String changingPattern) voidsetCheckmodified(boolean check) voidsetEventManager(EventManager eventManager) voidvoidsetLatestStrategy(LatestStrategy latestStrategy) voidShould only be used by configuratorvoidsetNamespace(String namespaceName) voidsetRepositoryCacheManager(RepositoryCacheManager repositoryCacheManager) voidvoidsetTimeoutConstraint(String name) voidsetValidate(boolean validate) toString()protected Artifactprotected DependencyDescriptorprotected ModuleDescriptorprotected ModuleRevisionIdtoSystem(ModuleRevisionId resolvedMrid) protected MetadataArtifactDownloadReportprotected ResolvedModuleRevisionvoidvalidate()Validates the Validatable, throwing anIllegalStateExceptionif the current state is not valid.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface DependencyResolver
download, findIvyFileRef, getDependency, publish
-
Constructor Details
-
AbstractResolver
public AbstractResolver()
-
-
Method Details
-
getSettings
-
getParserSettings
-
setSettings
- Specified by:
setSettingsin interfaceDependencyResolver
-
getName
- Specified by:
getNamein interfaceDependencyResolver
-
setName
Description copied from interface:DependencyResolverShould only be used by configurator- Specified by:
setNamein interfaceDependencyResolver- Parameters:
name- the new name of the resolver
-
hidePassword
-
doValidate
-
isValidate
public boolean isValidate() -
setValidate
public void setValidate(boolean validate) -
checkInterrupted
protected void checkInterrupted() -
reportFailure
public void reportFailure()Description copied from interface:DependencyResolverReports last resolve failure as Messages- Specified by:
reportFailurein interfaceDependencyResolver
-
reportFailure
Description copied from interface:DependencyResolverReports last artifact download failure as Messages- Specified by:
reportFailurein interfaceDependencyResolver- Parameters:
art- Artifact
-
listTokenValues
Description copied from interface:DependencyResolverList all the values the given token can take if other tokens are set as described in the otherTokenValues map. For instance, if token = "revision" and the map contains "organisation"->"foo" "module"->"bar" The results will be the list of revisions of the module bar from the org foo.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().- Specified by:
listTokenValuesin interfaceDependencyResolver- Parameters:
token- StringotherTokenValues- Map- Returns:
- String[]
-
listTokenValues
Description copied from interface:DependencyResolverSame asDependencyResolver.listTokenValues(String, Map)but more generic.- Specified by:
listTokenValuesin interfaceDependencyResolver- Parameters:
tokens- the tokens of the querycriteria- the token which have values- Returns:
- the list of token values, must not be
null
-
listOrganisations
- Specified by:
listOrganisationsin interfaceDependencyResolver
-
listModules
- Specified by:
listModulesin interfaceDependencyResolver
-
listRevisions
- Specified by:
listRevisionsin interfaceDependencyResolver
-
toString
-
dumpSettings
public void dumpSettings()- Specified by:
dumpSettingsin interfaceDependencyResolver
-
getTypeName
-
getTimeoutConstraint
-
setTimeoutConstraint
-
download
Default implementation downloads the artifact without taking advantage of its location- Specified by:
downloadin interfaceDependencyResolver- Parameters:
artifact- ArtifactOriginoptions- DownloadOptions- Returns:
- ArtifactDownloadReport
-
exists
Description copied from interface:DependencyResolverReturnstrueif the given artifact can be located by this resolver and actually exist.- Specified by:
existsin interfaceDependencyResolver- Parameters:
artifact- the artifact which should be tested.- Returns:
trueif the given artifact can be located by this resolver and actually exist.
-
locate
Default implementation actually download the artifact Subclasses should overwrite this to avoid the download- Specified by:
locatein interfaceDependencyResolver- Parameters:
artifact- ArtifactOrigin- Returns:
- ArtifactOrigin
-
getLatestStrategy
- Specified by:
getLatestStrategyin interfaceHasLatestStrategy
-
setLatestStrategy
- Specified by:
setLatestStrategyin interfaceHasLatestStrategy
-
setLatest
-
getLatest
- Specified by:
getLatestin interfaceHasLatestStrategy
-
getNamespace
Description copied from interface:DependencyResolverReturns the namespace associated with this resolver.- Specified by:
getNamespacein interfaceDependencyResolver- Returns:
- the namespace associated with this resolver.
-
setNamespace
-
toSystem
-
fromSystem
-
toSystem
-
toSystem
-
toSystem
-
toSystem
-
fromSystem
-
toSystem
-
getSystemNode
-
findModuleInCache
-
findModuleInCache
protected ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd, ResolveData data, boolean anyResolver) -
setChangingMatcher
-
getChangingMatcherName
-
setChangingPattern
-
getChangingPattern
-
setCheckmodified
public void setCheckmodified(boolean check) -
getRepositoryCacheManager
Description copied from interface:DependencyResolverReturns theRepositoryCacheManagerused to manage the repository cache associated with this dependency resolver.- Specified by:
getRepositoryCacheManagerin interfaceDependencyResolver- Returns:
- the
RepositoryCacheManagerused to manage the repository cache associated with this dependency resolver.
-
setRepositoryCacheManager
-
setCache
-
setEventManager
-
getEventManager
-
validate
public void validate()Description copied from interface:ValidatableValidates the Validatable, throwing anIllegalStateExceptionif the current state is not valid.- Specified by:
validatein interfaceValidatable
-
getCacheOptions
-
getCacheDownloadOptions
-
getDownloadOptions
-
abortPublishTransaction
- Specified by:
abortPublishTransactionin interfaceDependencyResolver- Throws:
IOException
-
commitPublishTransaction
- Specified by:
commitPublishTransactionin interfaceDependencyResolver- Throws:
IOException
-
beginPublishTransaction
- Specified by:
beginPublishTransactionin interfaceDependencyResolver- Throws:
IOException
-
isAfter
Returns true if rmr1 is after rmr2, using the latest strategy to determine which is the latest- Parameters:
rmr1- ResolvedModuleRevisionrmr2- ResolvedModuleRevisiondate- Date- Returns:
- boolean
-
checkLatest
protected ResolvedModuleRevision checkLatest(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound, ResolveData data) -
saveModuleRevisionIfNeeded
protected void saveModuleRevisionIfNeeded(DependencyDescriptor dd, ResolvedModuleRevision newModuleFound)
-