Package org.openstreetmap.osmosis.apidb.v0_6.impl

Examples of org.openstreetmap.osmosis.apidb.v0_6.impl.RelationRowMapper


  /**
   * Runs the changeset extraction.
   */
  public void run() {
    ApidbChangeReader reader;
    XmlChangeWriter writer;
    ChangeTagSorter tagSorter;
    String fileName;
    File tmpFile;
    File file;

    // Generate the changeset file name.
    fileName = new ChangesetFileNameFormatter(config.getChangeFileBeginFormat(), config.getChangeFileEndFormat())
        .generateFileName(intervalBegin, intervalEnd);

    // Generate the temporary output file.
    tmpFile = new File(baseDirectory, TMP_FILE_NAME);

    // Generate the changeset output file.
    file = new File(baseDirectory, fileName);

    // Create the output task to write to a compressed xml file.
    writer = new XmlChangeWriter(tmpFile, CompressionMethod.GZip);

    // Create the input task to read the change interval from the database.
    reader = new ApidbChangeReader(config.getDatabaseLoginCredentials(), config.getDatabasePreferences(),
        intervalBegin, intervalEnd, fullHistory);
   
    // Create the tag sorter to ensure that output files are consistent allowing simple
    // comparisons when auditing results.
    tagSorter = new ChangeTagSorter();

    // Connect the tasks together.
    reader.setChangeSink(tagSorter);
    tagSorter.setChangeSink(writer);

    // Run the changeset extraction.
    reader.run();

    // Delete the destination file if it already exists.
    if (file.exists()) {
      if (!file.delete()) {
        throw new OsmosisRuntimeException("Unable to delete existing file " + file + ".");
View Full Code Here


   
    factoryMap = new HashMap<String, TaskManagerFactory>();
   
    factoryMap.put("read-apidb", new ApidbReaderFactory());
    factoryMap.put("rd", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change", new ApidbChangeReaderFactory());
    factoryMap.put("rdc", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current", new ApidbCurrentReaderFactory());
    factoryMap.put("rdcur", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb", new ApidbWriterFactory());
    factoryMap.put("wd", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change", new ApidbChangeWriterFactory());
    factoryMap.put("wdc", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb", new ApidbTruncatorFactory());
    factoryMap.put("td", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb", new ApidbFileReplicatorFactory());
    factoryMap.put("repa", new ApidbFileReplicatorFactory());
   
    factoryMap.put("read-apidb-0.6", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change-0.6", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current-0.6", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb-0.6", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change-0.6", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb-0.6", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb-0.6", new ApidbFileReplicatorFactory());
View Full Code Here

    factoryMap.put("rdc", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current", new ApidbCurrentReaderFactory());
    factoryMap.put("rdcur", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb", new ApidbWriterFactory());
    factoryMap.put("wd", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change", new ApidbChangeWriterFactory());
    factoryMap.put("wdc", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb", new ApidbTruncatorFactory());
    factoryMap.put("td", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb", new ApidbFileReplicatorFactory());
    factoryMap.put("repa", new ApidbFileReplicatorFactory());
   
    factoryMap.put("read-apidb-0.6", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change-0.6", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current-0.6", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb-0.6", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change-0.6", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb-0.6", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb-0.6", new ApidbFileReplicatorFactory());
   
    return factoryMap;
  }
View Full Code Here

   
    factoryMap.put("read-apidb", new ApidbReaderFactory());
    factoryMap.put("rd", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change", new ApidbChangeReaderFactory());
    factoryMap.put("rdc", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current", new ApidbCurrentReaderFactory());
    factoryMap.put("rdcur", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb", new ApidbWriterFactory());
    factoryMap.put("wd", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change", new ApidbChangeWriterFactory());
    factoryMap.put("wdc", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb", new ApidbTruncatorFactory());
    factoryMap.put("td", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb", new ApidbFileReplicatorFactory());
    factoryMap.put("repa", new ApidbFileReplicatorFactory());
   
    factoryMap.put("read-apidb-0.6", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change-0.6", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current-0.6", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb-0.6", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change-0.6", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb-0.6", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb-0.6", new ApidbFileReplicatorFactory());
   
View Full Code Here

    factoryMap.put("wd", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change", new ApidbChangeWriterFactory());
    factoryMap.put("wdc", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb", new ApidbTruncatorFactory());
    factoryMap.put("td", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb", new ApidbFileReplicatorFactory());
    factoryMap.put("repa", new ApidbFileReplicatorFactory());
   
    factoryMap.put("read-apidb-0.6", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change-0.6", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current-0.6", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb-0.6", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change-0.6", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb-0.6", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb-0.6", new ApidbFileReplicatorFactory());
   
    return factoryMap;
  }
View Full Code Here

  public Map<String, TaskManagerFactory> loadTaskFactories() {
    Map<String, TaskManagerFactory> factoryMap;
   
    factoryMap = new HashMap<String, TaskManagerFactory>();
   
    factoryMap.put("read-apidb", new ApidbReaderFactory());
    factoryMap.put("rd", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change", new ApidbChangeReaderFactory());
    factoryMap.put("rdc", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current", new ApidbCurrentReaderFactory());
    factoryMap.put("rdcur", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb", new ApidbWriterFactory());
    factoryMap.put("wd", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change", new ApidbChangeWriterFactory());
    factoryMap.put("wdc", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb", new ApidbTruncatorFactory());
    factoryMap.put("td", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb", new ApidbFileReplicatorFactory());
    factoryMap.put("repa", new ApidbFileReplicatorFactory());
   
    factoryMap.put("read-apidb-0.6", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change-0.6", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current-0.6", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb-0.6", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change-0.6", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb-0.6", new ApidbTruncatorFactory());
View Full Code Here

    factoryMap.put("rdcur", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb", new ApidbWriterFactory());
    factoryMap.put("wd", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change", new ApidbChangeWriterFactory());
    factoryMap.put("wdc", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb", new ApidbTruncatorFactory());
    factoryMap.put("td", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb", new ApidbFileReplicatorFactory());
    factoryMap.put("repa", new ApidbFileReplicatorFactory());
   
    factoryMap.put("read-apidb-0.6", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change-0.6", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current-0.6", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb-0.6", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change-0.6", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb-0.6", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb-0.6", new ApidbFileReplicatorFactory());
   
    return factoryMap;
  }
View Full Code Here

    factoryMap.put("rd", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change", new ApidbChangeReaderFactory());
    factoryMap.put("rdc", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current", new ApidbCurrentReaderFactory());
    factoryMap.put("rdcur", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb", new ApidbWriterFactory());
    factoryMap.put("wd", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change", new ApidbChangeWriterFactory());
    factoryMap.put("wdc", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb", new ApidbTruncatorFactory());
    factoryMap.put("td", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb", new ApidbFileReplicatorFactory());
    factoryMap.put("repa", new ApidbFileReplicatorFactory());
   
    factoryMap.put("read-apidb-0.6", new ApidbReaderFactory());
    factoryMap.put("read-apidb-change-0.6", new ApidbChangeReaderFactory());
    factoryMap.put("read-apidb-current-0.6", new ApidbCurrentReaderFactory());
    factoryMap.put("write-apidb-0.6", new ApidbWriterFactory());
    factoryMap.put("write-apidb-change-0.6", new ApidbChangeWriterFactory());
    factoryMap.put("truncate-apidb-0.6", new ApidbTruncatorFactory());
    factoryMap.put("replicate-apidb-0.6", new ApidbFileReplicatorFactory());
   
    return factoryMap;
View Full Code Here

     */
    public ApidbChangeWriter(DatabaseLoginCredentials loginCredentials, DatabasePreferences preferences,
            boolean populateCurrentTables) {
        changeWriter = new ChangeWriter(loginCredentials, populateCurrentTables);
        actionWriterMap = new HashMap<ChangeAction, ActionChangeWriter>();
        actionWriterMap.put(ChangeAction.Create, new ActionChangeWriter(changeWriter, ChangeAction.Create));
        actionWriterMap.put(ChangeAction.Modify, new ActionChangeWriter(changeWriter, ChangeAction.Modify));
        actionWriterMap.put(ChangeAction.Delete, new ActionChangeWriter(changeWriter, ChangeAction.Delete));

        schemaVersionValidator = new SchemaVersionValidator(loginCredentials, preferences);
    }
View Full Code Here

    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);
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.apidb.v0_6.impl.RelationRowMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.