org.apache.ivy.plugins.resolver
Class AbstractResolver

java.lang.Object
  extended by org.apache.ivy.plugins.resolver.AbstractResolver
All Implemented Interfaces:
IvySettingsAware, DependencyResolver, HasLatestStrategy
Direct Known Subclasses:
BasicResolver, ChainResolver, DualResolver

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

This abstract resolver only provides handling for resolver name


Constructor Summary
AbstractResolver()
           
 
Method Summary
protected  void checkInterrupted()
           
protected  boolean doValidate(ResolveData data)
           
 void dumpSettings()
           
 boolean exists(Artifact artifact)
          Default implementation actually download the artifact Subclasses should overwrite this to avoid the download
protected  ResolvedModuleRevision findModuleInCache(ResolveData data, ModuleRevisionId mrid)
           
protected  Artifact fromSystem(Artifact artifact)
           
protected  DependencyDescriptor fromSystem(DependencyDescriptor dd)
           
 Matcher getChangingMatcher()
           
 java.lang.String getChangingMatcherName()
           
 java.lang.String getChangingPattern()
           
 java.lang.String getLatest()
           
 LatestStrategy getLatestStrategy()
           
 java.lang.String getName()
           
 Namespace getNamespace()
           
 IvySettings 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
 boolean isValidate()
           
 ModuleEntry[] listModules(OrganisationEntry org)
           
 OrganisationEntry[] listOrganisations()
           
 RevisionEntry[] listRevisions(ModuleEntry module)
           
 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.
 void reportFailure()
          Reports last resolve failure as Messages
 void reportFailure(Artifact art)
          Reports last artifact download failure as Messages
 void setChangingMatcher(java.lang.String changingMatcherName)
           
 void setChangingPattern(java.lang.String changingPattern)
           
 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 setSettings(IvySettings ivy)
           
 void setValidate(boolean validate)
           
 java.lang.String toString()
           
protected  Artifact toSystem(Artifact artifact)
           
protected  ModuleDescriptor toSystem(ModuleDescriptor md)
           
protected  ModuleRevisionId toSystem(ModuleRevisionId resolvedMrid)
           
protected  ResolvedModuleRevision toSystem(ResolvedModuleRevision rmr)
           
 
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, getDependency, publish
 

Constructor Detail

AbstractResolver

public AbstractResolver()
Method Detail

getSettings

public IvySettings getSettings()

setSettings

public void setSettings(IvySettings ivy)
Specified by:
setSettings in interface IvySettingsAware

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.

Specified by:
listTokenValues in interface DependencyResolver

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()

exists

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

Specified by:
exists in interface DependencyResolver

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()

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 ResolvedModuleRevision toSystem(ResolvedModuleRevision rmr)

toSystem

protected ModuleRevisionId toSystem(ModuleRevisionId resolvedMrid)

fromSystem

protected DependencyDescriptor fromSystem(DependencyDescriptor dd)

getSystemNode

protected IvyNode getSystemNode(ResolveData data,
                                ModuleRevisionId resolvedMrid)

findModuleInCache

protected ResolvedModuleRevision findModuleInCache(ResolveData data,
                                                   ModuleRevisionId mrid)

getChangingMatcherName

public java.lang.String getChangingMatcherName()

setChangingMatcher

public void setChangingMatcher(java.lang.String changingMatcherName)

getChangingPattern

public java.lang.String getChangingPattern()

setChangingPattern

public void setChangingPattern(java.lang.String changingPattern)

getChangingMatcher

public Matcher getChangingMatcher()