Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gisgraphy.domain.geoloc.importer
Class ImporterConfig

    java.lang.Object
      com.gisgraphy.domain.geoloc.importer.ImporterConfig

    public class ImporterConfig

extends java.lang.Object

Author:
  David Masclet Represents a configuration for importers For more informations for this options see the User Guide

Field Summary
`static java.lang.String` | `DEFAULT_ACCEPT_REGEX` The default regexp if no one is specified in the env.properties file
`static java.lang.String` | `DEFAULT_ACCEPT_REGEX_CITY` The regexp to use to import all the city
`static java.lang.String` | `DEFAULT_ACCEPT_REGEX_OPTION` The regexp to use to import all the feature class / code
`AdmExtracterStrategyOptions` | `DEFAULT_ADM1_EXTRACTER_STRATEGY_OPTION` Default option if the Adm1 file has already been processed
`AdmExtracterStrategyOptions` | `DEFAULT_ADM2_EXTRACTER_STRATEGY_OPTION` Default option if the adm2 file has already been processed
`AdmExtracterStrategyOptions` | `DEFAULT_ADM3_EXTRACTER_STRATEGY_OPTION` Default option if the Adm3 file has already been processed
`AdmExtracterStrategyOptions` | `DEFAULT_ADM4_EXTRACTER_STRATEGY_OPTION` Default option if the adm4 file has already been processed
`static java.lang.String` | `DEFAULT_FEATURE_CLASS` The default feature class if no one is specified
`static java.lang.String` | `DEFAULT_FEATURE_CODE` The default feature code if no one is specified
`static int` | `DEFAULT_MAX_INSERT_BEFORE_FLUSH` Default value for `maxInsertsBeforeFlush`
`protected static org.slf4j.Logger` | `logger` The logger
`static java.lang.String` | `OPTION_SEPARATOR` A list of options is separated by this. e.g : a list of regexp options

Constructor Summary
`ImporterConfig()`

