com.gisgraphy.importer

## Class ImporterManager

- java.lang.Object
- - com.gisgraphy.importer.ImporterManager

- All Implemented Interfaces:
    IImporterManager

      public class ImporterManager
      extends Object
      implements IImporterManager

  Do the importing stuff
  Author:
    David Masclet

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `logger` The logger

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ImporterManager()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getFormatedTimeElapsed()`
    `ImporterConfig` | `getImporterConfig()`
    `List<IImporterProcessor>` | `getImporters()`
    `List<ImporterStatusDto>` | `getStatusDtoList()`
    `long` | `getTimeElapsed()`
    `void` | `importAll()` synchronized method to Import all the GisFeatures according the `ImporterConfig` and the several importers define in the applicationContext-geoloc file.
    `boolean` | `isAlreadyDone()`
    `boolean` | `isInProgress()`
    `List<String>` | `resetImport()` /!
    `void` | `setDatabaseHelper(IDatabaseHelper databaseHelper)`
    `void` | `setIDaos(IGisDao<? extends GisFeature>[] daos)`
    `void` | `setImporterConfig(ImporterConfig importerConfig)`
    `void` | `setImporters(List<IImporterProcessor> importers)`
    `void` | `setImporterStatusListDao(IImporterStatusListDao importerStatusListDao)`
    `void` | `setSolrClient(IsolrClient solrClient)`
    `void` | `setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final org.slf4j.Logger logger

      The logger

  - ### Constructor Detail

    - #### ImporterManager

          public ImporterManager()

  - ### Method Detail

    - #### importAll

          public void importAll()

      Description copied from interface: `IImporterManager`
      synchronized method to Import all the GisFeatures according the `ImporterConfig` and the several importers define in the applicationContext-geoloc file.
      Specified by:
        `importAll` in interface `IImporterManager`

    - #### getStatusDtoList

          public List<ImporterStatusDto> getStatusDtoList()

      Specified by:
        `getStatusDtoList` in interface `IImporterManager`
      Returns:
        a list of DTO for each importers

    - #### getImporters

          public List<IImporterProcessor> getImporters()

      Specified by:
        `getImporters` in interface `IImporterManager`
      Returns:
        the importers

    - #### getImporterConfig

          public ImporterConfig getImporterConfig()

      Specified by:
        `getImporterConfig` in interface `IImporterManager`
      Returns:
        the importerConfig

    - #### getTimeElapsed

          public long getTimeElapsed()

      Specified by:
        `getTimeElapsed` in interface `IImporterManager`
      Returns:
        the time the last import took. If the import is in progress, returns the time it took from the beginning. If the import has not been started yet return 0.

    - #### getFormatedTimeElapsed

          public String getFormatedTimeElapsed()

      Specified by:
        `getFormatedTimeElapsed` in interface `IImporterManager`
      Returns:
        The human readable elapsed time .

    - #### isInProgress

          public boolean isInProgress()

      Specified by:
        `isInProgress` in interface `IImporterManager`
      Returns:
        Wether an import is in Progress

    - #### isAlreadyDone

          public boolean isAlreadyDone()
                                throws ImporterMetaDataException

      Specified by:
        `isAlreadyDone` in interface `IImporterManager`
      Returns:
        Wether the import has already been done (error or successful)
      Throws:
        `ImporterMetaDataException`

    - #### resetImport

          public List<String> resetImport()
                                   throws Exception

      Description copied from interface: `IImporterManager`
      /!\ USE THIS METHOD VERY CAREFULLY /!\ : If you call this function, all the imported data will be deleted clear all the tables with GisFeature (and subclass, adm, languages, country,...), delete alternatenames, delete all the fulltext search engine entries, in order to re-run a new import from scratch
      Specified by:
        `resetImport` in interface `IImporterManager`
      Returns:
        a list with the SQL Errors and warnings. note that you can have warning but the reset can be successful
      Throws:
        `Exception`

    - #### setSolRSynchroniser

          public void setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)

      Parameters:
        `solRSynchroniser` - the solRSynchroniser to set

    - #### setImporterConfig

          public void setImporterConfig(ImporterConfig importerConfig)

      Parameters:
        `importerConfig` - The `ImporterConfig` to set

    - #### setImporters

          public void setImporters(List<IImporterProcessor> importers)

      Parameters:
        `importers` - The importers to process

    - #### setIDaos

          public void setIDaos(IGisDao<? extends GisFeature>[] daos)

      Parameters:
        `daos` - the iDaos to set

    - #### setImporterStatusListDao

          public void setImporterStatusListDao(IImporterStatusListDao importerStatusListDao)

      Parameters:
        `importerStatusListDao` - the importerStatusListDao to set

    - #### setSolrClient

          public void setSolrClient(IsolrClient solrClient)

      Parameters:
        `solrClient` - the solrClient to set

    - #### setDatabaseHelper

          public void setDatabaseHelper(IDatabaseHelper databaseHelper)

      Parameters:
        `databaseHelper` - the databaseHelper to set

Copyright © 2015. All rights reserved.