Search in sources :

Example 1 with FileCacheProviderFactory

use of org.commonjava.maven.galley.cache.FileCacheProviderFactory 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 FileCacheProviderFactory

use of org.commonjava.maven.galley.cache.FileCacheProviderFactory 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 3 with FileCacheProviderFactory

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

the class KojiMavenMetadataProviderTest method initKojiClient.

private void initKojiClient(String exchangeName, boolean verifyArtifacts) throws BindException, IOException, GalleyInitException, IndyDataException {
    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())).build();
    DownloadManager downloadManager = new DefaultDownloadManager(storeDataManager, galley.getTransferManager(), new IndyLocationExpander(storeDataManager));
    DirectContentAccess directContentAccess = new DefaultDirectContentAccess(downloadManager, Executors.newCachedThreadPool());
    DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, Executors.newSingleThreadExecutor());
    ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
    KojiBuildAuthority buildAuthority = new KojiBuildAuthority(kojiConfig, new StandardTypeMapper(), kojiClient, storeDataManager, contentDigester, directContentAccess);
    provider = new KojiMavenMetadataProvider(this.cache, kojiClient, buildAuthority, kojiConfig);
}
Also used : 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) 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 4 with FileCacheProviderFactory

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

the class DefaultDownloadManagerTest method setup.

@Before
public void setup() throws IOException, GalleyInitException {
    core = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).build();
    storeManager = new MemoryStoreDataManager(true);
    LocationExpander locationExpander = new IndyLocationExpander(storeManager);
    downloadManager = new DefaultDownloadManager(storeManager, core.getTransferManager(), locationExpander);
}
Also used : IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) LocationExpander(org.commonjava.maven.galley.spi.transport.LocationExpander) GalleyCoreBuilder(org.commonjava.maven.galley.GalleyCoreBuilder) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory) Before(org.junit.Before)

Example 5 with FileCacheProviderFactory

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

the class GalleyMavenFixture method initGalley.

public void initGalley() throws IOException {
    if (temp == null) {
        temp = new TemporaryFolder();
    }
    temp.create();
    if (cacheDir == null) {
        cacheDir = temp.newFolder("cache");
    }
    mavenBuilder = new GalleyMavenBuilder();
    mavenBuilder.withCacheProviderFactory(new FileCacheProviderFactory(cacheDir));
}
Also used : GalleyMavenBuilder(org.commonjava.maven.galley.maven.GalleyMavenBuilder) TemporaryFolder(org.junit.rules.TemporaryFolder) FileCacheProviderFactory(org.commonjava.maven.galley.cache.FileCacheProviderFactory)

Aggregations

FileCacheProviderFactory (org.commonjava.maven.galley.cache.FileCacheProviderFactory)5 GalleyCoreBuilder (org.commonjava.maven.galley.GalleyCoreBuilder)4 IndyLocationExpander (org.commonjava.indy.content.IndyLocationExpander)2 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)2 HttpClientTransport (org.commonjava.maven.galley.transport.htcli.HttpClientTransport)2 HttpImpl (org.commonjava.maven.galley.transport.htcli.HttpImpl)2 Before (org.junit.Before)2 KojiClient (com.redhat.red.build.koji.KojiClient)1 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)1 ContentDigester (org.commonjava.indy.content.ContentDigester)1 DirectContentAccess (org.commonjava.indy.content.DirectContentAccess)1 DownloadManager (org.commonjava.indy.content.DownloadManager)1 DefaultContentDigester (org.commonjava.indy.core.content.DefaultContentDigester)1 DefaultDirectContentAccess (org.commonjava.indy.core.content.DefaultDirectContentAccess)1 DefaultDownloadManager (org.commonjava.indy.core.content.DefaultDownloadManager)1 StoreDataManager (org.commonjava.indy.data.StoreDataManager)1 RemoteRepository (org.commonjava.indy.model.core.RemoteRepository)1 StoreKey (org.commonjava.indy.model.core.StoreKey)1 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)1 GalleyCore (org.commonjava.maven.galley.GalleyCore)1