Method Summary
`java.lang.String` | `getAcceptRegExString()`
`AdmExtracterStrategyOptions` | `getAdm1ExtracterStrategyIfAlreadyExists()`
`java.lang.String` | `getAdm1FileName()`
`AdmExtracterStrategyOptions` | `getAdm2ExtracterStrategyIfAlreadyExists()`
`java.lang.String` | `getAdm2FileName()`
`AdmExtracterStrategyOptions` | `getAdm3ExtracterStrategyIfAlreadyExists()`
`java.lang.String` | `getAdm3FileName()`
`AdmExtracterStrategyOptions` | `getAdm4ExtracterStrategyIfAlreadyExists()`
`java.lang.String` | `getAdm4FileName()`
`AdmExtracterStrategyOptions` | `getAdmExtracterStrategyOptionsForAdm(int admLevel)` What should we do if the Adm file for the specified level has already been processed It is a wrapper method around `DEFAULT_ADM3_EXTRACTER_STRATEGY_OPTION` and `DEFAULT_ADM4_EXTRACTER_STRATEGY_OPTION`
`java.lang.String` | `getAlternateNamesFileName()`
`java.lang.String` | `getCountriesFileName()`
`java.util.List<java.lang.String>` | `getDownloadFilesListFromOption()`
`java.lang.String` | `getFilesToDownload()`
`java.lang.String` | `getGeonamesDir()`
`java.lang.String` | `getGeonamesDownloadURL()`
`java.lang.String` | `getLanguageFileName()`
`int` | `getMaxInsertsBeforeFlush()`
`boolean` | `isImportGisFeatureEmbededAlternateNames()`
`boolean` | `isMissingRequiredFieldThrows()`
`boolean` | `isRetrieveFiles()`
`boolean` | `isSyncAdmCodesWithLinkedAdmOnes()`
`boolean` | `isTryToDetectAdmIfNotFound()`
`boolean` | `isWrongNumberOfFieldsThrows()`
`void` | `setAcceptRegExString(java.lang.String acceptRegExString)` List of regular expressions for feature class and feature code to be import.
`void` | `setAdm1ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions adm1ExtracterStrategy)` What should we do if the Adm1 file has already been processed
`void` | `setAdm1FileName(java.lang.String adm1FileName)` The name of the Geonames dump file containing the ADM with level 1
`void` | `setAdm2ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions adm2ExtracterStrategy)` What should we do if the Adm2 file has already been processed
`void` | `setAdm2FileName(java.lang.String adm2FileName)` The name of the Geonames dump file containing the ADM with level 2
`void` | `setAdm3ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions adm3ExtracterStrategy)` What should we do if the Adm3 file has already been processed
`void` | `setAdm3FileName(java.lang.String adm3FileName)` The name of the Geonames dump file containing the ADM with level 3
`void` | `setAdm4ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions adm4ExtracterStrategy)` What should we do if the Adm4 file has already been processed
`void` | `setAdm4FileName(java.lang.String adm4FileName)` The name of the Geonames dump file containing the ADM with level 4
`void` | `setAlternateNamesFileName(java.lang.String alternateNamesFileName)` The name of the Geonames dump file containing the alternate names
`void` | `setCountriesFileName(java.lang.String countryFileName)` The name of the Geonames dump file containing the countries informations
`void` | `setFilesToDownload(java.lang.String filesToDownload)` The list of the files to be downloaded from the `geonamesDownloadURL`. the several files will be separated by `OPTION_SEPARATOR`
`void` | `setGeonamesDir(java.lang.String importerGeonamesDir)` The directory where the Geonames files will be retrieved and processed.
`void` | `setGeonamesDownloadURL(java.lang.String importerGeonamesDownloadURL)` The HTTP URL of the directory Where Geonames file are to be download from
`void` | `setImportGisFeatureEmbededAlternateNames(boolean importGisFeatureEmbededAlternateNames)` Set to true the alternate names of the country dump are imported.
`void` | `setLanguageFileName(java.lang.String languageFileName)` The name of the Geonames dump file containing the language informations
`void` | `setMaxInsertsBeforeFlush(int maxInsertsBeforeFlush)` Optional setting that allows to specify the number of inserts that can be done before flushing.
`void` | `setMissingRequiredFieldThrows(boolean missingRequiredFieldThrows)` Set to true this options force the import process to stop if a required field is missing.
`void` | `setRetrieveFiles(boolean retrieveFiles)` Whether we should download the geonames file or use the one already present in the `geonamesDir`
`void` | `setSyncAdmCodesWithLinkedAdmOnes(boolean setAdmCodesWithLinkedAdmObject)` The linked Adm may not be the same as the one which would be found with the ADMcodes from the csv file if TryToDetectAdmIfNotFound is set to true. in this case error corecting is done. tis option determine if the ADMXcode must be equals to the linked ADM or if they must be equals to the value in the CSVFile note that the admXnames are always sync with the Linked Adm if true : the AdmXcodes of the imported GisFeature will be the gisFeature.getAdm.getAdmXcode.
`void` | `setTryToDetectAdmIfNotFound(boolean tryToDetectAdmIfNotFound)` If this option is set to true : The importer will try to detect Adm for features if the AdmXcodes values does not correspond to a known Adm. it is a process of error correction if set to false error correction is disabled
`void` | `setWrongNumberOfFieldsThrows(boolean wrongNumberOfFieldsThrows)` Set to true this option force the import process to stop if an error is throw.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_FEATURE_CODE

    public static final java.lang.String DEFAULT_FEATURE_CODE

  The default feature code if no one is specified

  See Also:
    Constant Field Values

### DEFAULT_FEATURE_CLASS

    public static final java.lang.String DEFAULT_FEATURE_CLASS

  The default feature class if no one is specified

  See Also:
    Constant Field Values

### DEFAULT_ACCEPT_REGEX

    public static final java.lang.String DEFAULT_ACCEPT_REGEX

  The default regexp if no one is specified in the env.properties file

  See Also:
    Constant Field Values

### DEFAULT_ACCEPT_REGEX_CITY

    public static final java.lang.String DEFAULT_ACCEPT_REGEX_CITY

  The regexp to use to import all the city

  See Also:
    Constant Field Values

### DEFAULT_ACCEPT_REGEX_OPTION

    public static final java.lang.String DEFAULT_ACCEPT_REGEX_OPTION

  The regexp to use to import all the feature class / code

  See Also:
    Constant Field Values

### DEFAULT_MAX_INSERT_BEFORE_FLUSH

    public static final int DEFAULT_MAX_INSERT_BEFORE_FLUSH

  Default value for `maxInsertsBeforeFlush`

  See Also:
    Constant Field Values

### DEFAULT_ADM1_EXTRACTER_STRATEGY_OPTION

    public AdmExtracterStrategyOptions DEFAULT_ADM1_EXTRACTER_STRATEGY_OPTION

  Default option if the Adm1 file has already been processed

  See Also:
    `AdmExtracterStrategyOptions`

