Search in sources :

Example 11 with TaskManagerFactory

use of org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory in project osmosis by openstreetmap.

the class DatasetPluginLoader method loadTaskFactories.

/**
 * {@inheritDoc}
 */
@Override
public Map<String, TaskManagerFactory> loadTaskFactories() {
    Map<String, TaskManagerFactory> factoryMap;
    factoryMap = new HashMap<String, TaskManagerFactory>();
    factoryMap.put("dataset-dump", new DumpDatasetFactory());
    factoryMap.put("dd", new DumpDatasetFactory());
    factoryMap.put("dataset-bounding-box", new DatasetBoundingBoxFilterFactory());
    factoryMap.put("dbb", new DatasetBoundingBoxFilterFactory());
    factoryMap.put("dataset-dump-0.6", new DumpDatasetFactory());
    factoryMap.put("dataset-bounding-box-0.6", new DatasetBoundingBoxFilterFactory());
    return factoryMap;
}
Also used : DatasetBoundingBoxFilterFactory(org.openstreetmap.osmosis.dataset.v0_6.DatasetBoundingBoxFilterFactory) TaskManagerFactory(org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory) DumpDatasetFactory(org.openstreetmap.osmosis.dataset.v0_6.DumpDatasetFactory)

Example 12 with TaskManagerFactory

use of org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory in project osmosis by openstreetmap.

the class ReplicationHttpPluginLoader method loadTaskFactories.

/**
 * {@inheritDoc}
 */
@Override
public Map<String, TaskManagerFactory> loadTaskFactories() {
    Map<String, TaskManagerFactory> factoryMap;
    factoryMap = new HashMap<String, TaskManagerFactory>();
    factoryMap.put("receive-replication", new ReplicationDataClientFactory());
    factoryMap.put("rr", new ReplicationDataClientFactory());
    factoryMap.put("send-replication-data", new ReplicationDataServerFactory());
    factoryMap.put("srd", new ReplicationDataServerFactory());
    factoryMap.put("send-replication-sequence", new ReplicationSequenceServerFactory());
    factoryMap.put("srs", new ReplicationSequenceServerFactory());
    factoryMap.put("read-replication-0.6", new ReplicationDataClientFactory());
    factoryMap.put("send-replication-data-0.6", new ReplicationDataServerFactory());
    factoryMap.put("send-replication-sequence-0.6", new ReplicationSequenceServerFactory());
    return factoryMap;
}
Also used : TaskManagerFactory(org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory) ReplicationSequenceServerFactory(org.openstreetmap.osmosis.replicationhttp.v0_6.ReplicationSequenceServerFactory) ReplicationDataServerFactory(org.openstreetmap.osmosis.replicationhttp.v0_6.ReplicationDataServerFactory) ReplicationDataClientFactory(org.openstreetmap.osmosis.replicationhttp.v0_6.ReplicationDataClientFactory)

Example 13 with TaskManagerFactory

use of org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory in project osmosis by openstreetmap.

the class CorePluginLoader method loadTaskFactories.

/**
 * {@inheritDoc}
 */
