org.apache.ivy.core.cache
Interface RepositoryCacheManager

All Known Implementing Classes:
CacheManager

public interface RepositoryCacheManager


Method Summary
 ResolvedModuleRevision cacheModuleDescriptor(DependencyResolver resolver, ResolvedResource orginalMetadataRef, Artifact requestedMetadataArtifact, ResourceDownloader downloader, CacheMetadataOptions options)
           
 ArtifactDownloadReport download(Artifact artifact, ArtifactResourceResolver resourceResolver, ResourceDownloader resourceDownloader, CacheDownloadOptions options)
          Downloads an artifact to this cache.
 ResolvedModuleRevision findModuleInCache(ModuleRevisionId mrid, boolean validate, java.lang.String expectedResolver)
          Search a module descriptor in cache for a mrid
 java.io.File getArchiveFileInCache(Artifact artifact)
          Returns a File object pointing to where the artifact can be found on the local file system.
 java.io.File getArchiveFileInCache(Artifact artifact, ArtifactOrigin origin)
          Returns a File object pointing to where the artifact can be found on the local file system.
 java.io.File getArchiveFileInCache(Artifact artifact, ArtifactOrigin origin, boolean useOrigin)
          Returns a File object pointing to where the artifact can be found on the local file system, using or not the original location depending on the availability of origin information provided as parameter and the setting of useOrigin.
 java.lang.String getArchivePathInCache(Artifact artifact)
           
 java.lang.String getArchivePathInCache(Artifact artifact, ArtifactOrigin origin)
           
 java.io.File getIvyFileInCache(ModuleRevisionId mrid)
           
 java.io.File getRepositoryCacheRoot()
           
 ArtifactOrigin getSavedArtifactOrigin(Artifact artifact)
           
 void originalToCachedModuleDescriptor(DependencyResolver resolver, ResolvedResource orginalMetadataRef, Artifact requestedMetadataArtifact, ModuleDescriptor md, ModuleDescriptorWriter writer)
           
 void saveResolvers(ModuleDescriptor descriptor, java.lang.String metadataResolverName, java.lang.String artifactResolverName)
          Saves the information of which resolvers were used to resolve a module (both for metadata and artifact), so that this info can be loaded later (even after a jvm restart) for the use of findModuleInCache(ModuleRevisionId, boolean, String).
 

Method Detail

getRepositoryCacheRoot

java.io.File getRepositoryCacheRoot()

getIvyFileInCache

java.io.File getIvyFileInCache(ModuleRevisionId mrid)

getArchiveFileInCache

java.io.File getArchiveFileInCache(Artifact artifact)
Returns a File object pointing to where the artifact can be found on the local file system. This is usually in the cache, but it can be directly in the repository if it is local and if the resolve has been done with useOrigin = true


getArchiveFileInCache

java.io.File getArchiveFileInCache(Artifact artifact,
                                   ArtifactOrigin origin)
Returns a File object pointing to where the artifact can be found on the local file system. This is usually in the cache, but it can be directly in the repository if it is local and if the resolve has been done with useOrigin = true


getArchiveFileInCache

java.io.File getArchiveFileInCache(Artifact artifact,
                                   ArtifactOrigin origin,
                                   boolean useOrigin)
Returns a File object pointing to where the artifact can be found on the local file system, using or not the original location depending on the availability of origin information provided as parameter and the setting of useOrigin. If useOrigin is false, this method will always return the file in the cache.


getArchivePathInCache

java.lang.String getArchivePathInCache(Artifact artifact)

getArchivePathInCache

java.lang.String getArchivePathInCache(Artifact artifact,
                                       ArtifactOrigin origin)

saveResolvers

void saveResolvers(ModuleDescriptor descriptor,
                   java.lang.String metadataResolverName,
                   java.lang.String artifactResolverName)
Saves the information of which resolvers were used to resolve a module (both for metadata and artifact), so that this info can be loaded later (even after a jvm restart) for the use of findModuleInCache(ModuleRevisionId, boolean, String).

Parameters:
md - the module descriptor resolved
metadataResolverName - metadata resolver name
artifactResolverName - artifact resolver name

getSavedArtifactOrigin

ArtifactOrigin getSavedArtifactOrigin(Artifact artifact)

findModuleInCache

ResolvedModuleRevision findModuleInCache(ModuleRevisionId mrid,
                                         boolean validate,
                                         java.lang.String expectedResolver)
Search a module descriptor in cache for a mrid

Parameters:
mrid - the id of the module to search
validate - true to validate ivy file found in cache before returning
expectedResolver - the resolver with which the md in cache must have been resolved to be returned, null if this doesn't matter
Returns:
the ResolvedModuleRevision corresponding to the module found, null if none correct has been found in cache

download

ArtifactDownloadReport download(Artifact artifact,
                                ArtifactResourceResolver resourceResolver,
                                ResourceDownloader resourceDownloader,
                                CacheDownloadOptions options)
Downloads an artifact to this cache.

Parameters:
artifact - the artifact to download
resourceResolver - a resource resolver to use if the artifact needs to be resolved to a Resource for downloading
resourceDownloader - a resource downloader to use if actual download of the resource is needed
options - a set of options to adjust the download
Returns:
a report indicating how the download was performed

cacheModuleDescriptor

ResolvedModuleRevision cacheModuleDescriptor(DependencyResolver resolver,
                                             ResolvedResource orginalMetadataRef,
                                             Artifact requestedMetadataArtifact,
                                             ResourceDownloader downloader,
                                             CacheMetadataOptions options)
                                             throws java.text.ParseException
Throws:
java.text.ParseException

originalToCachedModuleDescriptor

void originalToCachedModuleDescriptor(DependencyResolver resolver,
                                      ResolvedResource orginalMetadataRef,
                                      Artifact requestedMetadataArtifact,
                                      ModuleDescriptor md,
                                      ModuleDescriptorWriter writer)