@Singleton @Configurable public class StatisticsLocationUtil extends Object implements IStatisticsLocationUtil, IAdminStatisticsLocation, Constructable, Destroyable
IAdminStatisticsLocation.LocationDatabaseType| Constructor and Description |
|---|
StatisticsLocationUtil() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
String |
getCityDbLoc() |
String |
getCountryDbLoc() |
IAdminStatisticsLocation.LocationDatabaseType |
getDbType() |
String |
getDownloadFolderPath() |
void |
init() |
void |
initDatabase(IAdminStatisticsLocation.LocationDatabaseType type,
String pathToDatabase)
Initialize the memory database.
|
Map<String,Object> |
ip2SpatialData(IPAddress ip) |
Map<String,Object> |
ip2SpatialData(String host) |
boolean |
isAutoDownload() |
boolean |
isEnabled() |
IPAddress |
resolveOriginalIpAddress(RequestContext ctx)
Resolves source
IPAddress if there were a proxy get the original
address |
void |
setAutoDownload(String choice) |
void |
setCityDbLoc(String cityDbLoc) |
void |
setCountryDbLoc(String countryDbLoc) |
void |
setDbType(String dbType) |
void |
setDownloadFolderPath(String downloadFolderPath) |
void |
setEnabled(boolean enabled) |
public Map<String,Object> ip2SpatialData(IPAddress ip)
ip2SpatialData in interface IStatisticsLocationUtilpublic Map<String,Object> ip2SpatialData(String host)
ip2SpatialData in interface IStatisticsLocationUtilhost - String of the IPv4 address e.g.: 123.123.123.123public IPAddress resolveOriginalIpAddress(RequestContext ctx)
IPAddress if there were a proxy get the original
addressresolveOriginalIpAddress in interface IStatisticsLocationUtilctx - holder of the addresspublic void initDatabase(IAdminStatisticsLocation.LocationDatabaseType type, String pathToDatabase)
IAdminStatisticsLocationLocationDatabaseType MUST match.initDatabase in interface IAdminStatisticsLocationtype - type of the loaded database from file.pathToDatabase - can be classpath:[path] or
[absolute path] string to the appropriate file.public void destroy()
destroy in interface Destroyablepublic boolean isEnabled()
public boolean isAutoDownload()
@Setting(value="statistics.geoloc.db_downloader") public void setAutoDownload(String choice)
public String getDownloadFolderPath()
@Setting(value="statistics.geoloc.download_folder") public void setDownloadFolderPath(String downloadFolderPath)
public String getCityDbLoc()
@Setting(value="statistics.geoloc.city_location") public void setCityDbLoc(String cityDbLoc)
public String getCountryDbLoc()
@Setting(value="statistics.geoloc.country_location") public void setCountryDbLoc(String countryDbLoc)
public IAdminStatisticsLocation.LocationDatabaseType getDbType()
public void init()
init in interface ConstructableCopyright © 2015 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.