@Override
public Map<String, TaskManagerFactory> loadTaskFactories() {
    Map<String, TaskManagerFactory> factoryMap;
    EntitySorterFactory entitySorterFactory06;
    ChangeSorterFactory changeSorterFactory06;
    factoryMap = new HashMap<String, TaskManagerFactory>();
    // Configure factories that require additional information.
    entitySorterFactory06 = new EntitySorterFactory();
    entitySorterFactory06.registerComparator("TypeThenId", new EntityContainerComparator(new EntityByTypeThenIdComparator()), true);
    changeSorterFactory06 = new ChangeSorterFactory();
    changeSorterFactory06.registerComparator("streamable", new ChangeForStreamableApplierComparator(), true);
    changeSorterFactory06.registerComparator("seekable", new ChangeForSeekableApplierComparator(), false);
    // Register factories.
    factoryMap.put("sort", entitySorterFactory06);
    factoryMap.put("s", entitySorterFactory06);
    factoryMap.put("sort-change", changeSorterFactory06);
    factoryMap.put("sc", changeSorterFactory06);
    factoryMap.put("write-null", new NullWriterFactory());
    factoryMap.put("wn", new NullWriterFactory());
    factoryMap.put("write-null-change", new NullChangeWriterFactory());
    factoryMap.put("wnc", new NullChangeWriterFactory());
    factoryMap.put("buffer", new EntityBufferFactory());
    factoryMap.put("b", new EntityBufferFactory());
    factoryMap.put("buffer-change", new ChangeBufferFactory());
    factoryMap.put("bc", new ChangeBufferFactory());
    factoryMap.put("report-entity", new EntityReporterFactory());
    factoryMap.put("re", new EntityReporterFactory());
    factoryMap.put("report-integrity", new IntegrityReporterFactory());
    factoryMap.put("ri", new IntegrityReporterFactory());
    factoryMap.put("log-progress", new EntityProgressLoggerFactory());
    factoryMap.put("lp", new EntityProgressLoggerFactory());
    factoryMap.put("log-progress-change", new ChangeProgressLoggerFactory());
    factoryMap.put("lpc", new ChangeProgressLoggerFactory());
    factoryMap.put("tee", new EntityTeeFactory());
    factoryMap.put("t", new EntityTeeFactory());
    factoryMap.put("tee-change", new ChangeTeeFactory());
    factoryMap.put("tc", new ChangeTeeFactory());
    factoryMap.put("read-empty", new EmptyReaderFactory());
    factoryMap.put("rem", new EmptyReaderFactory());
    factoryMap.put("read-empty-change", new EmptyChangeReaderFactory());
    factoryMap.put("remc", new EmptyChangeReaderFactory());
    factoryMap.put("compute-bounding-box", new BoundComputerFactory());
    factoryMap.put("cbb", new BoundComputerFactory());
    factoryMap.put("set-bounding-box", new BoundSetterFactory());
    factoryMap.put("sbb", new BoundSetterFactory());
    factoryMap.put("sort-0.6", entitySorterFactory06);
    factoryMap.put("sort-change-0.6", changeSorterFactory06);
    factoryMap.put("write-null-0.6", new NullWriterFactory());
    factoryMap.put("write-null-change-0.6", new NullChangeWriterFactory());
    factoryMap.put("buffer-0.6", new EntityBufferFactory());
    factoryMap.put("buffer-change-0.6", new ChangeBufferFactory());
    factoryMap.put("report-entity-0.6", new EntityReporterFactory());
    factoryMap.put("report-integrity-0.6", new IntegrityReporterFactory());
    factoryMap.put("log-progress-0.6", new EntityProgressLoggerFactory());
    factoryMap.put("log-progress-change-0.6", new ChangeProgressLoggerFactory());
    factoryMap.put("tee-0.6", new EntityTeeFactory());
    factoryMap.put("tee-change-0.6", new ChangeTeeFactory());
    factoryMap.put("read-empty-0.6", new EmptyReaderFactory());
    factoryMap.put("read-empty-change-0.6", new EmptyChangeReaderFactory());
    factoryMap.put("tag-sort-0.6", new TagSorterFactory());
    factoryMap.put("tag-sort-change-0.6", new ChangeTagSorterFactory());
    factoryMap.put("compute-bounding-box-0.6", new BoundComputerFactory());
    factoryMap.put("set-bounding-box-0.6", new BoundSetterFactory());
    return factoryMap;
}
Also used : EntityProgressLoggerFactory(org.openstreetmap.osmosis.core.progress.v0_6.EntityProgressLoggerFactory) EntityReporterFactory(org.openstreetmap.osmosis.core.report.v0_6.EntityReporterFactory) ChangeBufferFactory(org.openstreetmap.osmosis.core.buffer.v0_6.ChangeBufferFactory) EntityBufferFactory(org.openstreetmap.osmosis.core.buffer.v0_6.EntityBufferFactory) ChangeForStreamableApplierComparator(org.openstreetmap.osmosis.core.sort.v0_6.ChangeForStreamableApplierComparator) EntitySorterFactory(org.openstreetmap.osmosis.core.sort.v0_6.EntitySorterFactory) ChangeProgressLoggerFactory(org.openstreetmap.osmosis.core.progress.v0_6.ChangeProgressLoggerFactory) EmptyReaderFactory(org.openstreetmap.osmosis.core.misc.v0_6.EmptyReaderFactory) EmptyChangeReaderFactory(org.openstreetmap.osmosis.core.misc.v0_6.EmptyChangeReaderFactory) ChangeTagSorterFactory(org.openstreetmap.osmosis.core.sort.v0_6.ChangeTagSorterFactory) NullWriterFactory(org.openstreetmap.osmosis.core.misc.v0_6.NullWriterFactory) EntityByTypeThenIdComparator(org.openstreetmap.osmosis.core.sort.v0_6.EntityByTypeThenIdComparator) ChangeTagSorterFactory(org.openstreetmap.osmosis.core.sort.v0_6.ChangeTagSorterFactory) TagSorterFactory(org.openstreetmap.osmosis.core.sort.v0_6.TagSorterFactory) ChangeForSeekableApplierComparator(org.openstreetmap.osmosis.core.sort.v0_6.ChangeForSeekableApplierComparator) IntegrityReporterFactory(org.openstreetmap.osmosis.core.report.v0_6.IntegrityReporterFactory) TaskManagerFactory(org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory) ChangeTeeFactory(org.openstreetmap.osmosis.core.tee.v0_6.ChangeTeeFactory) BoundSetterFactory(org.openstreetmap.osmosis.core.bound.v0_6.BoundSetterFactory) ChangeSorterFactory(org.openstreetmap.osmosis.core.sort.v0_6.ChangeSorterFactory) NullChangeWriterFactory(org.openstreetmap.osmosis.core.misc.v0_6.NullChangeWriterFactory) EntityTeeFactory(org.openstreetmap.osmosis.core.tee.v0_6.EntityTeeFactory) EntityContainerComparator(org.openstreetmap.osmosis.core.sort.v0_6.EntityContainerComparator) BoundComputerFactory(org.openstreetmap.osmosis.core.bound.v0_6.BoundComputerFactory)

