Package com.logicaldoc.core.security
Class Geolocation
java.lang.Object
com.logicaldoc.core.security.Geolocation
A class to concentrate the Geolocation operations and at the same time a
 factory to create beans that carry the geolocation of an IP address.
- Since:
- 8.5.3
- Author:
- Marco Meschieri - LogicalDOC
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()static Geolocationget()Retrieve the singleton instance of the Geolocationstatic GeolocationInstantiates a new Geolocation for a given IPgetCity()Retrieves the version of the Geolocation databasegetState()booleanvoidDownloads and installs the latest databasetoString()
- 
Method Details- 
getRetrieve the singleton instance of the Geolocation- Returns:
- the Geolocation singleton instance
 
- 
getInstantiates a new Geolocation for a given IP- Parameters:
- ip- the address to process
- Returns:
- the IP geolocalization
- Throws:
- IOException- if an error happens reading the database
 
- 
isEnabledpublic boolean isEnabled()
- 
getDatabaseVersionRetrieves the version of the Geolocation database- Returns:
- The version
 
- 
syncDBDownloads and installs the latest database- Parameters:
- key- the API key
- Throws:
- IOException- in case of whatever problem
 
- 
getCountry
- 
getCity
- 
getPostal
- 
getState
- 
getCountryCode
- 
toString
- 
disposepublic void dispose()
 
-