public abstract class BasicResolver extends AbstractResolver
| Modifier and Type | Field and Description |
|---|---|
static java.text.SimpleDateFormat |
DATE_FORMAT |
static java.lang.String |
DESCRIPTOR_OPTIONAL |
static java.lang.String |
DESCRIPTOR_REQUIRED |
| Constructor and Description |
|---|
BasicResolver() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
acceptLatest() |
protected void |
checkModuleDescriptorRevision(ModuleDescriptor systemMd,
ModuleRevisionId systemMrid) |
protected void |
clearArtifactAttempts() |
protected void |
clearIvyAttempts() |
ResolvedResource |
doFindArtifactRef(Artifact artifact,
java.util.Date date) |
DownloadReport |
download(Artifact[] artifacts,
DownloadOptions options)
Download artifacts with specified DownloadOptions.
|
ArtifactDownloadReport |
download(ArtifactOrigin origin,
DownloadOptions options)
Default implementation downloads the artifact without taking advantage of its location
|
boolean |
exists(Artifact artifact)
Returns
true if the given artifact can be located by this resolver and actually
exist. |
protected java.util.Collection |
filterNames(java.util.Collection names)
Filters names before returning them in the findXXXNames or findTokenValues method.
|
protected abstract ResolvedResource |
findArtifactRef(Artifact artifact,
java.util.Date date) |
protected ResolvedResource |
findFirstArtifactRef(ModuleDescriptor md,
DependencyDescriptor dd,
ResolveData data) |
protected abstract java.util.Collection |
findNames(java.util.Map tokenValues,
java.lang.String token) |
ResolvedResource |
findResource(ResolvedResource[] rress,
ResourceMDParser rmdparser,
ModuleRevisionId mrid,
java.util.Date date)
When the resolver has many choices, this function helps choosing one
|
protected abstract long |
get(Resource resource,
java.io.File dest) |
protected long |
getAndCheck(Resource resource,
java.io.File dest) |
protected ResolvedResource |
getArtifactRef(Artifact artifact,
java.util.Date date) |
java.lang.String[] |
getChecksumAlgorithms() |
protected ResourceMDParser |
getDefaultRMDParser(ModuleId mid) |
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 uniquely 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) |
protected abstract Resource |
getResource(java.lang.String source) |
protected ResourceMDParser |
getRMDParser(DependencyDescriptor dd,
ResolveData data) |
java.lang.String |
getWorkspaceName() |
boolean |
isAllownomd() |
boolean |
isCheckconsistency() |
boolean |
isEnvDependent() |
boolean |
isForce() |
ModuleEntry[] |
listModules(OrganisationEntry org) |
OrganisationEntry[] |
listOrganisations() |
RevisionEntry[] |
listRevisions(ModuleEntry mod) |
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
|
protected void |
logArtifactAttempt(Artifact art,
java.lang.String attempt) |
protected void |
logAttempt(java.lang.String attempt) |
protected void |
logIvyAttempt(java.lang.String attempt) |
ResolvedModuleRevision |
parse(ResolvedResource mdRef,
DependencyDescriptor dd,
ResolveData data) |
void |
reportFailure()
Reports last resolve failure as Messages
|
void |
reportFailure(Artifact art)
Reports last artifact download failure as Messages
|
void |
setAllownomd(boolean b) |
void |
setCheckconsistency(boolean checkConsitency) |
void |
setChecksums(java.lang.String checksums) |
void |
setDescriptor(java.lang.String descriptorRule)
Sets the module descriptor presence rule.
|
void |
setEnvDependent(boolean envDependent) |
void |
setForce(boolean force) |
void |
setWorkspaceName(java.lang.String workspaceName) |
protected boolean |
shouldReturnResolvedModule(DependencyDescriptor dd,
ResolvedModuleRevision mr) |
java.lang.String |
toString() |
abortPublishTransaction, beginPublishTransaction, checkInterrupted, checkLatest, commitPublishTransaction, doValidate, dumpSettings, findModuleInCache, findModuleInCache, fromSystem, fromSystem, getCacheDownloadOptions, getCacheOptions, getChangingMatcherName, getChangingPattern, getDownloadOptions, getEventManager, getLatest, getLatestStrategy, getName, getNamespace, getParserSettings, getRepositoryCacheManager, getSettings, getSystemNode, getTypeName, hidePassword, isAfter, isValidate, listTokenValues, saveModuleRevisionIfNeeded, setCache, setChangingMatcher, setChangingPattern, setCheckmodified, setEventManager, setLatest, setLatestStrategy, setName, setNamespace, setRepositoryCacheManager, setSettings, setValidate, toSystem, toSystem, toSystem, toSystem, toSystem, toSystem, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindIvyFileRef, publishpublic static final java.lang.String DESCRIPTOR_OPTIONAL
public static final java.lang.String DESCRIPTOR_REQUIRED
public static final java.text.SimpleDateFormat DATE_FORMAT
public java.lang.String getWorkspaceName()
public void setWorkspaceName(java.lang.String workspaceName)
public boolean isEnvDependent()
public void setEnvDependent(boolean envDependent)
public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) throws java.text.ParseException
DependencyResolverjava.text.ParseExceptionprotected boolean shouldReturnResolvedModule(DependencyDescriptor dd, ResolvedModuleRevision mr)
protected void checkModuleDescriptorRevision(ModuleDescriptor systemMd, ModuleRevisionId systemMrid)
public ResolvedModuleRevision parse(ResolvedResource mdRef, DependencyDescriptor dd, ResolveData data) throws java.text.ParseException
java.text.ParseExceptionprotected ResourceMDParser getRMDParser(DependencyDescriptor dd, ResolveData data)
protected ResourceMDParser getDefaultRMDParser(ModuleId mid)
public ResolvedResource findResource(ResolvedResource[] rress, ResourceMDParser rmdparser, ModuleRevisionId mrid, java.util.Date date)
rress - the list of resolved resource which the resolver found to fit the requirementrmdparser - the parser of module descriptormrid - the module being resolveddate - the current dateprotected java.util.Collection filterNames(java.util.Collection names)
Remember to call the super implementation when overriding this method.
names - the list to filter.protected void clearIvyAttempts()
protected void logIvyAttempt(java.lang.String attempt)
protected void logArtifactAttempt(Artifact art, java.lang.String attempt)
protected void logAttempt(java.lang.String attempt)
public void reportFailure()
DependencyResolverreportFailure in interface DependencyResolverreportFailure in class AbstractResolverpublic void reportFailure(Artifact art)
DependencyResolverreportFailure in interface DependencyResolverreportFailure in class AbstractResolverprotected boolean acceptLatest()
public DownloadReport download(Artifact[] artifacts, DownloadOptions options)
DependencyResolverThe resolver will always make a best effort, and do not stop when an artifact is not available. It rather continue to attempt to download other requested artifacts, and report what has been done in the returned DownloadReport.
The returned DownloadReport is never null, and always contain an
ArtifactDownloadReport for each requested Artifact.
artifacts - an array of artifacts to download. Must not be null.options - options to apply for this download. Must not be null.protected void clearArtifactAttempts()
public ArtifactDownloadReport download(ArtifactOrigin origin, DownloadOptions options)
AbstractResolverdownload in interface DependencyResolverdownload in class AbstractResolverorigin - the location of the artifact to download. Must not be null.options - options to apply for this download. Must not be null.null.protected abstract Resource getResource(java.lang.String source) throws java.io.IOException
java.io.IOExceptionpublic boolean exists(Artifact artifact)
DependencyResolvertrue if the given artifact can be located by this resolver and actually
exist.exists in interface DependencyResolverexists in class AbstractResolverartifact - the artifact which should be tested.true if the given artifact can be located by this resolver and actually
exist.public ArtifactOrigin locate(Artifact artifact)
AbstractResolverlocate in interface DependencyResolverlocate in class AbstractResolverartifact - the artifact which should be locatednull if it can't be located by this resolver
or doesn't exist.protected long getPublicationDate(ModuleDescriptor md, DependencyDescriptor dd, ResolveData data)
public java.lang.String toString()
toString in class AbstractResolverpublic java.lang.String[] listTokenValues(java.lang.String token,
java.util.Map otherTokenValues)
DependencyResolver
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().
listTokenValues in interface DependencyResolverlistTokenValues in class AbstractResolverpublic OrganisationEntry[] listOrganisations()
listOrganisations in interface DependencyResolverlistOrganisations in class AbstractResolverpublic ModuleEntry[] listModules(OrganisationEntry org)
listModules in interface DependencyResolverlistModules in class AbstractResolverpublic RevisionEntry[] listRevisions(ModuleEntry mod)
listRevisions in interface DependencyResolverlistRevisions in class AbstractResolverprotected abstract java.util.Collection findNames(java.util.Map tokenValues,
java.lang.String token)
protected ResolvedResource findFirstArtifactRef(ModuleDescriptor md, DependencyDescriptor dd, ResolveData data)
protected long getAndCheck(Resource resource, java.io.File dest) throws java.io.IOException
java.io.IOExceptionprotected ResolvedResource getArtifactRef(Artifact artifact, java.util.Date date)
public ResolvedResource doFindArtifactRef(Artifact artifact, java.util.Date date)
protected abstract ResolvedResource findArtifactRef(Artifact artifact, java.util.Date date)
protected abstract long get(Resource resource, java.io.File dest) throws java.io.IOException
java.io.IOExceptionpublic boolean isCheckconsistency()
public void setCheckconsistency(boolean checkConsitency)
public void setForce(boolean force)
public boolean isForce()
public boolean isAllownomd()
public void setAllownomd(boolean b)
public void setDescriptor(java.lang.String descriptorRule)
DESCRIPTOR_REQUIRED or
DESCRIPTOR_OPTIONAL.descriptorRule - the descriptor rule to use with this resolver.public java.lang.String[] getChecksumAlgorithms()
public void setChecksums(java.lang.String checksums)