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, startTransactionprotected 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)
AbstractSimpleImporterProcessorprocessData in class AbstractSimpleImporterProcessorline - 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 IImporterProcessorshouldBeSkipped in class AbstractSimpleImporterProcessorprotected boolean shouldIgnoreFirstLine()
AbstractSimpleImporterProcessorshouldIgnoreFirstLine in class AbstractSimpleImporterProcessorprotected boolean shouldIgnoreComments()
AbstractSimpleImporterProcessorshouldIgnoreComments in class AbstractSimpleImporterProcessorAbstractSimpleImporterProcessor.COMMENT_STARTprotected void setCommitFlushMode()
AbstractSimpleImporterProcessorsetCommitFlushMode in class AbstractSimpleImporterProcessorAbstractSimpleImporterProcessor.flushAndClear()protected void flushAndClear()
AbstractSimpleImporterProcessorflushAndClear in class AbstractSimpleImporterProcessorprotected int getNumberOfColumns()
getNumberOfColumns in class AbstractSimpleImporterProcessorpublic 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()
AbstractSimpleImporterProcessorsetup in class AbstractSimpleImporterProcessorprotected void tearDown()
AbstractSimpleImporterProcessortearDown in class AbstractSimpleImporterProcessorprotected File[] getFiles()
getFiles in class AbstractSimpleImporterProcessorImporterHelperpublic void setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)
solRSynchroniser - the solRSynchroniser to setpublic List<NameValueDTO<Integer>> rollback()
IImporterProcessorpublic void setZipCodeDao(IZipCodeDao zipCodeDao)
public void setFullTextSearchEngine(com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine)
public void setIdGenerator(IIdGenerator idGenerator)
Copyright © 2015. All rights reserved.