use of org.folio.inventory.common.dao.PostgresClientFactory in project mod-inventory by folio-org.
the class DataImportKafkaHandler method registerDataImportProcessingHandlers.
private void registerDataImportProcessingHandlers(Storage storage, HttpClient client) {
MatchValueLoaderFactory.register(new InstanceLoader(storage, vertx));
MatchValueLoaderFactory.register(new ItemLoader(storage, vertx));
MatchValueLoaderFactory.register(new HoldingLoader(storage, vertx));
MatchValueLoaderFactory.register(new AuthorityLoader(storage, vertx));
MatchValueReaderFactory.register(new MarcValueReaderImpl());
MatchValueReaderFactory.register(new StaticValueReaderImpl());
MappingManager.registerReaderFactory(new MarcBibReaderFactory());
MappingManager.registerReaderFactory(new MarcHoldingsReaderFactory());
MappingManager.registerWriterFactory(new ItemWriterFactory());
MappingManager.registerWriterFactory(new HoldingWriterFactory());
MappingManager.registerWriterFactory(new InstanceWriterFactory());
PrecedingSucceedingTitlesHelper precedingSucceedingTitlesHelper = new PrecedingSucceedingTitlesHelper(WebClient.wrap(client));
EventManager.registerEventHandler(new MatchInstanceEventHandler(mappingMetadataCache));
EventManager.registerEventHandler(new MatchItemEventHandler(mappingMetadataCache));
EventManager.registerEventHandler(new MatchHoldingEventHandler(mappingMetadataCache));
EventManager.registerEventHandler(new MatchAuthorityEventHandler(mappingMetadataCache));
EventManager.registerEventHandler(new CreateItemEventHandler(storage, mappingMetadataCache, new ItemIdStorageService(new EntityIdStorageDaoImpl(new PostgresClientFactory(vertx)))));
EventManager.registerEventHandler(new CreateHoldingEventHandler(storage, mappingMetadataCache, new HoldingsIdStorageService(new EntityIdStorageDaoImpl(new PostgresClientFactory(vertx)))));
EventManager.registerEventHandler(new CreateInstanceEventHandler(storage, precedingSucceedingTitlesHelper, mappingMetadataCache, new InstanceIdStorageService(new EntityIdStorageDaoImpl(new PostgresClientFactory(vertx)))));
EventManager.registerEventHandler(new CreateMarcHoldingsEventHandler(storage, mappingMetadataCache, new HoldingsIdStorageService(new EntityIdStorageDaoImpl(new PostgresClientFactory(vertx)))));
EventManager.registerEventHandler(new CreateAuthorityEventHandler(storage, mappingMetadataCache, new AuthorityIdStorageService(new EntityIdStorageDaoImpl(new PostgresClientFactory(vertx)))));
EventManager.registerEventHandler(new UpdateAuthorityEventHandler(storage, mappingMetadataCache, new KafkaEventPublisher(kafkaConfig, vertx, 100)));
EventManager.registerEventHandler(new DeleteAuthorityEventHandler(storage));
EventManager.registerEventHandler(new UpdateItemEventHandler(storage, mappingMetadataCache));
EventManager.registerEventHandler(new UpdateHoldingEventHandler(storage, mappingMetadataCache));
EventManager.registerEventHandler(new ReplaceInstanceEventHandler(storage, precedingSucceedingTitlesHelper, mappingMetadataCache));
EventManager.registerEventHandler(new MarcBibModifiedPostProcessingEventHandler(new InstanceUpdateDelegate(storage), precedingSucceedingTitlesHelper, mappingMetadataCache));
EventManager.registerEventHandler(new MarcBibMatchedPostProcessingEventHandler(storage));
}
use of org.folio.inventory.common.dao.PostgresClientFactory in project mod-inventory by folio-org.
the class PostgresClientFactoryTest method shouldResetPgPoolCache.
@Test
public void shouldResetPgPoolCache() {
PostgresClientFactory postgresClientFactory = new PostgresClientFactory(vertx);
PgPool cachedPool = postgresClientFactory.getCachedPool(TENANT_ID);
postgresClientFactory.setShouldResetPool(true);
PgPool poolFromCache = postgresClientFactory.getCachedPool(TENANT_ID);
assertNotNull(cachedPool);
assertNotNull(poolFromCache);
assertNotEquals(cachedPool, poolFromCache);
}
use of org.folio.inventory.common.dao.PostgresClientFactory in project mod-inventory by folio-org.
the class PostgresClientFactoryTest method shouldReturnPgPoolFromCache.
@Test
public void shouldReturnPgPoolFromCache() {
PostgresClientFactory postgresClientFactory = new PostgresClientFactory(vertx);
PgPool cachedPool = postgresClientFactory.getCachedPool(TENANT_ID);
PgPool poolFromCache = postgresClientFactory.getCachedPool(TENANT_ID);
assertNotNull(cachedPool);
assertNotNull(poolFromCache);
assertEquals(cachedPool, poolFromCache);
}
use of org.folio.inventory.common.dao.PostgresClientFactory in project mod-inventory by folio-org.
the class PostgresClientFactoryTest method shouldCreateCachedPool.
@Test
public void shouldCreateCachedPool() {
PostgresClientFactory postgresClientFactory = new PostgresClientFactory(vertx);
PgPool cachedPool = postgresClientFactory.getCachedPool(TENANT_ID);
assertNotNull(cachedPool);
}
Aggregations