Search in sources :

Example 1 with GlobalHttpConfiguration

use of org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration in project galley by Commonjava.

the class DownloadHandlerConcurrencyTest method before.

@Before
public void before() throws IOException {
    executor = Executors.newCachedThreadPool();
    cacheProvider = new FileCacheProvider(temp.newFolder(), new HashedLocationPathGenerator(), new NoOpFileEventManager(), new NoOpTransferDecorator(), false);
    transport = new HttpClientTransport(new HttpImpl(new MemoryPasswordManager()), new ObjectMapper(), new GlobalHttpConfiguration());
}
Also used : FileCacheProvider(org.commonjava.maven.galley.cache.FileCacheProvider) NoOpFileEventManager(org.commonjava.maven.galley.event.NoOpFileEventManager) NoOpTransferDecorator(org.commonjava.maven.galley.io.NoOpTransferDecorator) HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) HashedLocationPathGenerator(org.commonjava.maven.galley.io.HashedLocationPathGenerator) GlobalHttpConfiguration(org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Before(org.junit.Before)

Example 2 with GlobalHttpConfiguration

use of org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration in project indy by Commonjava.

the class TestProvider method setup.

@PostConstruct
public void setup() {
    storeDataManager = new MemoryStoreDataManager(true);
    nfc = new MemoryNotFoundCache();
    objectMapper = new IndyObjectMapper(false);
    fileEventManager = new NoOpFileEventManager();
    transferDecorator = new NoOpTransferDecorator();
    transportManagerConfig = new TransportManagerConfig();
    weftConfig = new DefaultWeftConfig();
    globalHttpConfiguration = new GlobalHttpConfiguration();
    userLifecycleManager = new AlternativeUserLifecycleManager();
    temp = new TemporaryFolder();
    try {
        temp.create();
        cacheProvider = new FileCacheProvider(temp.newFolder("storage"), indyPathGenerator, fileEventManager, new TransferDecoratorManager(transferDecorator));
    } catch (IOException e) {
        fail("Cannot initialize temporary directory structure");
        temp.delete();
    }
}
Also used : FileCacheProvider(org.commonjava.maven.galley.cache.FileCacheProvider) NoOpTransferDecorator(org.commonjava.maven.galley.io.NoOpTransferDecorator) DefaultWeftConfig(org.commonjava.cdi.util.weft.config.DefaultWeftConfig) TransportManagerConfig(org.commonjava.maven.galley.config.TransportManagerConfig) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) IOException(java.io.IOException) NoOpFileEventManager(org.commonjava.maven.galley.event.NoOpFileEventManager) AlternativeUserLifecycleManager(org.commonjava.indy.action.fixture.AlternativeUserLifecycleManager) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) TransferDecoratorManager(org.commonjava.maven.galley.io.TransferDecoratorManager) GlobalHttpConfiguration(org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration) TemporaryFolder(org.junit.rules.TemporaryFolder) PostConstruct(javax.annotation.PostConstruct)

Example 3 with GlobalHttpConfiguration

use of org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration in project galley by Commonjava.

the class TestCDIProvider method start.

@PostConstruct
public void start() {
    try {
        temp.create();
        cacheProvider = new PartyLineCacheProvider(temp.newFolder(), pathGenerator, eventManager, transferDecorator);
        fileTransportConfig = new FileTransportConfig(temp.newFolder(), pathGenerator);
    } catch (IOException e) {
        Assert.fail("Failed to init temp folder fro file cache.");
    }
    locationExpander = new NoOpLocationExpander();
    locationResolver = new SimpleUrlLocationResolver(locationExpander, transportManager);
    globalHttpConfiguration = new GlobalHttpConfiguration();
    weftConfig = new DefaultWeftConfig();
}
Also used : SimpleUrlLocationResolver(org.commonjava.maven.galley.transport.SimpleUrlLocationResolver) DefaultWeftConfig(org.commonjava.cdi.util.weft.config.DefaultWeftConfig) FileTransportConfig(org.commonjava.maven.galley.filearc.FileTransportConfig) GlobalHttpConfiguration(org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration) PartyLineCacheProvider(org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider) IOException(java.io.IOException) NoOpLocationExpander(org.commonjava.maven.galley.transport.NoOpLocationExpander) PostConstruct(javax.annotation.PostConstruct)

Example 4 with GlobalHttpConfiguration

use of org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration 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)

Aggregations

GlobalHttpConfiguration (org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration)4 IOException (java.io.IOException)2 PostConstruct (javax.annotation.PostConstruct)2 DefaultWeftConfig (org.commonjava.cdi.util.weft.config.DefaultWeftConfig)2 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)2 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)2 FileCacheProvider (org.commonjava.maven.galley.cache.FileCacheProvider)2 NoOpFileEventManager (org.commonjava.maven.galley.event.NoOpFileEventManager)2 NoOpTransferDecorator (org.commonjava.maven.galley.io.NoOpTransferDecorator)2 HttpClientTransport (org.commonjava.maven.galley.transport.htcli.HttpClientTransport)2 HttpImpl (org.commonjava.maven.galley.transport.htcli.HttpImpl)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 KojiClient (com.redhat.red.build.koji.KojiClient)1 PoolWeftExecutorService (org.commonjava.cdi.util.weft.PoolWeftExecutorService)1 WeftExecutorService (org.commonjava.cdi.util.weft.WeftExecutorService)1 AlternativeUserLifecycleManager (org.commonjava.indy.action.fixture.AlternativeUserLifecycleManager)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