org.apache.ivy.plugins.resolver

## Class AbstractResolver

- java.lang.Object
- - org.apache.ivy.plugins.resolver.AbstractResolver

All Implemented Interfaces:
  Validatable, DependencyResolver, HasLatestStrategy

Direct Known Subclasses:
  BasicResolver, ChainResolver, DualResolver

    public abstract class AbstractResolver
    extends java.lang.Object
    implements DependencyResolver, HasLatestStrategy, Validatable

This abstract resolver only provides handling for resolver name

### Constructor Summary

Constructors
Constructor and Description
`AbstractResolver()`

### Method Summary

Methods
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.ivy.plugins.resolver.DependencyResolver

`download, findIvyFileRef, getDependency, publish`

### Constructor Detail

#### AbstractResolver

    public AbstractResolver()

### Method Detail

#### getSettings

    public ResolverSettings getSettings()

#### getParserSettings

    public ParserSettings getParserSettings()

#### setSettings

    public void setSettings(ResolverSettings ivy)

Specified by:
  `setSettings` in interface `DependencyResolver`

#### getName

    public java.lang.String getName()

Specified by:
  `getName` in interface `DependencyResolver`

#### setName

    public void setName(java.lang.String name)

Description copied from interface: `DependencyResolver`
Should only be used by configurator

Specified by:
  `setName` in interface `DependencyResolver`
Parameters:
  `name` - the new name of the resolver

#### hidePassword

    public java.lang.String hidePassword(java.lang.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

#### doValidate

    protected boolean doValidate(ResolveData data)

#### isValidate

    public boolean isValidate()

#### setValidate

    public void setValidate(boolean validate)

#### checkInterrupted

    protected void checkInterrupted()

#### reportFailure

    public void reportFailure()

Description copied from interface: `DependencyResolver`
Reports last resolve failure as Messages

Specified by:
  `reportFailure` in interface `DependencyResolver`

#### reportFailure

    public void reportFailure(Artifact art)

Description copied from interface: `DependencyResolver`
Reports last artifact download failure as Messages

Specified by:
  `reportFailure` in interface `DependencyResolver`

#### listTokenValues

    public java.lang.String[] listTokenValues(java.lang.String token,
                                     java.util.Map otherTokenValues)

Description copied from interface: `DependencyResolver`
List 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:
  `listTokenValues` in interface `DependencyResolver`

#### listTokenValues

    public java.util.Map[] listTokenValues(java.lang.String[] tokens,
                                  java.util.Map criteria)

Description copied from interface: `DependencyResolver`
Same as `DependencyResolver.listTokenValues(String, Map)` but more generic.

Specified by:
  `listTokenValues` in interface `DependencyResolver`
Parameters:
  `tokens` - the tokens of the query
  `criteria` - the token which have values
Returns:
  the list of token values (Map<Strin, String>[]), must not be `null`

#### listOrganisations

    public OrganisationEntry[] listOrganisations()

Specified by:
  `listOrganisations` in interface `DependencyResolver`

#### listModules

    public ModuleEntry[] listModules(OrganisationEntry org)

Specified by:
  `listModules` in interface `DependencyResolver`

#### listRevisions

    public RevisionEntry[] listRevisions(ModuleEntry module)

Specified by:
  `listRevisions` in interface `DependencyResolver`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### dumpSettings

    public void dumpSettings()

Specified by:
  `dumpSettings` in interface `DependencyResolver`

#### getTypeName

    public java.lang.String getTypeName()

#### download

    public ArtifactDownloadReport download(ArtifactOrigin artifact,
                                  DownloadOptions options)

Default implementation downloads the artifact without taking advantage of its location

Specified by:
  `download` in interface `DependencyResolver`
Parameters:
  `artifact` - the location of the artifact to download. Must not be `null`.
  `options` - options to apply for this download. Must not be `null`.
Returns:
  a report detailing how the download has gone, is never `null`.

#### exists

    public boolean exists(Artifact artifact)

Description copied from interface: `DependencyResolver`
Returns `true` if the given artifact can be located by this resolver and actually exist.

Specified by:
  `exists` in interface `DependencyResolver`
Parameters:
  `artifact` - the artifact which should be tested.
Returns:
  `true` if the given artifact can be located by this resolver and actually exist.

#### locate

    public ArtifactOrigin locate(Artifact artifact)

Default implementation actually download the artifact Subclasses should overwrite this to avoid the download

Specified by:
  `locate` in interface `DependencyResolver`
Parameters:
  `artifact` - the artifact which should be located
Returns:
  the artifact location, or `null` if it can't be located by this resolver or doesn't exist.

#### getLatestStrategy

    public LatestStrategy getLatestStrategy()

Specified by:
  `getLatestStrategy` in interface `HasLatestStrategy`

#### setLatestStrategy

    public void setLatestStrategy(LatestStrategy latestStrategy)

Specified by:
  `setLatestStrategy` in interface `HasLatestStrategy`

#### setLatest

    public void setLatest(java.lang.String strategyName)

#### getLatest

    public java.lang.String getLatest()

Specified by:
  `getLatest` in interface `HasLatestStrategy`

#### getNamespace

    public Namespace getNamespace()

Description copied from interface: `DependencyResolver`
Returns the namespace associated with this resolver.

Specified by:
  `getNamespace` in interface `DependencyResolver`
Returns:
  the namespace associated with this resolver.

#### setNamespace

    public void setNamespace(java.lang.String namespaceName)

#### toSystem

    protected ModuleDescriptor toSystem(ModuleDescriptor md)

#### fromSystem

    protected Artifact fromSystem(Artifact artifact)

#### toSystem

    protected Artifact toSystem(Artifact artifact)

#### toSystem

    protected MetadataArtifactDownloadReport toSystem(MetadataArtifactDownloadReport report)

#### toSystem

    protected ResolvedModuleRevision toSystem(ResolvedModuleRevision rmr)

#### toSystem

    protected ModuleRevisionId toSystem(ModuleRevisionId resolvedMrid)

#### fromSystem

    protected DependencyDescriptor fromSystem(DependencyDescriptor dd)

#### toSystem

    protected DependencyDescriptor toSystem(DependencyDescriptor dd)

#### getSystemNode

    protected IvyNode getSystemNode(ResolveData data,
                        ModuleRevisionId resolvedMrid)

#### findModuleInCache

    protected ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd,
                                           ResolveData data)

