org.openstreetmap.osmosis.core.pipeline.common
Class TaskManagerFactory

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory
Direct Known Subclasses:
AreaFilterTaskManagerFactory, AreaFilterTaskManagerFactory, ChangeAppenderFactory, ChangeApplierFactory, ChangeApplierFactory, ChangeBufferFactory, ChangeBufferFactory, ChangeDeriverFactory, ChangeDeriverFactory, ChangeDownloaderFactory, ChangeDownloadInitializerFactory, ChangeMergerFactory, ChangeMergerFactory, ChangeProgressLoggerFactory, ChangeProgressLoggerFactory, ChangeSorterFactory, ChangeSorterFactory, ChangeTagSorterFactory, ChangeTeeFactory, ChangeTeeFactory, DatabaseTaskManagerFactory, DatasetBoundingBoxFilterFactory, DatasetBoundingBoxFilterFactory, DumpDatasetFactory, DumpDatasetFactory, EntityBufferFactory, EntityBufferFactory, EntityMergerFactory, EntityMergerFactory, EntityProgressLoggerFactory, EntityProgressLoggerFactory, EntityReporterFactory, EntityReporterFactory, EntitySorterFactory, EntitySorterFactory, EntityTeeFactory, EntityTeeFactory, IntegrityReporterFactory, IntegrityReporterFactory, IntervalDownloaderFactory, IntervalDownloaderInitializerFactory, MigrateChangeV05ToV06Factory, MigrateV05ToV06Factory, NodeKeyFilterFactory, NodeKeyFilterFactory, NodeKeyValueFilterFactory, NodeKeyValueFilterFactory, NullChangeWriterFactory, NullChangeWriterFactory, NullWriterFactory, NullWriterFactory, PostgreSqlDatasetDumpWriterFactory, PostgreSqlDatasetDumpWriterFactory, ReadDatasetFactory, ReadDatasetFactory, ReplicationDownloaderFactory, ReplicationDownloaderInitializerFactory, ReplicationFileMergerFactory, ReplicationFileMergerInitializerFactory, TagRemoverFactory, TagSorterFactory, UsedNodeFilterFactory, UsedNodeFilterFactory, WayKeyValueFilterFactory, WayKeyValueFilterFactory, WriteDatasetFactory, WriteDatasetFactory, XmlDownloaderFactory, XmlDownloaderFactory, XmlTaskManagerFactory

public abstract class TaskManagerFactory
extends java.lang.Object

All task implementations require a corresponding task manager factory. This task manager factory is responsible for instantiating a task based upon command line arguments, and instantiating a task manager to manage the task within a pipeline. The factories are singleton instances registered globally and re-used for every task to be created.

Author:
Brett Henderson

Constructor Summary
protected TaskManagerFactory()
          Creates a new instance.
 
Method Summary
 TaskManager createTaskManager(TaskConfiguration taskConfig)
          Create a new task manager containing a task instance.
protected abstract  TaskManager createTaskManagerImpl(TaskConfiguration taskConfig)
          Create a new task manager containing a task instance.
protected  boolean doesArgumentExist(TaskConfiguration taskConfig, java.lang.String argName)
          Checks if the specified argument has been supplied.
protected  boolean getBooleanArgument(TaskConfiguration taskConfig, java.lang.String argName, boolean defaultValue)
          Utility method for retrieving a boolean argument value from a Map of task arguments.
protected  java.util.Date getDateArgument(TaskConfiguration taskConfig, java.lang.String argName, java.util.Date defaultValue)
          Utility method for retrieving a date argument value from a Map of task arguments.
protected  java.util.Date getDateArgument(TaskConfiguration taskConfig, java.lang.String argName, java.util.TimeZone timeZone)
          Utility method for retrieving a date argument value from a Map of task arguments.
protected  int getDefaultIntegerArgument(TaskConfiguration taskConfig, int defaultValue)
          Utility method for retrieving the default argument for the task as an integer.
protected  java.lang.String getDefaultStringArgument(TaskConfiguration taskConfig, java.lang.String defaultValue)
          Utility method for retrieving the default argument for the task as a String.
protected  double getDoubleArgument(TaskConfiguration taskConfig, java.lang.String argName, double defaultValue)
          Utility method for retrieving a double argument value from a Map of task arguments.
protected  int getIntegerArgument(TaskConfiguration taskConfig, java.lang.String argName)
          Utility method for retrieving an integer argument value from a Map of task arguments.
