Constructor and Description |
---|
GeolocationCache(Locale locale,
PlanFiles files,
PlanConfig config,
com.djrapitops.plugin.logging.console.PluginLogger logger) |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache
|
void |
disable()
Performs disable actions for the subsystem
|
void |
enable()
Performs enable actions for the subsystem.
|
java.lang.String |
getCountry(java.lang.String ipAddress)
Retrieves the country in full length (e.g.
|
@Inject public GeolocationCache(Locale locale, PlanFiles files, PlanConfig config, com.djrapitops.plugin.logging.console.PluginLogger logger)
public void enable() throws EnableException
SubSystem
enable
in interface SubSystem
EnableException
- If an error occurred during enable and it is fatal to the subsystem.public java.lang.String getCountry(java.lang.String ipAddress)
This method uses cached
, every first access is getting cached and then retrieved later.
ipAddress
- The IP Address from which the country is retrievedAn exception from that rule is when the country is unknown or the retrieval of the country failed in any way, if that happens, "Not Known" will be returned.
getUnCachedCountry(String)
public void disable()
SubSystem
public void clearCache()