public class GeonamesFeatureSimpleImporter extends AbstractSimpleImporterProcessor
| Modifier and Type | Field and Description |
|---|---|
protected Pattern |
acceptedPatterns |
protected IAdmDao |
admDao |
protected IAlternateNameDao |
alternateNameDao |
protected ICityDao |
cityDao |
protected ICountryDao |
countryDao |
protected IGisFeatureDao |
gisFeatureDao |
protected IGisDao<? extends GisFeature>[] |
iDaos |
protected static org.slf4j.Logger |
logger |
protected IMunicipalityDetector |
municipalityDetector |
protected ISolRSynchroniser |
solRSynchroniser |
COMMENT_START, currentFile, importerConfig, in, internationalisationService, readFileLine, status, statusMessage, totalReadLine, transactionManager, txDefinition, txStatus| Constructor and Description |
|---|
GeonamesFeatureSimpleImporter()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected GisFeature |
correctPlaceType(GisFeature featureObject,
String name) |
protected void |
flushAndClear()
Should flush and clear all the Daos that are used by the processor.
|
protected File[] |
getFiles() |
protected int |
getNumberOfColumns() |
protected boolean |
isAdmMode() |
protected Adm |
processAdm(String[] fields,
GisFeature gisFeature) |
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 |
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.
|
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 ICityDao cityDao
protected IGisFeatureDao gisFeatureDao
protected IAlternateNameDao alternateNameDao
protected IAdmDao admDao
protected ICountryDao countryDao
protected Pattern acceptedPatterns
protected ISolRSynchroniser solRSynchroniser
@Autowired protected IGisDao<? extends GisFeature>[] iDaos
@Autowired protected IMunicipalityDetector municipalityDetector
public GeonamesFeatureSimpleImporter()
protected void processData(String line)
AbstractSimpleImporterProcessorprocessData in class AbstractSimpleImporterProcessorline - the line to processprotected GisFeature correctPlaceType(GisFeature featureObject, String name)
protected boolean isAdmMode()
protected Adm processAdm(String[] fields, GisFeature gisFeature)
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 setAlternateNameDao(IAlternateNameDao alternateNameDao)
alternateNameDao - The alternateNameDao to setpublic void setGisFeatureDao(IGisFeatureDao gisFeatureDao)
gisFeatureDao - The GisFeatureDao to setpublic void setAdmDao(IAdmDao admDao)
admDao - the admDao to setpublic void setup()
AbstractSimpleImporterProcessorsetup in class AbstractSimpleImporterProcessorprotected void tearDown()
AbstractSimpleImporterProcessortearDown in class AbstractSimpleImporterProcessorpublic void setCountryDao(ICountryDao countryDao)
countryDao - The countryDao to setprotected File[] getFiles()
getFiles in class AbstractSimpleImporterProcessorImporterHelperpublic void setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)
solRSynchroniser - the solRSynchroniser to setpublic void setIDaos(IGisDao<? extends GisFeature>[] daos)
daos - the iDaos to setpublic List<NameValueDTO<Integer>> rollback()
IImporterProcessorCopyright © 2015. All rights reserved.