Search in sources :

Example 1 with GridFileSystemCacheProvider

use of org.commonjava.maven.galley.cache.infinispan.GridFileSystemCacheProvider in project indy by Commonjava.

the class InfinispanGalleyStorageProvider method setup.

@PostConstruct
public void setup() {
    SpecialPathInfo infoSpi = SpecialPathInfo.from(new FilePatternMatcher(".+\\.info")).setDecoratable(false).setDeletable(false).setListable(false).setPublishable(false).setRetrievable(false).setStorable(false).build();
    specialPathManager.registerSpecialPathInfo(infoSpi);
    transferDecorator = new ChecksummingTransferDecorator(Collections.singleton(TransferOperation.GENERATE), specialPathManager, new Md5GeneratorFactory(), new Sha1GeneratorFactory());
    this.cacheProvider = new GridFileSystemCacheProvider(pathGenerator, fileEventManager, transferDecorator, cacheFs);
}
Also used : Sha1GeneratorFactory(org.commonjava.maven.galley.io.checksum.Sha1GeneratorFactory) GridFileSystemCacheProvider(org.commonjava.maven.galley.cache.infinispan.GridFileSystemCacheProvider) FilePatternMatcher(org.commonjava.maven.galley.model.FilePatternMatcher) SpecialPathInfo(org.commonjava.maven.galley.model.SpecialPathInfo) ChecksummingTransferDecorator(org.commonjava.maven.galley.io.ChecksummingTransferDecorator) Md5GeneratorFactory(org.commonjava.maven.galley.io.checksum.Md5GeneratorFactory) PostConstruct(javax.annotation.PostConstruct)

Example 2 with GridFileSystemCacheProvider

use of org.commonjava.maven.galley.cache.infinispan.GridFileSystemCacheProvider in project galley by Commonjava.

the class GridFileSystemCacheProviderTest method setup.

@Before
public void setup() throws Exception {
    final PathGenerator pathgen = new HashedLocationPathGenerator();
    final FileEventManager events = new TestFileEventManager();
    final TransferDecorator decorator = new TestTransferDecorator();
    Cache<String, byte[]> data = CACHE_MANAGER.getCache(name.getMethodName() + "-data");
    Cache<String, GridFile.Metadata> metadata = CACHE_MANAGER.getCache(name.getMethodName() + "-metadata");
    final GridFilesystem fs = new GridFilesystem(data, metadata);
    provider = new GridFileSystemCacheProvider(pathgen, events, decorator, fs);
}
Also used : TestTransferDecorator(org.commonjava.maven.galley.cache.testutil.TestTransferDecorator) GridFileSystemCacheProvider(org.commonjava.maven.galley.cache.infinispan.GridFileSystemCacheProvider) TestFileEventManager(org.commonjava.maven.galley.cache.testutil.TestFileEventManager) FileEventManager(org.commonjava.maven.galley.spi.event.FileEventManager) GridFilesystem(org.infinispan.io.GridFilesystem) HashedLocationPathGenerator(org.commonjava.maven.galley.io.HashedLocationPathGenerator) HashedLocationPathGenerator(org.commonjava.maven.galley.io.HashedLocationPathGenerator) PathGenerator(org.commonjava.maven.galley.spi.io.PathGenerator) TestFileEventManager(org.commonjava.maven.galley.cache.testutil.TestFileEventManager) TestTransferDecorator(org.commonjava.maven.galley.cache.testutil.TestTransferDecorator) TransferDecorator(org.commonjava.maven.galley.spi.io.TransferDecorator) Before(org.junit.Before)

Aggregations

GridFileSystemCacheProvider (org.commonjava.maven.galley.cache.infinispan.GridFileSystemCacheProvider)2 PostConstruct (javax.annotation.PostConstruct)1 TestFileEventManager (org.commonjava.maven.galley.cache.testutil.TestFileEventManager)1 TestTransferDecorator (org.commonjava.maven.galley.cache.testutil.TestTransferDecorator)1 ChecksummingTransferDecorator (org.commonjava.maven.galley.io.ChecksummingTransferDecorator)1 HashedLocationPathGenerator (org.commonjava.maven.galley.io.HashedLocationPathGenerator)1 Md5GeneratorFactory (org.commonjava.maven.galley.io.checksum.Md5GeneratorFactory)1 Sha1GeneratorFactory (org.commonjava.maven.galley.io.checksum.Sha1GeneratorFactory)1 FilePatternMatcher (org.commonjava.maven.galley.model.FilePatternMatcher)1 SpecialPathInfo (org.commonjava.maven.galley.model.SpecialPathInfo)1 FileEventManager (org.commonjava.maven.galley.spi.event.FileEventManager)1 PathGenerator (org.commonjava.maven.galley.spi.io.PathGenerator)1 TransferDecorator (org.commonjava.maven.galley.spi.io.TransferDecorator)1 GridFilesystem (org.infinispan.io.GridFilesystem)1 Before (org.junit.Before)1