|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gisgraphy.domain.geoloc.importer.AbstractImporterProcessor
com.gisgraphy.domain.geoloc.importer.GeonamesAlternateNamesExtracter
public class GeonamesAlternateNamesExtracter
Extract the alternateNames into separate files : one for country, one for adm1 and one for adm2
| Field Summary | |
|---|---|
protected java.io.File |
adm1file
|
protected java.io.OutputStreamWriter |
adm1fileOutputStreamWriter
|
protected java.util.Map<java.lang.Long,java.lang.String> |
adm1Map
|
protected java.io.File |
adm2file
|
protected java.io.OutputStreamWriter |
adm2fileOutputStreamWriter
|
protected java.util.Map<java.lang.Long,java.lang.String> |
adm2Map
|
protected java.io.File |
countryFile
|
protected java.io.OutputStreamWriter |
countryfileOutputStreamWriter
|
protected java.util.Map<java.lang.Long,java.lang.String> |
countryMap
|
protected java.io.File |
featuresFile
|
protected java.io.OutputStreamWriter |
featuresfileOutputStreamWriter
|
| Fields inherited from class com.gisgraphy.domain.geoloc.importer.AbstractImporterProcessor |
|---|
COMMENT_START, currentFile, importerConfig, in, internationalisationService, logger, readFileLine, status, statusMessage, totalReadLine, transactionManager |
| Constructor Summary | |
|---|---|
GeonamesAlternateNamesExtracter()
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 |
initFiles()
|
protected boolean |
lineIsAnAlternateNameForAdm1(java.lang.Long featureId)
|
protected boolean |
lineIsAnAlternateNameForCountry(java.lang.Long featureId)
|
protected boolean |
lineIsAnAlternatNameForAdm2(java.lang.Long featureId)
|
protected java.util.Map<java.lang.Long,java.lang.String> |
populateMapFromList(java.util.List<java.lang.Long> list)
|
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)
|
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. |
| Methods inherited from class com.gisgraphy.domain.geoloc.importer.AbstractImporterProcessor |
|---|
checkNumberOfColumn, countLines, dumpFields, getCurrentFileName, getMaxInsertsBeforeFlush, getNumberOfLinesToProcess, getReadFileLine, getStatus, getStatusMessage, getTotalReadLine, isEmptyField, isEndOfDocument, process, readLineAndProcessData, resetStatus, setImporterConfig, setInternationalisationService, setTransactionManager |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.File adm1file
protected java.io.File adm2file
protected java.io.File countryFile
protected java.io.File featuresFile
protected java.io.OutputStreamWriter adm1fileOutputStreamWriter
protected java.io.OutputStreamWriter adm2fileOutputStreamWriter
protected java.io.OutputStreamWriter countryfileOutputStreamWriter
protected java.io.OutputStreamWriter featuresfileOutputStreamWriter
protected java.util.Map<java.lang.Long,java.lang.String> countryMap
protected java.util.Map<java.lang.Long,java.lang.String> adm1Map
protected java.util.Map<java.lang.Long,java.lang.String> adm2Map
| Constructor Detail |
|---|
public GeonamesAlternateNamesExtracter()
| Method Detail |
|---|
protected void processData(java.lang.String line)
AbstractImporterProcessor
processData in class AbstractImporterProcessorline - the line to processprotected boolean lineIsAnAlternatNameForAdm2(java.lang.Long featureId)
protected boolean lineIsAnAlternateNameForAdm1(java.lang.Long featureId)
protected boolean lineIsAnAlternateNameForCountry(java.lang.Long featureId)
public boolean shouldBeSkipped()
shouldBeSkipped in interface IImporterProcessorshouldBeSkipped in class AbstractImporterProcessorprotected void tearDown()
AbstractImporterProcessor
tearDown in class AbstractImporterProcessorprotected void initFiles()
public void setup()
AbstractImporterProcessor
setup in class AbstractImporterProcessorprotected java.util.Map<java.lang.Long,java.lang.String> populateMapFromList(java.util.List<java.lang.Long> list)
protected boolean shouldIgnoreFirstLine()
AbstractImporterProcessor
shouldIgnoreFirstLine in class AbstractImporterProcessorprotected boolean shouldIgnoreComments()
AbstractImporterProcessor
shouldIgnoreComments in class AbstractImporterProcessorAbstractImporterProcessor.COMMENT_STARTprotected void setCommitFlushMode()
AbstractImporterProcessor
setCommitFlushMode in class AbstractImporterProcessorAbstractImporterProcessor.flushAndClear()protected void flushAndClear()
AbstractImporterProcessor
flushAndClear in class AbstractImporterProcessorprotected int getNumberOfColumns()
getNumberOfColumns in class AbstractImporterProcessorprotected java.io.File[] getFiles()
getFiles in class AbstractImporterProcessorImporterHelperpublic java.util.List<NameValueDTO<java.lang.Integer>> rollback()
IImporterProcessor
public void setAdmDao(IAdmDao admDao)
public void setCountryDao(ICountryDao countryDao)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||