Class ImportObjectsFromFileTaskHandler

  • All Implemented Interfaces:
    TaskHandler

    @Component
    public class ImportObjectsFromFileTaskHandler
    extends Object
    implements TaskHandler
    Task handler for "Import objects from file" task.

    Import parses the input file and add all objects to the repository.

    The import task might be executed on a different node (as usual for async tasks), but this won't work as the file is not serializable. Therefore the task needs to be locked to the executing node. (TODO)

    Author:
    Radovan Semancik
    See Also:
    TaskHandler, ResourceObjectChangeListener
    • Constructor Detail

      • ImportObjectsFromFileTaskHandler

        public ImportObjectsFromFileTaskHandler()
    • Method Detail

      • launch

        public void launch​(File input,
                           Task task,
                           OperationResult parentResult)
        Launch an import. Calling this method will start import in a new thread, possibly on a different node.
        Parameters:
        input -
        task -
        parentResult -
      • getCategoryName

        public String getCategoryName​(Task task)
        Description copied from interface: TaskHandler
        Returns a category name for a given task. In most cases, the name would be independent of concrete task.
        Specified by:
        getCategoryName in interface TaskHandler
        Parameters:
        task - a task, whose category is to be determined; if getCategoryNames() returns null, this method has to accept null value as this parameter, and return the (one) category name that it gives to all tasks
        Returns:
        a user-understandable name, like "LiveSync" or "Workflow"