Search in sources :

Example 1 with GalleyCoreBuilder

use of org.commonjava.maven.galley.GalleyCoreBuilder in project galley by Commonjava.

the class CoreFixture method initGalley.

public void initGalley() throws IOException {
    temp.create();
    if (cacheDir == null) {
        cacheDir = temp.newFolder("cache");
    }
    coreBuilder = new GalleyCoreBuilder(new FileCacheProviderFactory(cacheDir));
}
Also used : GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory)

Example 2 with GalleyCoreBuilder

use of org.commonjava.maven.galley.GalleyCoreBuilder in project indy by Commonjava.

the class PackageMetadataGeneratorTest method setup.

@Before
public void setup() throws Exception {
    stores = new MemoryStoreDataManager(true);
    core = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).build();
    final DefaultIndyConfiguration config = new DefaultIndyConfiguration();
    config.setNotFoundCacheTimeoutSeconds(1);
    final ExpiringMemoryNotFoundCache nfc = new ExpiringMemoryNotFoundCache(config);
    WeftExecutorService rescanService = new PoolWeftExecutorService("test-rescan-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    final LocationExpander locations = new IndyLocationExpander(stores);
    final PackageMetadataMerger merger = new PackageMetadataMerger();
    final TypeMapper types = new StandardTypeMapper();
    final DownloadManager downloads = new DefaultDownloadManager(stores, core.getTransferManager(), locations, null, nfc, rescanService);
    WeftExecutorService contentAccessService = new PoolWeftExecutorService("test-content-access-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    DefaultDirectContentAccess contentAccess = new DefaultDirectContentAccess(downloads, contentAccessService);
    final GroupMergeHelper helper = new GroupMergeHelper(downloads);
    specialPathManager = new SpecialPathManagerImpl();
    fileManager = new DefaultDownloadManager(stores, core.getTransferManager(), core.getLocationExpander(), rescanService);
    generator = new PackageMetadataGenerator(contentAccess, stores, downloads, types, merger, helper, new MemoryNotFoundCache(), new IndyPathGenerator(Collections.singleton(new NPMStoragePathCalculator(specialPathManager))), new NPMStoragePathCalculator(specialPathManager));
}
Also used : StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) TypeMapper(org.commonjava.maven.galley.maven.spi.type.TypeMapper) PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory) ExpiringMemoryNotFoundCache(org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) ExpiringMemoryNotFoundCache(org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache) DownloadManager(org.commonjava.indy.content.DownloadManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) SpecialPathManagerImpl(org.commonjava.maven.galley.io.SpecialPathManagerImpl) PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) WeftExecutorService(org.commonjava.cdi.util.weft.WeftExecutorService) LocationExpander(org.commonjava.maven.galley.spi.transport.LocationExpander) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyPathGenerator(org.commonjava.indy.content.IndyPathGenerator) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) PackageMetadataMerger(org.commonjava.indy.pkg.npm.content.group.PackageMetadataMerger) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) GroupMergeHelper(org.commonjava.indy.core.content.group.GroupMergeHelper) Before(org.junit.Before)

Example 3 with GalleyCoreBuilder

use of org.commonjava.maven.galley.GalleyCoreBuilder in project indy by Commonjava.

the class ArtifactStoreValidatorTest method setup.

@Before
public void setup() throws Exception {
    cacheDir = temp.newFolder();
    galley = new GalleyCoreBuilder(new FileCacheProviderFactory(cacheDir)).withEnabledTransports(new HttpClientTransport(new HttpImpl(new MemoryPasswordManager()))).build();
    validator = new ArtifactStoreValidator(galley.getTransferManager());
}
Also used : HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) Before(org.junit.Before)

Example 4 with GalleyCoreBuilder

use of org.commonjava.maven.galley.GalleyCoreBuilder in project indy by Commonjava.

the class KojiMavenMetadataProviderTest method initKojiClient.

