fr.jayasoft.ivy.resolver
Class BasicResolver

java.lang.Object
  extended byfr.jayasoft.ivy.resolver.AbstractResolver
      extended byfr.jayasoft.ivy.resolver.BasicResolver
All Implemented Interfaces:
DependencyResolver, HasLatestStrategy, IvyAware
Direct Known Subclasses:
AbstractResourceResolver

public abstract class BasicResolver
extends AbstractResolver

Author:
Xavier Hanin

Field Summary
protected  java.lang.String _workspaceName
           
static java.text.SimpleDateFormat DATE_FORMAT
           
 
Constructor Summary
BasicResolver()
           
 
Method Summary
protected  boolean acceptLatest()
           
protected  void clearArtifactAttempts()
           
protected  void clearIvyAttempts()
           
 DownloadReport download(Artifact[] artifacts, Ivy ivy, java.io.File cache)
           
 boolean exists(Artifact artifact)
          Default implementation actually download the artifact Subclasses should overwrite this to avoid the download
protected abstract  ResolvedResource findArtifactRef(Artifact artifact, java.util.Date date)
           
protected  ResolvedResource findFirstArtifactRef(ModuleDescriptor md, DependencyDescriptor dd, ResolveData data)
           
protected abstract  ResolvedResource findIvyFileRef(DependencyDescriptor dd, ResolveData data)
           
protected abstract  java.util.Collection findNames(java.util.Map tokenValues, java.lang.String token)
           
protected abstract  long get(Resource resource, java.io.File ivyTempFile)
           
 ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data)
          Resolve a module by id, getting its module descriptor and resolving the revision if it's a latest one (i.e. a revision uniquely identifying the revision of a module in the current environment - If this revision is not able to identify uniquelely the revision of the module outside of the current environment, then the resolved revision must begin by ##)
protected  long getPublicationDate(ModuleDescriptor md, DependencyDescriptor dd, ResolveData data)
           
 java.lang.String getWorkspaceName()
           
 boolean isCheckconsistency()
           
 boolean isCheckmodified()
          True if this resolver should check lastmodified date to know if ivy files are up to date.
 boolean isEnvDependent()
           
 ModuleEntry[] listModules(OrganisationEntry org)
           
 OrganisationEntry[] listOrganisations()
           
 RevisionEntry[] listRevisions(ModuleEntry mod)
           
protected  void logArtifactAttempt(Artifact art, java.lang.String attempt)
           
protected abstract  void logArtifactNotFound(Artifact artifact)
           
protected  void logIvyAttempt(java.lang.String attempt)
           
protected abstract  void logIvyNotFound(ModuleRevisionId mrid)
           
 void reportFailure()
          Reports last resolve failure as Messages
 void reportFailure(Artifact art)
          Reports last artifact download failure as Messages
protected  ResolvedModuleRevision searchedRmr(ResolvedModuleRevision rmr)
           
 void setCheckconsistency(boolean checkConsitency)
           
 void setCheckmodified(boolean check)
           
 void setEnvDependent(boolean envDependent)
           
 void setWorkspaceName(java.lang.String workspaceName)
           
 java.lang.String toString()
           
 
Methods inherited from class fr.jayasoft.ivy.resolver.AbstractResolver
doValidate, dumpConfig, findModuleInCache, fromSystem, fromSystem, getIvy, getLatest, getLatestStrategy, getName, getNamespace, getSystemNode, getTypeName, isValidate, setIvy, setLatest, setLatestStrategy, setName, setNamespace, setValidate, toSystem, toSystem, toSystem, toSystem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fr.jayasoft.ivy.DependencyResolver
publish
 

Field Detail

DATE_FORMAT

public static final java.text.SimpleDateFormat DATE_FORMAT

_workspaceName

protected java.lang.String _workspaceName
Constructor Detail

BasicResolver

public BasicResolver()
Method Detail

getWorkspaceName

public java.lang.String getWorkspaceName()

setWorkspaceName