Example 14 with TaskManagerFactory

use of org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory in project osmosis by openstreetmap.

the class TaskRegistrar method loadPluginClass.

/**
 * Load the given plugin, old API or new JPF.
 *
 * @param pluginClassName
 *            the name of the class to instantiate
 * @param classLoader
 *            the ClassLoader to use
 */
@SuppressWarnings("unchecked")
private void loadPluginClass(final String pluginClassName, final ClassLoader classLoader) {
    Class<?> untypedPluginClass;
    PluginLoader pluginLoader;
    Map<String, TaskManagerFactory> pluginTasks;
    // Load the plugin class.
    try {
        untypedPluginClass = classLoader.loadClass(pluginClassName);
    } catch (ClassNotFoundException e) {
        throw new OsmosisRuntimeException("Unable to load plugin class (" + pluginClassName + ").", e);
    }
    // Verify that the plugin implements the plugin loader interface.
    if (!PluginLoader.class.isAssignableFrom(untypedPluginClass)) {
        throw new OsmosisRuntimeException("The class (" + pluginClassName + ") does not implement interface (" + PluginLoader.class.getName() + "). Maybe it's not a plugin?");
    }
    Class<PluginLoader> pluginClass = (Class<PluginLoader>) untypedPluginClass;
    // Instantiate the plugin loader.
    try {
        pluginLoader = pluginClass.newInstance();
    } catch (InstantiationException e) {
        throw new IllegalArgumentException("Unable to instantiate plugin class (" + pluginClassName + ").", e);
    } catch (IllegalAccessException e) {
        throw new IllegalArgumentException("Unable to instantiate plugin class (" + pluginClassName + ").", e);
    }
    // Obtain the plugin task factories with their names.
    pluginTasks = pluginLoader.loadTaskFactories();
    // Register the plugin tasks.
    for (Entry<String, TaskManagerFactory> taskEntry : pluginTasks.entrySet()) {
        factoryRegister.register(taskEntry.getKey(), taskEntry.getValue());
    }
}
Also used : TaskManagerFactory(org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory) PluginLoader(org.openstreetmap.osmosis.core.plugin.PluginLoader)