#### findModuleInCache

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

#### setChangingMatcher

    public void setChangingMatcher(java.lang.String changingMatcherName)

#### getChangingMatcherName

    protected java.lang.String getChangingMatcherName()

#### setChangingPattern

    public void setChangingPattern(java.lang.String changingPattern)

#### getChangingPattern

    protected java.lang.String getChangingPattern()

#### setCheckmodified

    public void setCheckmodified(boolean check)

#### getRepositoryCacheManager

    public RepositoryCacheManager getRepositoryCacheManager()

Description copied from interface: `DependencyResolver`
Returns the `RepositoryCacheManager` used to manage the repository cache associated with this dependency resolver.

Specified by:
  `getRepositoryCacheManager` in interface `DependencyResolver`
Returns:
  the `RepositoryCacheManager` used to manage the repository cache associated with this dependency resolver.

#### setRepositoryCacheManager

    public void setRepositoryCacheManager(RepositoryCacheManager repositoryCacheManager)

#### setCache

    public void setCache(java.lang.String cacheName)

#### setEventManager

    public void setEventManager(EventManager eventManager)

#### getEventManager

    public EventManager getEventManager()

#### validate

    public void validate()

Description copied from interface: `Validatable`
Validates the Validatable, throwing an `IllegalStateException` if the current state is not valid.

Specified by:
  `validate` in interface `Validatable`

#### getCacheOptions

    protected CacheMetadataOptions getCacheOptions(ResolveData data)

#### getCacheDownloadOptions

    protected CacheDownloadOptions getCacheDownloadOptions(DownloadOptions options)

#### getDownloadOptions

    protected DownloadOptions getDownloadOptions(ResolveOptions options)

#### abortPublishTransaction

    public void abortPublishTransaction()
                                 throws java.io.IOException

Specified by:
  `abortPublishTransaction` in interface `DependencyResolver`
Throws:
  `java.io.IOException`

#### commitPublishTransaction

    public void commitPublishTransaction()
                                  throws java.io.IOException

Specified by:
  `commitPublishTransaction` in interface `DependencyResolver`
Throws:
  `java.io.IOException`

#### beginPublishTransaction

    public void beginPublishTransaction(ModuleRevisionId module,
                               boolean overwrite)
                                 throws java.io.IOException

Specified by:
  `beginPublishTransaction` in interface `DependencyResolver`
Throws:
  `java.io.IOException`

#### isAfter

    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

Parameters:
  `rmr1` -
  `rmr2` -
Returns:

#### checkLatest

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

#### saveModuleRevisionIfNeeded

    protected void saveModuleRevisionIfNeeded(DependencyDescriptor dd,
                                  ResolvedModuleRevision newModuleFound)