public void setWorkspaceName(java.lang.String workspaceName)

isEnvDependent

public boolean isEnvDependent()

setEnvDependent

public void setEnvDependent(boolean envDependent)

isCheckmodified

public boolean isCheckmodified()
True if this resolver should check lastmodified date to know if ivy files are up to date.

Returns:

setCheckmodified

public void setCheckmodified(boolean check)

getDependency

public ResolvedModuleRevision getDependency(DependencyDescriptor dd,
                                            ResolveData data)
                                     throws java.text.ParseException
Description copied from interface: DependencyResolver
Resolve a module by id, getting its module descriptor and resolving the revision if it's a latest one (i.e. a revision uniquely identifying the revision of a module in the current environment - If this revision is not able to identify uniquelely the revision of the module outside of the current environment, then the resolved revision must begin by ##)

Throws:
java.text.ParseException

clearIvyAttempts

protected void clearIvyAttempts()

searchedRmr

protected ResolvedModuleRevision searchedRmr(ResolvedModuleRevision rmr)

logIvyAttempt

protected void logIvyAttempt(java.lang.String attempt)

logArtifactAttempt

protected void logArtifactAttempt(Artifact art,
                                  java.lang.String attempt)

reportFailure

public void reportFailure()
Description copied from interface: DependencyResolver
Reports last resolve failure as Messages

Specified by:
reportFailure in interface DependencyResolver
Overrides:
reportFailure in class AbstractResolver

reportFailure

public void reportFailure(Artifact art)
Description copied from interface: DependencyResolver
Reports last artifact download failure as Messages

Specified by:
reportFailure in interface DependencyResolver
Overrides:
reportFailure in class AbstractResolver

acceptLatest

protected boolean acceptLatest()

download

public DownloadReport download(Artifact[] artifacts,
                               Ivy ivy,
                               java.io.File cache)

clearArtifactAttempts

protected void clearArtifactAttempts()

exists

public boolean exists(Artifact artifact)
Description copied from class: AbstractResolver
Default implementation actually download the artifact Subclasses should overwrite this to avoid the download

Specified by:
exists in interface DependencyResolver
Overrides:
exists in class AbstractResolver

getPublicationDate

protected long getPublicationDate(ModuleDescriptor md,
                                  DependencyDescriptor dd,
                                  ResolveData data)

toString

public java.lang.String toString()
Overrides:
toString in class AbstractResolver

listOrganisations

public OrganisationEntry[] listOrganisations()
Specified by:
listOrganisations in interface DependencyResolver
Overrides:
listOrganisations in class AbstractResolver

listModules

public ModuleEntry[] listModules(OrganisationEntry org)
Specified by:
listModules in interface DependencyResolver
Overrides:
listModules in class AbstractResolver

listRevisions

public RevisionEntry[] listRevisions(ModuleEntry mod)
Specified by:
listRevisions in interface DependencyResolver
Overrides:
listRevisions in class AbstractResolver

findNames

protected abstract java.util.Collection findNames(java.util.Map tokenValues,
                                                  java.lang.String token)

findIvyFileRef

protected abstract ResolvedResource findIvyFileRef(DependencyDescriptor dd,
                                                   ResolveData data)

findFirstArtifactRef

protected ResolvedResource findFirstArtifactRef(ModuleDescriptor md,
                                                DependencyDescriptor dd,
                                                ResolveData data)

findArtifactRef

protected abstract ResolvedResource findArtifactRef(Artifact artifact,
                                                    java.util.Date date)

get

protected abstract long get(Resource resource,
                            java.io.File ivyTempFile)
                     throws java.io.IOException
Throws:
java.io.IOException

logIvyNotFound

protected abstract void logIvyNotFound(ModuleRevisionId mrid)

logArtifactNotFound

protected abstract void logArtifactNotFound(Artifact artifact)

isCheckconsistency

public boolean isCheckconsistency()

setCheckconsistency

public void setCheckconsistency(boolean checkConsitency)