public class GeonamesZipCodeSimpleImporter extends AbstractSimpleImporterProcessor
Modifier and Type | Field and Description |
---|---|
protected int[] |
accuracyToDistance |
protected IAdmDao |
admDao |
protected ICityDao |
cityDao |
protected com.gisgraphy.fulltext.IFullTextSearchEngine |
fullTextSearchEngine |
protected IGisFeatureDao |
gisFeatureDao |
protected IIdGenerator |
IdGenerator |
protected static org.slf4j.Logger |
logger |
protected ISolRSynchroniser |
solRSynchroniser |
protected IZipCodeDao |
zipCodeDao |
COMMENT_START, currentFile, importerConfig, in, internationalisationService, readFileLine, status, statusMessage, totalReadLine, transactionManager, txDefinition, txStatus
Constructor and Description |
---|
GeonamesZipCodeSimpleImporter() |
Modifier and Type | Method and Description |
---|---|
protected GisFeature |
addAndSaveZipCodeToFeature(String code,
Long featureId) |
protected GisFeature |
addNewEntityAndZip(String[] fields) |
protected com.gisgraphy.fulltext.FulltextResultsDto |
doAFulltextSearch(String query,
String countryCode) |
protected Long |
findFeature(String[] fields,
com.vividsolutions.jts.geom.Point zipPoint,
int maxDistance) |
protected Long |
findNearest(com.vividsolutions.jts.geom.Point zipPoint,
int maxDistance,
com.gisgraphy.fulltext.FulltextResultsDto results) |
protected void |
flushAndClear()
Should flush and clear all the Daos that are used by the processor.
|
protected int |
getAccurateDistance(int accuracyLevel) |
protected City |
getByShape(String countryCode,
String code,
com.vividsolutions.jts.geom.Point zipPoint) |
protected File[] |
getFiles() |
protected int |
getNumberOfColumns() |
protected void |
processData(String line)
Process a read line of the geonames file, must be implemented by the
concrete class
|
List<NameValueDTO<Integer>> |
rollback()
/!
|
void |
setAdmDao(IAdmDao admDao) |
void |
setCityDao(ICityDao cityDao) |
protected void |
setCommitFlushMode()
Will flush after every commit
|
void |
setFullTextSearchEngine(com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine) |
void |
setGisFeatureDao(IGisFeatureDao gisFeatureDao) |
void |
setIdGenerator(IIdGenerator idGenerator) |
void |
setSolRSynchroniser(ISolRSynchroniser solRSynchroniser) |
protected void |
setup()
Template method that can be override.
|
void |
setZipCodeDao(IZipCodeDao zipCodeDao) |
boolean |
shouldBeSkipped() |
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.
|
checkNumberOfColumn, commit, countLines, decrementReadedFileLine, dumpFields, getCurrentFileName, getMaxInsertsBeforeFlush, getNumberOfLinesToProcess, getReadFileLine, getStatus, getStatusMessage, getTotalReadLine, incrementReadedFileLine, isEmptyField, isEndOfDocument, needCommit, onFileProcessed, process, processError, readLineAndProcessData, resetStatus, rollbackTransaction, setImporterConfig, setInternationalisationService, setTransactionManager, startTransaction
protected static final org.slf4j.Logger logger
protected IGisFeatureDao gisFeatureDao
protected IAdmDao admDao
protected com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine
protected ISolRSynchroniser solRSynchroniser
protected ICityDao cityDao
protected IZipCodeDao zipCodeDao
protected IIdGenerator IdGenerator
protected int[] accuracyToDistance
protected void processData(String line)
AbstractSimpleImporterProcessor
processData
in class AbstractSimpleImporterProcessor
line
- the line to processprotected City getByShape(String countryCode, String code, com.vividsolutions.jts.geom.Point zipPoint)
protected Long findFeature(String[] fields, com.vividsolutions.jts.geom.Point zipPoint, int maxDistance)
protected Long findNearest(com.vividsolutions.jts.geom.Point zipPoint, int maxDistance, com.gisgraphy.fulltext.FulltextResultsDto results)
protected int getAccurateDistance(int accuracyLevel)
protected GisFeature addNewEntityAndZip(String[] fields)
protected GisFeature addAndSaveZipCodeToFeature(String code, Long featureId)
protected com.gisgraphy.fulltext.FulltextResultsDto doAFulltextSearch(String query, String countryCode)
public boolean shouldBeSkipped()
shouldBeSkipped
in interface IImporterProcessor
shouldBeSkipped
in class AbstractSimpleImporterProcessor
protected boolean shouldIgnoreFirstLine()
AbstractSimpleImporterProcessor
shouldIgnoreFirstLine
in class AbstractSimpleImporterProcessor
protected boolean shouldIgnoreComments()
AbstractSimpleImporterProcessor
shouldIgnoreComments
in class AbstractSimpleImporterProcessor
AbstractSimpleImporterProcessor.COMMENT_START
protected void setCommitFlushMode()
AbstractSimpleImporterProcessor
setCommitFlushMode
in class AbstractSimpleImporterProcessor
AbstractSimpleImporterProcessor.flushAndClear()
protected void flushAndClear()
AbstractSimpleImporterProcessor
flushAndClear
in class AbstractSimpleImporterProcessor
protected int getNumberOfColumns()
getNumberOfColumns
in class AbstractSimpleImporterProcessor
public void setCityDao(ICityDao cityDao)
cityDao
- The CityDao to setpublic void setGisFeatureDao(IGisFeatureDao gisFeatureDao)
gisFeatureDao
- The GisFeatureDao to setpublic void setAdmDao(IAdmDao admDao)
admDao
- the admDao to setprotected void setup()
AbstractSimpleImporterProcessor
setup
in class AbstractSimpleImporterProcessor
protected void tearDown()
AbstractSimpleImporterProcessor
tearDown
in class AbstractSimpleImporterProcessor
protected File[] getFiles()
getFiles
in class AbstractSimpleImporterProcessor
ImporterHelper
public void setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)
solRSynchroniser
- the solRSynchroniser to setpublic List<NameValueDTO<Integer>> rollback()
IImporterProcessor
public void setZipCodeDao(IZipCodeDao zipCodeDao)
public void setFullTextSearchEngine(com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine)
public void setIdGenerator(IIdGenerator idGenerator)
Copyright © 2015. All rights reserved.