org.appng.tools.locator

## Class GMapGeoLocator

- java.lang.Object
- - org.appng.tools.locator.GMapGeoLocator

- All Implemented Interfaces:
    GeoLocator

      public class GMapGeoLocator
      extends Object
      implements GeoLocator

  Retrieves coordinates from Google Maps via its JSON API.
  Author:
    mueller.matthias

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `GOOGLE_CLIENT_ID`
    `static String` | `GOOGLE_SIGNING_KEY`
    `static String` | `GOOGLE_SUFFIX`
    `static String` | `GOOGLE_URI`
    `static String` | `SLEEP_TIME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GMapGeoLocator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `append(StringBuilder query, String street, boolean addSpace)`
    `protected URL` | `buildUrl(String requestUrl)`
    `void` | `configure(Properties properties)`
    `protected com.fasterxml.jackson.databind.JsonNode` | `getJsonResponse(URL url)`
    `Coordinate` | `locate(String zip, String city, String street)`
    `Coordinate` | `locate(String zip, String city, String street, String country)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### GOOGLE_URI

          public static final String GOOGLE_URI

      See Also:
        Constant Field Values

    - #### GOOGLE_SUFFIX

          public static final String GOOGLE_SUFFIX

      See Also:
        Constant Field Values

    - #### GOOGLE_CLIENT_ID

          public static final String GOOGLE_CLIENT_ID

      See Also:
        Constant Field Values

    - #### GOOGLE_SIGNING_KEY

          public static final String GOOGLE_SIGNING_KEY

      See Also:
        Constant Field Values

    - #### SLEEP_TIME

          public static final String SLEEP_TIME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GMapGeoLocator

          public GMapGeoLocator()

  - ### Method Detail

    - #### configure

          public void configure(Properties properties)

      Specified by:
        `configure` in interface `GeoLocator`

    - #### locate

          public Coordinate locate(String zip,
                                   String city,
                                   String street)

      Specified by:
        `locate` in interface `GeoLocator`

    - #### locate

          public Coordinate locate(String zip,
                                   String city,
                                   String street,
                                   String country)

      Specified by:
        `locate` in interface `GeoLocator`

    - #### append

          protected boolean append(StringBuilder query,
                                   String street,
                                   boolean addSpace)

    - #### getJsonResponse

          protected com.fasterxml.jackson.databind.JsonNode getJsonResponse(URL url)
                                                                     throws IOException,
                                                                            InterruptedException,
                                                                            GeneralSecurityException

      Throws:
        `IOException`
        `InterruptedException`
        `GeneralSecurityException`

    - #### buildUrl

          protected URL buildUrl(String requestUrl)
                          throws MalformedURLException,
                                 GeneralSecurityException,
                                 IOException

      Throws:
        `MalformedURLException`
        `GeneralSecurityException`
        `IOException`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.