### DEFAULT_ADM2_EXTRACTER_STRATEGY_OPTION

    public AdmExtracterStrategyOptions DEFAULT_ADM2_EXTRACTER_STRATEGY_OPTION

  Default option if the adm2 file has already been processed

  See Also:
    `AdmExtracterStrategyOptions`

### DEFAULT_ADM3_EXTRACTER_STRATEGY_OPTION

    public AdmExtracterStrategyOptions DEFAULT_ADM3_EXTRACTER_STRATEGY_OPTION

  Default option if the Adm3 file has already been processed

  See Also:
    `AdmExtracterStrategyOptions`

### DEFAULT_ADM4_EXTRACTER_STRATEGY_OPTION

    public AdmExtracterStrategyOptions DEFAULT_ADM4_EXTRACTER_STRATEGY_OPTION

  Default option if the adm4 file has already been processed

  See Also:
    `AdmExtracterStrategyOptions`

### logger

    protected static final org.slf4j.Logger logger

  The logger

### OPTION_SEPARATOR

    public static final java.lang.String OPTION_SEPARATOR

  A list of options is separated by this. e.g : a list of regexp options

  See Also:
    Constant Field Values

Constructor Detail

### ImporterConfig

    public ImporterConfig()

Method Detail

### getDownloadFilesListFromOption

    public java.util.List<java.lang.String> getDownloadFilesListFromOption()

  Returns:
    A list of string with the files to be download, processed from `filesToDownload`

### getAdmExtracterStrategyOptionsForAdm

    public AdmExtracterStrategyOptions getAdmExtracterStrategyOptionsForAdm(int admLevel)

  What should we do if the Adm file for the specified level has already been processed It is a wrapper method around `DEFAULT_ADM3_EXTRACTER_STRATEGY_OPTION` and `DEFAULT_ADM4_EXTRACTER_STRATEGY_OPTION`

### getAcceptRegExString

    public java.lang.String getAcceptRegExString()

  Returns:
    The option
  See Also:
    `setAcceptRegExString(String)`

### isSyncAdmCodesWithLinkedAdmOnes

    public boolean isSyncAdmCodesWithLinkedAdmOnes()

  Returns:
    The option
  See Also:
    `setSyncAdmCodesWithLinkedAdmOnes(boolean)`

### isTryToDetectAdmIfNotFound

    public boolean isTryToDetectAdmIfNotFound()

  Returns:
    The option
  See Also:
    `setTryToDetectAdmIfNotFound(boolean)`

### setAcceptRegExString

    public void setAcceptRegExString(java.lang.String acceptRegExString)

  List of regular expressions for feature class and feature code to be import.
  Important : The regular expressions must match featureClass.featureCode and are separated by `OPTION_SEPARATOR`.
  The gisFeature which match "A.ADM." and "A.PCL." regex are automaticaly imported (Administrative division and country).
  Examples :
  - .* : import all gisfeatures, no matter their feature class and feature code
  - `DEFAULT_ACCEPT_REGEX_CITY` : import Israeli settlements and all the cities except destroyed and abandoned city
  - V.FRST. : import all the forests

  Parameters:
    `acceptRegExString` - the option

### setSyncAdmCodesWithLinkedAdmOnes

    public void setSyncAdmCodesWithLinkedAdmOnes(boolean setAdmCodesWithLinkedAdmObject)

  The linked Adm may not be the same as the one which would be found with the ADMcodes from the csv file if TryToDetectAdmIfNotFound is set to true. in this case error corecting is done. tis option determine if the ADMXcode must be equals to the linked ADM or if they must be equals to the value in the CSVFile note that the admXnames are always sync with the Linked Adm if true : the AdmXcodes of the imported GisFeature will be the gisFeature.getAdm.getAdmXcode.
  if false : the AdmXcode for a GisFeature will be the values of the CSV dump file. That means : If the option tryToDetectAdmIfNotFound is set to true : the Adm will be suggest if the AdmXcodes values of the CSV dump file doesn't correspond to an already known Adm. In that case the suggested Adm will have AdmXcodes different from the CSV dump file ones. This option allow you to set The AdmXcodes for the gisFeature with the detected Adm value instead of the CSV file ones.
  In other words : AdmXcodes of the linked Adm and AdmXcodes of the gisFeature will always be the same if this option is true. it is recommended to let it to true

  Parameters:
    `setAdmCodesWithLinkedAdmObject` - The option to set

### setTryToDetectAdmIfNotFound

    public void setTryToDetectAdmIfNotFound(boolean tryToDetectAdmIfNotFound)

  If this option is set to true : The importer will try to detect Adm for features if the AdmXcodes values does not correspond to a known Adm. it is a process of error correction if set to false error correction is disabled

  Parameters:
    `tryToDetectAdmIfNotFound` - The option