protected  int getIntegerArgument(TaskConfiguration taskConfig, java.lang.String argName, int defaultValue)
          Utility method for retrieving an integer argument value from a Map of task arguments.
protected  java.lang.String getStringArgument(TaskConfiguration taskConfig, java.lang.String argName)
          Utility method for retrieving a String argument value from a Map of task arguments.
protected  java.lang.String getStringArgument(TaskConfiguration taskConfig, java.lang.String argName, java.lang.String defaultValue)
          Utility method for retrieving a String argument value from a Map of task arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskManagerFactory

protected TaskManagerFactory()
Creates a new instance.

Method Detail

createTaskManager

public TaskManager createTaskManager(TaskConfiguration taskConfig)
Create a new task manager containing a task instance.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
Returns:
The newly created task manager.

createTaskManagerImpl

protected abstract TaskManager createTaskManagerImpl(TaskConfiguration taskConfig)
Create a new task manager containing a task instance.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
Returns:
The newly created task manager.

doesArgumentExist

protected boolean doesArgumentExist(TaskConfiguration taskConfig,
                                    java.lang.String argName)
Checks if the specified argument has been supplied.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
argName - The name of the argument.
Returns:
True if the argument has been supplied.

getDefaultStringArgument

protected java.lang.String getDefaultStringArgument(TaskConfiguration taskConfig,
                                                    java.lang.String defaultValue)
Utility method for retrieving the default argument for the task as a String.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
defaultValue - The default value of the argument if not value is available.
Returns:
The value of the argument.

getStringArgument

protected java.lang.String getStringArgument(TaskConfiguration taskConfig,
                                             java.lang.String argName)
Utility method for retrieving a String argument value from a Map of task arguments.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
argName - The name of the argument.
Returns:
The value of the argument.

getStringArgument

protected java.lang.String getStringArgument(TaskConfiguration taskConfig,
                                             java.lang.String argName,
                                             java.lang.String defaultValue)
Utility method for retrieving a String argument value from a Map of task arguments.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
argName - The name of the argument.
defaultValue - The default value of the argument if not value is available.
Returns:
The value of the argument.

getDefaultIntegerArgument

protected int getDefaultIntegerArgument(TaskConfiguration taskConfig,
                                        int defaultValue)
Utility method for retrieving the default argument for the task as an integer.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
defaultValue - The default value of the argument if not value is available.
Returns:
The value of the argument.

getIntegerArgument

protected int getIntegerArgument(TaskConfiguration taskConfig,
                                 java.lang.String argName)
Utility method for retrieving an integer argument value from a Map of task arguments.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
argName - The name of the argument.
Returns:
The value of the argument.

getIntegerArgument

protected int getIntegerArgument(TaskConfiguration taskConfig,
                                 java.lang.String argName,
                                 int defaultValue)
Utility method for retrieving an integer argument value from a Map of task arguments.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
argName - The name of the argument.
defaultValue - The default value of the argument if not value is available.
Returns:
The value of the argument.

getDoubleArgument

protected double getDoubleArgument(TaskConfiguration taskConfig,
                                   java.lang.String argName,
                                   double defaultValue)
Utility method for retrieving a double argument value from a Map of task arguments.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
argName - The name of the argument.
defaultValue - The default value of the argument if not value is available.
Returns:
The value of the argument.

getDateArgument

protected java.util.Date getDateArgument(TaskConfiguration taskConfig,
                                         java.lang.String argName,
                                         java.util.Date defaultValue)
Utility method for retrieving a date argument value from a Map of task arguments.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
argName - The name of the argument.
defaultValue - The default value of the argument if not value is available.
Returns:
The value of the argument.

getDateArgument

protected java.util.Date getDateArgument(TaskConfiguration taskConfig,
                                         java.lang.String argName,
                                         java.util.TimeZone timeZone)
Utility method for retrieving a date argument value from a Map of task arguments.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
argName - The name of the argument.
timeZone - The time zone to parse the date in.
Returns:
The value of the argument.

getBooleanArgument

protected boolean getBooleanArgument(TaskConfiguration taskConfig,
                                     java.lang.String argName,
                                     boolean defaultValue)
Utility method for retrieving a boolean argument value from a Map of task arguments.

Parameters:
taskConfig - Contains all information required to instantiate and configure the task.
argName - The name of the argument.
defaultValue - The default value of the argument if not value is available.
Returns:
The value of the argument.