Example 15 with TaskManagerFactory

use of org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory in project osmosis by openstreetmap.

the class AreaFilterPluginLoader method loadTaskFactories.

/**
 * {@inheritDoc}
 */
@Override
public Map<String, TaskManagerFactory> loadTaskFactories() {
    Map<String, TaskManagerFactory> factoryMap;
    factoryMap = new HashMap<String, TaskManagerFactory>();
    factoryMap.put("bounding-box", new BoundingBoxFilterFactory());
    factoryMap.put("bb", new BoundingBoxFilterFactory());
    factoryMap.put("bounding-polygon", new PolygonFilterFactory());
    factoryMap.put("bp", new PolygonFilterFactory());
    factoryMap.put("bounding-box-0.6", new BoundingBoxFilterFactory());
    factoryMap.put("bounding-polygon-0.6", new PolygonFilterFactory());
    return factoryMap;
}
Also used : TaskManagerFactory(org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory) BoundingBoxFilterFactory(org.openstreetmap.osmosis.areafilter.v0_6.BoundingBoxFilterFactory) PolygonFilterFactory(org.openstreetmap.osmosis.areafilter.v0_6.PolygonFilterFactory)

Aggregations

TaskManagerFactory (org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory)15 NullChangeWriterFactory (org.openstreetmap.osmosis.core.misc.v0_6.NullChangeWriterFactory)2 HashMap (java.util.HashMap)1 ApidbChangeReaderFactory (org.openstreetmap.osmosis.apidb.v0_6.ApidbChangeReaderFactory)1 ApidbChangeWriterFactory (org.openstreetmap.osmosis.apidb.v0_6.ApidbChangeWriterFactory)1 ApidbCurrentReaderFactory (org.openstreetmap.osmosis.apidb.v0_6.ApidbCurrentReaderFactory)1 ApidbFileReplicatorFactory (org.openstreetmap.osmosis.apidb.v0_6.ApidbFileReplicatorFactory)1 ApidbReaderFactory (org.openstreetmap.osmosis.apidb.v0_6.ApidbReaderFactory)1 ApidbTruncatorFactory (org.openstreetmap.osmosis.apidb.v0_6.ApidbTruncatorFactory)1 ApidbWriterFactory (org.openstreetmap.osmosis.apidb.v0_6.ApidbWriterFactory)1 BoundingBoxFilterFactory (org.openstreetmap.osmosis.areafilter.v0_6.BoundingBoxFilterFactory)1 PolygonFilterFactory (org.openstreetmap.osmosis.areafilter.v0_6.PolygonFilterFactory)1 BoundComputerFactory (org.openstreetmap.osmosis.core.bound.v0_6.BoundComputerFactory)1 BoundSetterFactory (org.openstreetmap.osmosis.core.bound.v0_6.BoundSetterFactory)1 ChangeBufferFactory (org.openstreetmap.osmosis.core.buffer.v0_6.ChangeBufferFactory)1 EntityBufferFactory (org.openstreetmap.osmosis.core.buffer.v0_6.EntityBufferFactory)1 EmptyChangeReaderFactory (org.openstreetmap.osmosis.core.misc.v0_6.EmptyChangeReaderFactory)1 EmptyReaderFactory (org.openstreetmap.osmosis.core.misc.v0_6.EmptyReaderFactory)1 NullWriterFactory (org.openstreetmap.osmosis.core.misc.v0_6.NullWriterFactory)1 PluginLoader (org.openstreetmap.osmosis.core.plugin.PluginLoader)1