org.apache.ivy.core.cache

Class DefaultRepositoryCacheManager

public class DefaultRepositoryCacheManager extends Object implements RepositoryCacheManager, IvySettingsAware

Constructor Summary
DefaultRepositoryCacheManager()
DefaultRepositoryCacheManager(String name, IvySettings settings, File basedir)
Method Summary
voidaddConfiguredTtl(Map attributes)
voidaddTTL(Map attributes, PatternMatcher matcher, long duration)
ResolvedModuleRevisioncacheModuleDescriptor(DependencyResolver resolver, ResolvedResource mdRef, DependencyDescriptor dd, Artifact moduleArtifact, ResourceDownloader downloader, CacheMetadataOptions options)
voidclean()
ArtifactDownloadReportdownload(Artifact artifact, ArtifactResourceResolver resourceResolver, ResourceDownloader resourceDownloader, CacheDownloadOptions options)
voiddumpSettings()
ResolvedModuleRevisionfindModuleInCache(DependencyDescriptor dd, ModuleRevisionId requestedRevisionId, CacheMetadataOptions options, String expectedResolver)
FilegetArchiveFileInCache(Artifact artifact)
Returns a File object pointing to where the artifact can be found on the local file system.
FilegetArchiveFileInCache(Artifact artifact, ArtifactOrigin origin)
Returns a File object pointing to where the artifact can be found on the local file system.
StringgetArchivePathInCache(Artifact artifact)
StringgetArchivePathInCache(Artifact artifact, ArtifactOrigin origin)
StringgetArtifactPattern()
FilegetBasedir()
StringgetChangingMatcherName()
StringgetChangingPattern()
StringgetDataFilePattern()
longgetDefaultTTL()
FilegetIvyFileInCache(ModuleRevisionId mrid)
StringgetIvyPattern()
LockStrategygetLockStrategy()
ModuleDescriptorMemoryCachegetMemoryCache()
StringgetName()
ArtifactgetOriginalMetadataArtifact(Artifact moduleArtifact)
FilegetRepositoryCacheRoot()
ArtifactOrigingetSavedArtifactOrigin(Artifact artifact)
IvySettingsgetSettings()
longgetTTL(ModuleRevisionId mrid)
booleanisCheckmodified()
True if this cache should check lastmodified date to know if ivy files are up to date.
booleanisUseOrigin()
True if this cache should use artifacts original location when possible, false if they should be copied to cache.
voidoriginalToCachedModuleDescriptor(DependencyResolver resolver, ResolvedResource orginalMetadataRef, Artifact requestedMetadataArtifact, ResolvedModuleRevision rmr, ModuleDescriptorWriter writer)
voidsaveResolvedRevision(ModuleRevisionId mrid, String revision)
voidsaveResolvers(ModuleDescriptor md, String metadataResolverName, String artifactResolverName)
Saves the information of which resolver was used to resolve a md, so that this info can be retrieve later (even after a jvm restart) by getSavedArtResolverName(ModuleDescriptor md)
voidsetArtifactPattern(String artifactPattern)
voidsetBasedir(File cache)
voidsetChangingMatcher(String changingMatcherName)
voidsetChangingPattern(String changingPattern)
voidsetCheckmodified(boolean check)
voidsetDataFilePattern(String dataFilePattern)
voidsetDefaultTTL(long defaultTTL)
voidsetDefaultTTL(String defaultTTL)
voidsetIvyPattern(String ivyPattern)
voidsetLockStrategy(LockStrategy lockStrategy)
voidsetLockStrategy(String lockStrategyName)
voidsetMemorySize(int size)
voidsetName(String name)
voidsetSettings(IvySettings settings)
voidsetUseOrigin(boolean b)
StringtoString()

Constructor Detail

DefaultRepositoryCacheManager

public DefaultRepositoryCacheManager()

DefaultRepositoryCacheManager

public DefaultRepositoryCacheManager(String name, IvySettings settings, File basedir)