### getAdm1ExtracterStrategyIfAlreadyExists

    public AdmExtracterStrategyOptions getAdm1ExtracterStrategyIfAlreadyExists()

  Returns:
    The option
  See Also:
    `setAdm1ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions)`

### setAdm1ExtracterStrategyIfAlreadyExists

    public void setAdm1ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions adm1ExtracterStrategy)

  What should we do if the Adm1 file has already been processed

  Parameters:
    `adm1ExtracterStrategy` - The option
  See Also:
    `DEFAULT_ADM1_EXTRACTER_STRATEGY_OPTION`

### getAdm2ExtracterStrategyIfAlreadyExists

    public AdmExtracterStrategyOptions getAdm2ExtracterStrategyIfAlreadyExists()

  Returns:
    The option
  See Also:
    `setAdm2ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions)`

### setAdm2ExtracterStrategyIfAlreadyExists

    public void setAdm2ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions adm2ExtracterStrategy)

  What should we do if the Adm2 file has already been processed

  Parameters:
    `adm2ExtracterStrategy` - The option
  See Also:
    `DEFAULT_ADM2_EXTRACTER_STRATEGY_OPTION`

### getAdm3ExtracterStrategyIfAlreadyExists

    public AdmExtracterStrategyOptions getAdm3ExtracterStrategyIfAlreadyExists()

  Returns:
    The option
  See Also:
    `setAdm3ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions)`

### setAdm3ExtracterStrategyIfAlreadyExists

    public void setAdm3ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions adm3ExtracterStrategy)

  What should we do if the Adm3 file has already been processed

  Parameters:
    `adm3ExtracterStrategy` - The option
  See Also:
    `DEFAULT_ADM3_EXTRACTER_STRATEGY_OPTION`

### getAdm4ExtracterStrategyIfAlreadyExists

    public AdmExtracterStrategyOptions getAdm4ExtracterStrategyIfAlreadyExists()

  Returns:
    the option
  See Also:
    `setAdm4ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions)`

### setAdm4ExtracterStrategyIfAlreadyExists

    public void setAdm4ExtracterStrategyIfAlreadyExists(AdmExtracterStrategyOptions adm4ExtracterStrategy)

  What should we do if the Adm4 file has already been processed

  Parameters:
    `adm4ExtracterStrategy` - The option
  See Also:
    `DEFAULT_ADM3_EXTRACTER_STRATEGY_OPTION`

### isMissingRequiredFieldThrows

    public boolean isMissingRequiredFieldThrows()

  Returns:
    The option
  See Also:
    `setMissingRequiredFieldThrows(boolean)`, `MissingRequiredFieldException`

### setMissingRequiredFieldThrows

    public void setMissingRequiredFieldThrows(boolean missingRequiredFieldThrows)

  Set to true this options force the import process to stop if a required field is missing.
  Set to false it ignore the error and try to continue (recommended)

  Parameters:
    `missingRequiredFieldThrows` - The option
  See Also:
    `MissingRequiredFieldException`

### isWrongNumberOfFieldsThrows

    public boolean isWrongNumberOfFieldsThrows()

  Returns:
    The option
  See Also:
    `setWrongNumberOfFieldsThrows(boolean)`

### setWrongNumberOfFieldsThrows

    public void setWrongNumberOfFieldsThrows(boolean wrongNumberOfFieldsThrows)

  Set to true this option force the import process to stop if an error is throw.
  Set to false it ignore the error and try to continue (recommended)

  Parameters:
    `wrongNumberOfFieldsThrows` - The option

### isImportGisFeatureEmbededAlternateNames

    public boolean isImportGisFeatureEmbededAlternateNames()

  Returns:
    The option
  See Also:
    `setImportGisFeatureEmbededAlternateNames(boolean)`

### setImportGisFeatureEmbededAlternateNames

    public void setImportGisFeatureEmbededAlternateNames(boolean importGisFeatureEmbededAlternateNames)

  Set to true the alternate names of the country dump are imported. Set to false it will import the alternate names from the alternatenames dump file

  Parameters:
    `importGisFeatureEmbededAlternateNames` - The option

### getGeonamesDir

    public java.lang.String getGeonamesDir()

  Returns:
    The option
  See Also:
    `setGeonamesDir(String)`