private void initKojiClient(String exchangeName, boolean verifyArtifacts) throws IOException, GalleyInitException, IndyDataException, KojiClientException {
    StoreDataManager storeDataManager = new MemoryStoreDataManager(true);
    if (verifyArtifacts) {
        RemoteRepository verifyRepo = new RemoteRepository(MAVEN_PKG_KEY, VERIFY_REPO, server.formatUrl(VERIFY_BASEPATH));
        storeDataManager.storeArtifactStore(verifyRepo, new ChangeSummary(ChangeSummary.SYSTEM_USER, "Adding verification repo"), false, true, new EventMetadata());
        kojiConfig.setArtifactAuthorityStore(new StoreKey(MAVEN_PKG_KEY, remote, VERIFY_REPO).toString());
    }
    String resourceBase = "koji-metadata/" + exchangeName;
    configureKojiServer(server, KOJI_BASEPATH, counter, resourceBase, verifyArtifacts, VERIFY_BASEPATH);
    kojiClient = new KojiClient(kojiConfig, new MemoryPasswordManager(), Executors.newCachedThreadPool());
    GalleyCore galley = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).withEnabledTransports(new HttpClientTransport(new HttpImpl(new org.commonjava.maven.galley.auth.MemoryPasswordManager()), new IndyObjectMapper(true), new GlobalHttpConfiguration(), null, null)).build();
    WeftExecutorService rescanService = new PoolWeftExecutorService("test-rescan-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    DownloadManager downloadManager = new DefaultDownloadManager(storeDataManager, galley.getTransferManager(), new IndyLocationExpander(storeDataManager), rescanService);
    WeftExecutorService contentAccessService = new PoolWeftExecutorService("test-content-access-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    DirectContentAccess directContentAccess = new DefaultDirectContentAccess(downloadManager, contentAccessService);
    DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, contentAccessService);
    ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
    KojiBuildAuthority buildAuthority = new KojiBuildAuthority(kojiConfig, new StandardTypeMapper(), kojiClient, storeDataManager, contentDigester, directContentAccess, cacheManager);
    WeftExecutorService kojiMDService = new PoolWeftExecutorService("test-koji-metadata-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    provider = new KojiMavenMetadataProvider(this.cache, kojiClient, buildAuthority, kojiConfig, kojiMDService, cacheManager);
}
Also used : PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) DownloadManager(org.commonjava.indy.content.DownloadManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) EventMetadata(org.commonjava.maven.galley.event.EventMetadata) DirectContentAccess(org.commonjava.indy.content.DirectContentAccess) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) TransferMetadata(org.commonjava.maven.galley.io.checksum.TransferMetadata) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) StoreDataManager(org.commonjava.indy.data.StoreDataManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) ContentDigester(org.commonjava.indy.content.ContentDigester) DefaultContentDigester(org.commonjava.indy.core.content.DefaultContentDigester) GalleyCore(org.commonjava.maven.galley.GalleyCore) DefaultContentDigester(org.commonjava.indy.core.content.DefaultContentDigester) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory) MemoryPasswordManager(org.commonjava.util.jhttpc.auth.MemoryPasswordManager) StoreKey(org.commonjava.indy.model.core.StoreKey) WeftExecutorService(org.commonjava.cdi.util.weft.WeftExecutorService) PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) GlobalHttpConfiguration(org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration) ChangeSummary(org.commonjava.indy.audit.ChangeSummary) KojiClient(com.redhat.red.build.koji.KojiClient) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess)

Example 5 with GalleyCoreBuilder

use of org.commonjava.maven.galley.GalleyCoreBuilder in project indy by Commonjava.

the class DefaultDownloadManagerTest method setup.

@Before
public void setup() throws IOException, GalleyInitException {
    contentMetadata.clear();
    core = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).build();
    storeManager = new MemoryStoreDataManager(true);
    LocationExpander locationExpander = new IndyLocationExpander(storeManager);
    final DefaultIndyConfiguration config = new DefaultIndyConfiguration();
    config.setNotFoundCacheTimeoutSeconds(1);
    final ExpiringMemoryNotFoundCache nfc = new ExpiringMemoryNotFoundCache(config);
    WeftExecutorService rescanService = new PoolWeftExecutorService("test-rescan-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    downloadManager = new DefaultDownloadManager(storeManager, core.getTransferManager(), locationExpander, null, nfc, rescanService);
    WeftExecutorService contentAccessService = new PoolWeftExecutorService("test-content-access-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
    DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, contentAccessService);
    ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
    contentManager = new DefaultContentManager(storeManager, downloadManager, new IndyObjectMapper(true), new SpecialPathManagerImpl(), new MemoryNotFoundCache(), contentDigester, new ContentGeneratorManager());
}
Also used : PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory) ExpiringMemoryNotFoundCache(org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) ExpiringMemoryNotFoundCache(org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache) SpecialPathManagerImpl(org.commonjava.maven.galley.io.SpecialPathManagerImpl) PoolWeftExecutorService(org.commonjava.cdi.util.weft.PoolWeftExecutorService) WeftExecutorService(org.commonjava.cdi.util.weft.WeftExecutorService) LocationExpander(org.commonjava.maven.galley.spi.transport.LocationExpander) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) DirectContentAccess(org.commonjava.indy.content.DirectContentAccess) TransferMetadata(org.commonjava.maven.galley.io.checksum.TransferMetadata) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) ContentDigester(org.commonjava.indy.content.ContentDigester) Before(org.junit.Before)

Aggregations

GalleyCoreBuilder (org.commonjava.maven.galley.GalleyCoreBuilder)5 FileCacheProviderFactory (org.commonjava.maven.galley.cache.FileCacheProviderFactory)5 PoolWeftExecutorService (org.commonjava.cdi.util.weft.PoolWeftExecutorService)3 WeftExecutorService (org.commonjava.cdi.util.weft.WeftExecutorService)3 IndyLocationExpander (org.commonjava.indy.content.IndyLocationExpander)3 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)3 Before (org.junit.Before)3 DefaultIndyConfiguration (org.commonjava.indy.conf.DefaultIndyConfiguration)2 ContentDigester (org.commonjava.indy.content.ContentDigester)2 DirectContentAccess (org.commonjava.indy.content.DirectContentAccess)2 DownloadManager (org.commonjava.indy.content.DownloadManager)2 DefaultDirectContentAccess (org.commonjava.indy.core.content.DefaultDirectContentAccess)2 DefaultDownloadManager (org.commonjava.indy.core.content.DefaultDownloadManager)2 ExpiringMemoryNotFoundCache (org.commonjava.indy.core.inject.ExpiringMemoryNotFoundCache)2 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)2 SpecialPathManagerImpl (org.commonjava.maven.galley.io.SpecialPathManagerImpl)2 TransferMetadata (org.commonjava.maven.galley.io.checksum.TransferMetadata)2 StandardTypeMapper (org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper)2 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)2 LocationExpander (org.commonjava.maven.galley.spi.transport.LocationExpander)2