Method Detail

addConfiguredTtl

public void addConfiguredTtl(Map attributes)

addTTL

public void addTTL(Map attributes, PatternMatcher matcher, long duration)

cacheModuleDescriptor

public ResolvedModuleRevision cacheModuleDescriptor(DependencyResolver resolver, ResolvedResource mdRef, DependencyDescriptor dd, Artifact moduleArtifact, ResourceDownloader downloader, CacheMetadataOptions options)

clean

public void clean()

download

public ArtifactDownloadReport download(Artifact artifact, ArtifactResourceResolver resourceResolver, ResourceDownloader resourceDownloader, CacheDownloadOptions options)

dumpSettings

public void dumpSettings()

findModuleInCache

public ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd, ModuleRevisionId requestedRevisionId, CacheMetadataOptions options, String expectedResolver)

getArchiveFileInCache

public 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

public 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

getArchivePathInCache

public String getArchivePathInCache(Artifact artifact)

getArchivePathInCache

public String getArchivePathInCache(Artifact artifact, ArtifactOrigin origin)

getArtifactPattern

public String getArtifactPattern()

getBasedir

public File getBasedir()

getChangingMatcherName

public String getChangingMatcherName()

getChangingPattern

public String getChangingPattern()

getDataFilePattern

public String getDataFilePattern()

getDefaultTTL

public long getDefaultTTL()

getIvyFileInCache

public File getIvyFileInCache(ModuleRevisionId mrid)

getIvyPattern

public String getIvyPattern()

getLockStrategy

public LockStrategy getLockStrategy()

getMemoryCache

public ModuleDescriptorMemoryCache getMemoryCache()

getName

public String getName()

getOriginalMetadataArtifact

public Artifact getOriginalMetadataArtifact(Artifact moduleArtifact)

getRepositoryCacheRoot

public File getRepositoryCacheRoot()

getSavedArtifactOrigin

public ArtifactOrigin getSavedArtifactOrigin(Artifact artifact)

getSettings

public IvySettings getSettings()

getTTL

public long getTTL(ModuleRevisionId mrid)

isCheckmodified

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

Returns:

isUseOrigin

public boolean isUseOrigin()
True if this cache should use artifacts original location when possible, false if they should be copied to cache.

originalToCachedModuleDescriptor

public void originalToCachedModuleDescriptor(DependencyResolver resolver, ResolvedResource orginalMetadataRef, Artifact requestedMetadataArtifact, ResolvedModuleRevision rmr, ModuleDescriptorWriter writer)

saveResolvedRevision

public void saveResolvedRevision(ModuleRevisionId mrid, String revision)

saveResolvers

public void saveResolvers(ModuleDescriptor md, String metadataResolverName, String artifactResolverName)
Saves the information of which resolver was used to resolve a md, so that this info can be retrieve later (even after a jvm restart) by getSavedArtResolverName(ModuleDescriptor md)

Parameters: md the module descriptor resolved name artifact resolver name

setArtifactPattern

public void setArtifactPattern(String artifactPattern)

setBasedir

public void setBasedir(File cache)

setChangingMatcher

public void setChangingMatcher(String changingMatcherName)

setChangingPattern

public void setChangingPattern(String changingPattern)

setCheckmodified

public void setCheckmodified(boolean check)

setDataFilePattern

public void setDataFilePattern(String dataFilePattern)

setDefaultTTL

public void setDefaultTTL(long defaultTTL)

setDefaultTTL

public void setDefaultTTL(String defaultTTL)

setIvyPattern

public void setIvyPattern(String ivyPattern)

setLockStrategy

public void setLockStrategy(LockStrategy lockStrategy)

setLockStrategy

public void setLockStrategy(String lockStrategyName)

setMemorySize

public void setMemorySize(int size)

setName

public void setName(String name)

setSettings

public void setSettings(IvySettings settings)

setUseOrigin

public void setUseOrigin(boolean b)

toString

public String toString()