public class GeonamesAlternateNamesExtracter extends AbstractSimpleImporterProcessor
Modifier and Type | Field and Description |
---|---|
protected File |
adm1file |
protected OutputStreamWriter |
adm1fileOutputStreamWriter |
protected Map<Long,String> |
adm1Map |
protected File |
adm2file |
protected OutputStreamWriter |
adm2fileOutputStreamWriter |
protected Map<Long,String> |
adm2Map |
protected File |
countryFile |
protected OutputStreamWriter |
countryfileOutputStreamWriter |
protected Map<Long,String> |
countryMap |
protected File |
featuresFile |
protected OutputStreamWriter |
featuresfileOutputStreamWriter |
protected static org.slf4j.Logger |
logger |
COMMENT_START, currentFile, importerConfig, in, internationalisationService, readFileLine, status, statusMessage, totalReadLine, transactionManager, txDefinition, txStatus
Constructor and Description |
---|
GeonamesAlternateNamesExtracter()
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
flushAndClear()
Should flush and clear all the Daos that are used by the processor.
|
protected File[] |
getFiles() |
protected int |
getNumberOfColumns() |
protected void |
initFiles() |
protected boolean |
lineIsAnAlternateNameForAdm1(Long featureId) |
protected boolean |
lineIsAnAlternateNameForCountry(Long featureId) |
protected boolean |
lineIsAnAlternatNameForAdm2(Long featureId) |
protected void |
onFileProcessed(File file)
hook to do when the file has been processed without error
|
protected Map<Long,String> |
populateMapFromList(List<Long> list) |
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) |
protected void |
setCommitFlushMode()
Will flush after every commit
|
void |
setCountryDao(ICountryDao countryDao) |
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, process, processError, readLineAndProcessData, resetStatus, rollbackTransaction, setImporterConfig, setInternationalisationService, setTransactionManager, startTransaction
protected static final org.slf4j.Logger logger
protected File adm1file
protected File adm2file
protected File countryFile
protected File featuresFile
protected OutputStreamWriter adm1fileOutputStreamWriter
protected OutputStreamWriter adm2fileOutputStreamWriter
protected OutputStreamWriter countryfileOutputStreamWriter
protected OutputStreamWriter featuresfileOutputStreamWriter
public GeonamesAlternateNamesExtracter()
protected void onFileProcessed(File file)
AbstractSimpleImporterProcessor
onFileProcessed
in class AbstractSimpleImporterProcessor
protected void processData(String line)
AbstractSimpleImporterProcessor
processData
in class AbstractSimpleImporterProcessor
line
- the line to processprotected boolean lineIsAnAlternatNameForAdm2(Long featureId)
protected boolean lineIsAnAlternateNameForAdm1(Long featureId)
protected boolean lineIsAnAlternateNameForCountry(Long featureId)
public boolean shouldBeSkipped()
shouldBeSkipped
in interface IImporterProcessor
shouldBeSkipped
in class AbstractSimpleImporterProcessor
protected void tearDown()
AbstractSimpleImporterProcessor
tearDown
in class AbstractSimpleImporterProcessor
protected void initFiles()
public void setup()
AbstractSimpleImporterProcessor
setup
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
protected File[] getFiles()
getFiles
in class AbstractSimpleImporterProcessor
ImporterHelper
public List<NameValueDTO<Integer>> rollback()
IImporterProcessor
public void setAdmDao(IAdmDao admDao)
public void setCountryDao(ICountryDao countryDao)
Copyright © 2015. All rights reserved.