Search in sources :

Example 1 with TransactionManager

use of org.openstreetmap.osmosis.apidb.v0_6.impl.TransactionManager in project osmosis by openstreetmap.

the class ApidbFileReplicator method runImpl.

/**
 * Runs the task implementation. This is called by the run method within a transaction.
 *
 * @param dbCtx
 *            Used to access the database.
 */
protected void runImpl(DatabaseContext2 dbCtx) {
    Replicator replicator;
    ReplicationSource source;
    TransactionManager txnSnapshotLoader;
    SystemTimeLoader systemTimeLoader;
    new SchemaVersionValidator(loginCredentials, preferences).validateVersion(ApidbVersionConstants.SCHEMA_MIGRATIONS);
    source = new AllEntityDao(dbCtx.getJdbcTemplate());
    txnSnapshotLoader = new TransactionDao(dbCtx);
    systemTimeLoader = new TimeDao(dbCtx.getJdbcTemplate());
    replicator = new Replicator(source, changeSink, txnSnapshotLoader, systemTimeLoader, iterations, minInterval, maxInterval);
    replicator.replicate();
}
Also used : AllEntityDao(org.openstreetmap.osmosis.apidb.v0_6.impl.AllEntityDao) TimeDao(org.openstreetmap.osmosis.apidb.v0_6.impl.TimeDao) TransactionManager(org.openstreetmap.osmosis.apidb.v0_6.impl.TransactionManager) TransactionDao(org.openstreetmap.osmosis.apidb.v0_6.impl.TransactionDao) Replicator(org.openstreetmap.osmosis.apidb.v0_6.impl.Replicator) ReplicationSource(org.openstreetmap.osmosis.apidb.v0_6.impl.ReplicationSource) SchemaVersionValidator(org.openstreetmap.osmosis.apidb.v0_6.impl.SchemaVersionValidator) SystemTimeLoader(org.openstreetmap.osmosis.apidb.v0_6.impl.SystemTimeLoader)

Aggregations

AllEntityDao (org.openstreetmap.osmosis.apidb.v0_6.impl.AllEntityDao)1 ReplicationSource (org.openstreetmap.osmosis.apidb.v0_6.impl.ReplicationSource)1 Replicator (org.openstreetmap.osmosis.apidb.v0_6.impl.Replicator)1 SchemaVersionValidator (org.openstreetmap.osmosis.apidb.v0_6.impl.SchemaVersionValidator)1 SystemTimeLoader (org.openstreetmap.osmosis.apidb.v0_6.impl.SystemTimeLoader)1 TimeDao (org.openstreetmap.osmosis.apidb.v0_6.impl.TimeDao)1 TransactionDao (org.openstreetmap.osmosis.apidb.v0_6.impl.TransactionDao)1 TransactionManager (org.openstreetmap.osmosis.apidb.v0_6.impl.TransactionManager)1