Search in sources :

Example 1 with RepositoryFactoryImpl

use of org.icij.datashare.db.RepositoryFactoryImpl in project datashare by ICIJ.

the class BatchDownloadMode method configure.

@Override
protected void configure() {
    super.configure();
    String batchQueueType = propertiesProvider.get("batchQueueType").orElse("org.icij.datashare.extract.MemoryBlockingQueue");
    bind(TaskManager.class).toInstance(new TaskManagerRedis(propertiesProvider, getBlockingQueue(propertiesProvider, batchQueueType, "ds:batchdownload:queue")));
    RepositoryFactoryImpl repositoryFactory = new RepositoryFactoryImpl(propertiesProvider);
    bind(BatchSearchRepository.class).toInstance(repositoryFactory.createBatchSearchRepository());
    bind(ApiKeyRepository.class).toInstance(repositoryFactory.createApiKeyRepository());
    repositoryFactory.initDatabase();
}
Also used : TaskManagerRedis(org.icij.datashare.tasks.TaskManagerRedis) RepositoryFactoryImpl(org.icij.datashare.db.RepositoryFactoryImpl) TaskManager(org.icij.datashare.tasks.TaskManager) ApiKeyRepository(org.icij.datashare.user.ApiKeyRepository) BatchSearchRepository(org.icij.datashare.batch.BatchSearchRepository)

Example 2 with RepositoryFactoryImpl

use of org.icij.datashare.db.RepositoryFactoryImpl in project datashare by ICIJ.

the class CommonMode method configurePersistence.

void configurePersistence() {
    RepositoryFactoryImpl repositoryFactory = new RepositoryFactoryImpl(propertiesProvider);
    bind(Repository.class).toInstance(repositoryFactory.createRepository());
    bind(ApiKeyRepository.class).toInstance(repositoryFactory.createApiKeyRepository());
    bind(BatchSearchRepository.class).toInstance(repositoryFactory.createBatchSearchRepository());
    repositoryFactory.initDatabase();
}
Also used : RepositoryFactoryImpl(org.icij.datashare.db.RepositoryFactoryImpl) ApiKeyRepository(org.icij.datashare.user.ApiKeyRepository) Repository(org.icij.datashare.Repository) BatchSearchRepository(org.icij.datashare.batch.BatchSearchRepository) ApiKeyRepository(org.icij.datashare.user.ApiKeyRepository) BatchSearchRepository(org.icij.datashare.batch.BatchSearchRepository)

Example 3 with RepositoryFactoryImpl

use of org.icij.datashare.db.RepositoryFactoryImpl in project datashare by ICIJ.

the class CliMode method configure.

@Override
protected void configure() {
    super.configure();
    bind(TaskManager.class).toInstance(new TaskManagerMemory(propertiesProvider));
    RepositoryFactoryImpl repositoryFactory = new RepositoryFactoryImpl(propertiesProvider);
    bind(BatchSearchRepository.class).toInstance(repositoryFactory.createBatchSearchRepository());
    bind(ApiKeyRepository.class).toInstance(repositoryFactory.createApiKeyRepository());
    repositoryFactory.initDatabase();
}
Also used : RepositoryFactoryImpl(org.icij.datashare.db.RepositoryFactoryImpl) TaskManager(org.icij.datashare.tasks.TaskManager) ApiKeyRepository(org.icij.datashare.user.ApiKeyRepository) BatchSearchRepository(org.icij.datashare.batch.BatchSearchRepository) TaskManagerMemory(org.icij.datashare.tasks.TaskManagerMemory)

Aggregations

BatchSearchRepository (org.icij.datashare.batch.BatchSearchRepository)3 RepositoryFactoryImpl (org.icij.datashare.db.RepositoryFactoryImpl)3 ApiKeyRepository (org.icij.datashare.user.ApiKeyRepository)3 TaskManager (org.icij.datashare.tasks.TaskManager)2 Repository (org.icij.datashare.Repository)1 TaskManagerMemory (org.icij.datashare.tasks.TaskManagerMemory)1 TaskManagerRedis (org.icij.datashare.tasks.TaskManagerRedis)1