/** {@inheritDoc} */
  @Override
  protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
    DatabaseLoginCredentials loginCredentials;
    DatabasePreferences preferences;
    boolean enableBboxBuilder;
    boolean enableLinestringBuilder;
    NodeLocationStoreType storeType;

    // Get the task arguments.
    loginCredentials = getDatabaseLoginCredentials(taskConfig);
    preferences = getDatabasePreferences(taskConfig);
    enableBboxBuilder =
        getBooleanArgument(taskConfig, ARG_ENABLE_BBOX_BUILDER, DEFAULT_ENABLE_BBOX_BUILDER);
    enableLinestringBuilder =
        getBooleanArgument(
            taskConfig, ARG_ENABLE_LINESTRING_BUILDER, DEFAULT_ENABLE_LINESTRING_BUILDER);
    storeType =
        Enum.valueOf(
            NodeLocationStoreType.class,
            getStringArgument(
                taskConfig, ARG_NODE_LOCATION_STORE_TYPE, DEFAULT_NODE_LOCATION_STORE_TYPE));

    return new SinkManager(
        taskConfig.getId(),
        new PostgreSqlWriter(
            loginCredentials, preferences, enableBboxBuilder, enableLinestringBuilder, storeType),
        taskConfig.getPipeArgs());
  }
 @Override
 protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
   // Build ElasticSearch client
   Client client = buildElasticsearchClient(taskConfig);
   // Build IndexService
   IndexService indexService = new IndexService(client);
   // Build EntityDao
   EntityDao entityDao = buildEntityDao(taskConfig, indexService);
   // Get specialized index to build
   Set<SpecialiazedIndex> specIndexes = getWantedSpecializedIndexes(taskConfig);
   // Return the SinkManager
   Sink sink = new ElasticSearchWriterTask(indexService, entityDao, specIndexes);
   return new SinkManager(taskConfig.getId(), sink, taskConfig.getPipeArgs());
 }
  /** {@inheritDoc} */
  @Override
  protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
    int sourceCount;

    sourceCount = getIntegerArgument(taskConfig, ARG_SOURCE_COUNT, DEFAULT_SOURCE_COUNT);

    int bufferCapacity =
        getIntegerArgument(
            taskConfig,
            ARG_BUFFER_CAPACITY,
            getDefaultIntegerArgument(taskConfig, DEFAULT_BUFFER_CAPACITY));

    return new MultiChangeSinkRunnableChangeSourceManager(
        taskConfig.getId(),
        new ChangeAppender(sourceCount, bufferCapacity),
        taskConfig.getPipeArgs());
  }
  /** {@inheritDoc} */
  @Override
  protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
    DatabaseLoginCredentials loginCredentials;
    DatabasePreferences preferences;
    boolean populateCurrentTables;

    // Get the task arguments.
    loginCredentials = getDatabaseLoginCredentials(taskConfig);
    preferences = getDatabasePreferences(taskConfig);
    populateCurrentTables =
        getBooleanArgument(
            taskConfig, ARG_POPULATE_CURRENT_TABLES, DEFAULT_POPULATE_CURRENT_TABLES);

    return new ChangeSinkManager(
        taskConfig.getId(),
        new ApidbChangeWriter(loginCredentials, preferences, populateCurrentTables),
        taskConfig.getPipeArgs());
  }
  @Override
  protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
    MapWriterConfiguration configuration = new MapWriterConfiguration();
    configuration.addOutputFile(
        getStringArgument(taskConfig, PARAM_OUTFILE, Constants.DEFAULT_PARAM_OUTFILE));
    configuration.loadTagMappingFile(getStringArgument(taskConfig, PARAM_TAG_MAPPING_FILE, null));

    configuration.addMapStartPosition(
        getStringArgument(taskConfig, PARAM_MAP_START_POSITION, null));
    configuration.addMapStartZoom(getStringArgument(taskConfig, PARAM_MAP_START_ZOOM, null));
    configuration.addBboxConfiguration(getStringArgument(taskConfig, PARAM_BBOX, null));
    configuration.addZoomIntervalConfiguration(
        getStringArgument(taskConfig, PARAM_ZOOMINTERVAL_CONFIG, null));

    configuration.setComment(getStringArgument(taskConfig, PARAM_COMMENT, null));
    configuration.setDebugStrings(getBooleanArgument(taskConfig, PARAM_DEBUG_INFO, false));
    configuration.setPolygonClipping(getBooleanArgument(taskConfig, PARAM_POLYGON_CLIPPING, true));
    configuration.setWayClipping(getBooleanArgument(taskConfig, PARAM_WAY_CLIPPING, true));
    configuration.setLabelPosition(getBooleanArgument(taskConfig, PARAM_LABEL_POSITION, false));
    // boolean waynodeCompression = getBooleanArgument(taskConfig, PARAM_WAYNODE_COMPRESSION,
    // true);
    configuration.setSimplification(
        getDoubleArgument(
            taskConfig, PARAM_SIMPLIFICATION_FACTOR, Constants.DEFAULT_SIMPLIFICATION_FACTOR));
    configuration.setSkipInvalidRelations(
        getBooleanArgument(taskConfig, PARAM_SKIP_INVALID_RELATIONS, false));

    configuration.setDataProcessorType(
        getStringArgument(taskConfig, PARAM_TYPE, Constants.DEFAULT_PARAM_TYPE));
    configuration.setBboxEnlargement(
        getIntegerArgument(
            taskConfig, PARAM_BBOX_ENLARGEMENT, Constants.DEFAULT_PARAM_BBOX_ENLARGEMENT));

    configuration.setPreferredLanguage(
        getStringArgument(taskConfig, PARAM_PREFERRED_LANGUAGE, null));
    configuration.addEncodingChoice(
        getStringArgument(taskConfig, PARAM_ENCODING, Constants.DEFAULT_PARAM_ENCODING));

    configuration.validate();

    MapFileWriterTask task = new MapFileWriterTask(configuration);
    return new SinkManager(taskConfig.getId(), task, taskConfig.getPipeArgs());
  }
  /** {@inheritDoc} */
  @Override
  protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
    String workingDirectoryString;
    File workingDirectory;

    // Get the task arguments.
    workingDirectoryString =
        getStringArgument(
            taskConfig,
            ARG_WORKING_DIRECTORY,
            getDefaultStringArgument(taskConfig, DEFAULT_WORKING_DIRECTORY));

    // Convert argument strings to strongly typed objects.
    workingDirectory = new File(workingDirectoryString);

    return new RunnableTaskManager(
        taskConfig.getId(),
        new ReplicationDownloaderInitializer(workingDirectory),
        taskConfig.getPipeArgs());
  }
  /** {@inheritDoc} */
  @Override
  protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
    String workingDirectoryString;
    Date initialDate;
    File workingDirectory;

    // Get the task arguments.
    workingDirectoryString =
        getStringArgument(
            taskConfig,
            ARG_WORKING_DIRECTORY,
            getDefaultStringArgument(taskConfig, DEFAULT_WORKING_DIRECTORY));
    initialDate = getDateArgument(taskConfig, ARG_INITIAL_DATE, TimeZone.getTimeZone("UTC"));

    // Convert argument strings to strongly typed objects.
    workingDirectory = new File(workingDirectoryString);

    return new RunnableTaskManager(
        taskConfig.getId(),
        new IntervalDownloaderInitializer(workingDirectory, initialDate),
        taskConfig.getPipeArgs());
  }
  /** {@inheritDoc} */
  @Override
  protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {
    String directoryName;
    File directory;
    boolean enableWayTileIndex;
    ReadDataset task;

    // Get the task arguments.
    directoryName =
        getStringArgument(
            taskConfig,
            ARG_DIRECTORY_NAME,
            getDefaultStringArgument(taskConfig, DEFAULT_DIRECTORY_NAME));
    enableWayTileIndex =
        getBooleanArgument(taskConfig, ARG_ENABLE_WAY_TILE_INDEX, DEFAULT_ENABLE_WAY_TILE_INDEX);

    // Create a file object from the directory name provided.
    directory = new File(directoryName);

    // Build the task object.
    task = new ReadDataset(directory, enableWayTileIndex);

    return new RunnableDatasetSourceManager(taskConfig.getId(), task, taskConfig.getPipeArgs());
  }