Class GeolocationCache
- java.lang.Object
-
- com.djrapitops.plan.gathering.geolocation.GeolocationCache
-
-
Constructor Summary
Constructors Constructor Description GeolocationCache(Locale locale, PlanConfig config, GeoLite2Geolocator geoLite2Geolocator, net.playeranalytics.plugin.server.PluginLogger logger, net.playeranalytics.plugin.scheduling.RunnableFactory runnableFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canGeolocate()
void
clearCache()
Clears the cachevoid
disable()
Performs disable actions for the subsystemvoid
enable()
Performs enable actions for the subsystem.java.lang.String
getCountry(java.lang.String ipAddress)
Retrieves the country in full length (e.g.void
tryToPrepareGeoLite2()
-
-
-
Constructor Detail
-
GeolocationCache
@Inject public GeolocationCache(Locale locale, PlanConfig config, GeoLite2Geolocator geoLite2Geolocator, net.playeranalytics.plugin.server.PluginLogger logger, net.playeranalytics.plugin.scheduling.RunnableFactory runnableFactory)
-
-
Method Detail
-
enable
public void enable()
Description copied from interface:SubSystem
Performs enable actions for the subsystem.
-
canGeolocate
public boolean canGeolocate()
-
tryToPrepareGeoLite2
public void tryToPrepareGeoLite2()
-
getCountry
public java.lang.String getCountry(java.lang.String ipAddress)
Retrieves the country in full length (e.g. United States) from the IP Address.- Parameters:
ipAddress
- The IP Address for which the country is retrieved- Returns:
- The name of the country in full length or null if the country could not be fetched.
-
disable
public void disable()
Description copied from interface:SubSystem
Performs disable actions for the subsystem
-
clearCache
public void clearCache()
Clears the cache
-
-