Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gisgraphy.domain.geoloc.importer
Class GeonamesFeatureImporter

    java.lang.Object
      com.gisgraphy.domain.geoloc.importer.AbstractGeonamesProcessor
          com.gisgraphy.domain.geoloc.importer.GeonamesFeatureImporter

All Implemented Interfaces:
  IGeonamesProcessor

    public class GeonamesFeatureImporter

extends AbstractGeonamesProcessor

Import the Features from a Geonames dump file.

Author:
  David Masclet

Field Summary

Fields inherited from class com.gisgraphy.domain.geoloc.importer.AbstractGeonamesProcessor
`COMMENT_START, currentFile, importerConfig, in, logger, readFileLine, statusMessage, totalReadLine`

Constructor Summary
`GeonamesFeatureImporter()` Default constructor

Method Summary
`protected void` | `flushAndClear()` Should flush and clear all the Daos that are used by the processor.
`protected java.io.File[]` | `getFiles()`
`protected int` | `getNumberOfColumns()`
`protected void` | `processData(java.lang.String line)` Process a read line of the geonames file, must be implemented by the concrete class
`java.util.List<NameValueDTO<java.lang.Integer>>` | `rollback()` /!
`void` | `setAdmDao(IAdmDao admDao)`
`void` | `setAlternateNameDao(IAlternateNameDao alternateNameDao)`
`void` | `setCityDao(ICityDao cityDao)`
`protected void` | `setCommitFlushMode()` Will flush after every commit
`void` | `setCountryDao(ICountryDao countryDao)`
`void` | `setGisFeatureDao(IGisFeatureDao gisFeatureDao)`
`void` | `setIDaos(IGisDao<? extends GisFeature>[] daos)`
`void` | `setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)`
`void` | `setup()` Template method that can be override.
`protected boolean` | `shouldIgnoreComments()` Whether the filter should ignore the comments (i.e. lines starting with #)
`protected boolean` | `shouldIgnoreFirstLine()` Template Method : Whether the processor should ignore the first line of the input
`protected void` | `tearDown()` Template method that can be override.

Methods inherited from class com.gisgraphy.domain.geoloc.importer.AbstractGeonamesProcessor
`checkNumberOfColumn, countLines, dumpFields, getCurrentFileName, getMaxInsertsBeforeFlush, getNumberOfLinesToProcess, getReadFileLine, getStatus, getStatusMessage, getTotalReadLine, isEmptyField, isEndOfDocument, process, readLineAndProcessData, resetStatusFields, setImporterConfig, setTransactionManager`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GeonamesFeatureImporter

    public GeonamesFeatureImporter()

  Default constructor

Method Detail

### processData

    protected void processData(java.lang.String line)

  Description copied from class: `AbstractGeonamesProcessor`
  Process a read line of the geonames file, must be implemented by the concrete class

  Specified by:
    `processData` in class `AbstractGeonamesProcessor`
  Parameters:
    `line` - the line to process

### shouldIgnoreFirstLine

    protected boolean shouldIgnoreFirstLine()

  Description copied from class: `AbstractGeonamesProcessor`
  Template Method : Whether the processor should ignore the first line of the input

  Specified by:
    `shouldIgnoreFirstLine` in class `AbstractGeonamesProcessor`
  Returns:
    true if the processor should ignore first line

### shouldIgnoreComments

    protected boolean shouldIgnoreComments()

  Description copied from class: `AbstractGeonamesProcessor`
  Whether the filter should ignore the comments (i.e. lines starting with #)

  Specified by:
    `shouldIgnoreComments` in class `AbstractGeonamesProcessor`
  See Also:
    `AbstractGeonamesProcessor.COMMENT_START`

### setCommitFlushMode

    protected void setCommitFlushMode()

  Description copied from class: `AbstractGeonamesProcessor`
  Will flush after every commit

  Specified by:
    `setCommitFlushMode` in class `AbstractGeonamesProcessor`
  See Also:
    `AbstractGeonamesProcessor.flushAndClear()`

### flushAndClear

    protected void flushAndClear()

  Description copied from class: `AbstractGeonamesProcessor`
  Should flush and clear all the Daos that are used by the processor. This avoid memory leak

  Specified by:
    `flushAndClear` in class `AbstractGeonamesProcessor`

### getNumberOfColumns

    protected int getNumberOfColumns()

  Specified by:
    `getNumberOfColumns` in class `AbstractGeonamesProcessor`
  Returns:
    the number of fields the processed Geonames file should have

### setCityDao

    public void setCityDao(ICityDao cityDao)

  Parameters:
    `cityDao` - The CityDao to set

### setAlternateNameDao

    public void setAlternateNameDao(IAlternateNameDao alternateNameDao)

  Parameters:
    `alternateNameDao` - The alternateNameDao to set

### setGisFeatureDao

    public void setGisFeatureDao(IGisFeatureDao gisFeatureDao)

  Parameters:
    `gisFeatureDao` - The GisFeatureDao to set

### setAdmDao

    public void setAdmDao(IAdmDao admDao)

  Parameters:
    `admDao` - the admDao to set

### setup

    public void setup()

  Description copied from class: `AbstractGeonamesProcessor`
  Template method that can be override. This method is called before the process start. it is not called for each file processed.

  Overrides:
    `setup` in class `AbstractGeonamesProcessor`

### tearDown

    protected void tearDown()

  Description copied from class: `AbstractGeonamesProcessor`
  Template method that can be override. This method is called after the end of the process. it is not called for each file processed.

  Overrides:
    `tearDown` in class `AbstractGeonamesProcessor`

### setCountryDao

    public void setCountryDao(ICountryDao countryDao)

  Parameters:
    `countryDao` - The countryDao to set

### getFiles

    protected java.io.File[] getFiles()

  Specified by:
    `getFiles` in class `AbstractGeonamesProcessor`
  Returns:
    The files to be process
  See Also:
    `ImporterHelper`

### setSolRSynchroniser

    public void setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)

  Parameters:
    `solRSynchroniser` - the solRSynchroniser to set

### setIDaos

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

  Parameters:
    `daos` - the iDaos to set

### rollback

    public java.util.List<NameValueDTO<java.lang.Integer>> rollback()

  Description copied from interface: `IGeonamesProcessor`
  /!\ USE THIS METHOD VERY CAREFULLY /!\ : If you call this function, all the imported data for the specified importer will be deleted

  Returns:
    a NameValueDTO with the name of the deleted object and the number of deleted Object. No entry will be return for Object that were 0 object will be deleted.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009. All Rights Reserved.