Interface DependencyResolver
-
- All Known Implementing Classes:
AbstractOSGiResolver
,AbstractPatternsBasedResolver
,AbstractResolver
,AbstractWorkspaceResolver
,AggregatedOSGiResolver
,BasicResolver
,BintrayResolver
,CacheResolver
,ChainResolver
,DualResolver
,FileSystemResolver
,IBiblioResolver
,IvyRepResolver
,JarResolver
,MirroredURLResolver
,OBRResolver
,PackagerResolver
,RepositoryResolver
,UpdateSiteResolver
,URLResolver
,VsftpResolver
,WorkspaceChainResolver
public interface DependencyResolver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abortPublishTransaction()
void
beginPublishTransaction(ModuleRevisionId module, boolean overwrite)
void
commitPublishTransaction()
ArtifactDownloadReport
download(ArtifactOrigin artifact, DownloadOptions options)
Download an artifact according to the given DownloadOptions.DownloadReport
download(Artifact[] artifacts, DownloadOptions options)
Download artifacts with specified DownloadOptions.void
dumpSettings()
boolean
exists(Artifact artifact)
Returnstrue
if the given artifact can be located by this resolver and actually exist.ResolvedResource
findIvyFileRef(DependencyDescriptor dd, ResolveData data)
Finds the module descriptor for the specified DependencyDescriptor.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.java.lang.String
getName()
Namespace
getNamespace()
Returns the namespace associated with this resolver.RepositoryCacheManager
getRepositoryCacheManager()
Returns theRepositoryCacheManager
used to manage the repository cache associated with this dependency resolver.ModuleEntry[]
listModules(OrganisationEntry org)
OrganisationEntry[]
listOrganisations()
RevisionEntry[]
listRevisions(ModuleEntry module)
java.util.Map<java.lang.String,java.lang.String>[]
listTokenValues(java.lang.String[] tokens, java.util.Map<java.lang.String,java.lang.Object> criteria)
Same aslistTokenValues(String, Map)
but more generic.java.lang.String[]
listTokenValues(java.lang.String token, java.util.Map<java.lang.String,java.lang.String> 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)
Locates the given artifact and returns its location if it can be located by this resolver and if it actually exists, ornull
in other cases.void
publish(Artifact artifact, java.io.File src, boolean overwrite)
void
reportFailure()
Reports last resolve failure as Messagesvoid
reportFailure(Artifact art)
Reports last artifact download failure as Messagesvoid
setName(java.lang.String name)
Should only be used by configuratorvoid
setSettings(ResolverSettings settings)
-
-
-
Method Detail
-
getName
java.lang.String getName()
-
setName
void setName(java.lang.String name)
Should only be used by configurator- Parameters:
name
- the new name of the resolver
-
getDependency
ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) throws java.text.ParseException
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 ##)- Parameters:
dd
- DependencyDescriptordata
- ResolveData- Returns:
- ResolvedModuleRevision
- Throws:
java.text.ParseException
- if something goes wrong
-
findIvyFileRef
ResolvedResource findIvyFileRef(DependencyDescriptor dd, ResolveData data)
Finds the module descriptor for the specified DependencyDescriptor. If this resolver can't find the module descriptor, null is returned.- Parameters:
dd
- the dependency descriptordata
- the resolve data- Returns:
- the module descriptor, or null
-
download
DownloadReport download(Artifact[] artifacts, DownloadOptions options)
Download artifacts with specified DownloadOptions.The 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 anArtifactDownloadReport
for each requested Artifact.- Parameters:
artifacts
- an array of artifacts to download. Must not benull
.options
- options to apply for this download. Must not benull
.- Returns:
- a DownloadReport with details about each Artifact download.
-
download
ArtifactDownloadReport download(ArtifactOrigin artifact, DownloadOptions options)
Download an artifact according to the given DownloadOptions.This methods is an alternative to
download(Artifact[], DownloadOptions)
, which locates and downloads a set of artifacts. This method uses anArtifactOrigin
, and as such is only used to materialize an already located Artifact.- Parameters:
artifact
- the location of the artifact to download. Must not benull
.options
- options to apply for this download. Must not benull
.- Returns:
- a report detailing how the download has gone, is never
null
.
-
exists
boolean exists(Artifact artifact)
Returnstrue
if the given artifact can be located by this resolver and actually exist.- Parameters:
artifact
- the artifact which should be tested.- Returns:
true
if the given artifact can be located by this resolver and actually exist.
-
locate
ArtifactOrigin locate(Artifact artifact)
Locates the given artifact and returns its location if it can be located by this resolver and if it actually exists, ornull
in other cases.- 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.
-
publish
void publish(Artifact artifact, java.io.File src, boolean overwrite) throws java.io.IOException
- Throws:
java.io.IOException
-
beginPublishTransaction
void beginPublishTransaction(ModuleRevisionId module, boolean overwrite) throws java.io.IOException
- Throws:
java.io.IOException
-
abortPublishTransaction
void abortPublishTransaction() throws java.io.IOException
- Throws:
java.io.IOException
-
commitPublishTransaction
void commitPublishTransaction() throws java.io.IOException
- Throws:
java.io.IOException
-
reportFailure
void reportFailure()
Reports last resolve failure as Messages
-
reportFailure
void reportFailure(Artifact art)
Reports last artifact download failure as Messages- Parameters:
art
- Artifact
-
listTokenValues
java.lang.String[] listTokenValues(java.lang.String token, java.util.Map<java.lang.String,java.lang.String> otherTokenValues)
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
getNamespace()
.- Parameters:
token
- StringotherTokenValues
- Map- Returns:
- String[]
-
listTokenValues
java.util.Map<java.lang.String,java.lang.String>[] listTokenValues(java.lang.String[] tokens, java.util.Map<java.lang.String,java.lang.Object> criteria)
Same aslistTokenValues(String, Map)
but more generic.- Parameters:
tokens
- the tokens of the querycriteria
- the token which have values- Returns:
- the list of token values, must not be
null
-
listOrganisations
OrganisationEntry[] listOrganisations()
-
listModules
ModuleEntry[] listModules(OrganisationEntry org)
-
listRevisions
RevisionEntry[] listRevisions(ModuleEntry module)
-
getNamespace
Namespace getNamespace()
Returns the namespace associated with this resolver.- Returns:
- the namespace associated with this resolver.
-
dumpSettings
void dumpSettings()
-
setSettings
void setSettings(ResolverSettings settings)
-
getRepositoryCacheManager
RepositoryCacheManager getRepositoryCacheManager()
Returns theRepositoryCacheManager
used to manage the repository cache associated with this dependency resolver.- Returns:
- the
RepositoryCacheManager
used to manage the repository cache associated with this dependency resolver.
-
-