Class Geolocation

java.lang.Object
com.logicaldoc.core.security.Geolocation

public class Geolocation extends Object
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 Details Link icon

    • get Link icon

      public static Geolocation get()
      Retrieve the singleton instance of the Geolocation
      Returns:
      the Geolocation singleton instance
    • get Link icon

      public static Geolocation get(String ip) throws IOException
      Instantiates 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
    • isEnabled Link icon

      public boolean isEnabled()
    • getDatabaseVersion Link icon

      public String getDatabaseVersion()
      Retrieves the version of the Geolocation database
      Returns:
      The version
    • syncDB Link icon

      public void syncDB(String key) throws IOException
      Downloads and installs the latest database
      Parameters:
      key - the API key
      Throws:
      IOException - in case of whatever problem
    • getCountry Link icon

      public String getCountry()
    • getCity Link icon

      public String getCity()
    • getPostal Link icon

      public String getPostal()
    • getState Link icon

      public String getState()
    • getCountryCode Link icon

      public String getCountryCode()
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • dispose Link icon

      public void dispose()