### setGeonamesDir

    public void setGeonamesDir(java.lang.String importerGeonamesDir)

  The directory where the Geonames files will be retrieved and processed. It must ends with / or \ according to the System

  Parameters:
    `importerGeonamesDir` - the option

### getGeonamesDownloadURL

    public java.lang.String getGeonamesDownloadURL()

  Returns:
    The option
  See Also:
    `setGeonamesDownloadURL(String)`

### setGeonamesDownloadURL

    public void setGeonamesDownloadURL(java.lang.String importerGeonamesDownloadURL)

  The HTTP URL of the directory Where Geonames file are to be download from

  Parameters:
    `importerGeonamesDownloadURL` - The option

### isRetrieveFiles

    public boolean isRetrieveFiles()

  Returns:
    The option
  See Also:
    `setRetrieveFiles(boolean)`

### setRetrieveFiles

    public void setRetrieveFiles(boolean retrieveFiles)

  Whether we should download the geonames file or use the one already present in the `geonamesDir`

  Parameters:
    `retrieveFiles` - The options

### getFilesToDownload

    public java.lang.String getFilesToDownload()

  Returns:
    The option
  See Also:
    `setFilesToDownload(String)`

### setFilesToDownload

    public void setFilesToDownload(java.lang.String filesToDownload)

  The list of the files to be downloaded from the `geonamesDownloadURL`. the several files will be separated by `OPTION_SEPARATOR`

  Parameters:
    `filesToDownload` - the filesToDownload to set

### getAdm1FileName

    public java.lang.String getAdm1FileName()

  Returns:
    the option
  See Also:
    `getAdm1FileName()`

### setAdm1FileName

    public void setAdm1FileName(java.lang.String adm1FileName)

  The name of the Geonames dump file containing the ADM with level 1

  Parameters:
    `adm1FileName` - The option

### getAdm2FileName

    public java.lang.String getAdm2FileName()

  Returns:
    The option
  See Also:
    `getAdm2FileName()`

### setAdm2FileName

    public void setAdm2FileName(java.lang.String adm2FileName)

  The name of the Geonames dump file containing the ADM with level 2

  Parameters:
    `adm2FileName` - The option

### getAdm3FileName

    public java.lang.String getAdm3FileName()

  Returns:
    The option
  See Also:
    `getAdm3FileName()`

### setAdm3FileName

    public void setAdm3FileName(java.lang.String adm3FileName)

  The name of the Geonames dump file containing the ADM with level 3

  Parameters:
    `adm3FileName` - the adm3FileName to set

### getAdm4FileName

    public java.lang.String getAdm4FileName()

  Returns:
    The option
  See Also:
    `getAdm4FileName()`

### setAdm4FileName

    public void setAdm4FileName(java.lang.String adm4FileName)

  The name of the Geonames dump file containing the ADM with level 4

  Parameters:
    `adm4FileName` - The option

### getCountriesFileName

    public java.lang.String getCountriesFileName()

  Returns:
    The Option
  See Also:
    `getCountriesFileName()`

### setCountriesFileName

    public void setCountriesFileName(java.lang.String countryFileName)

  The name of the Geonames dump file containing the countries informations

  Parameters:
    `countryFileName` - The option

### getLanguageFileName

    public java.lang.String getLanguageFileName()

  Returns:
    The option
  See Also:
    `setLanguageFileName(String)`

### setLanguageFileName

    public void setLanguageFileName(java.lang.String languageFileName)

  The name of the Geonames dump file containing the language informations

  Parameters:
    `languageFileName` - The option

### getAlternateNamesFileName

    public java.lang.String getAlternateNamesFileName()

  Returns:
    The option
  See Also:
    `getAlternateNamesFileName()`

### setAlternateNamesFileName

    public void setAlternateNamesFileName(java.lang.String alternateNamesFileName)

  The name of the Geonames dump file containing the alternate names

  Parameters:
    `alternateNamesFileName` - The option

### setMaxInsertsBeforeFlush

    public void setMaxInsertsBeforeFlush(int maxInsertsBeforeFlush)

  Optional setting that allows to specify the number of inserts that can be done before flushing. This is useful since most ORM technologies use a so-called Level-2 cache that will store all the persisted data until they are either comitted or flushed...default value is `DEFAULT_MAX_INSERT_BEFORE_FLUSH`

  Parameters:
    `maxInsertsBeforeFlush` - The option

### getMaxInsertsBeforeFlush

    public int getMaxInsertsBeforeFlush()

  Returns:
    The option
  See Also:
    `setMaxInsertsBeforeFlush(int)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009. All Rights Reserved.