Package 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 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 Description GMapGeoLocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
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
-
-
Method Detail
-
configure
public void configure(Properties properties)
- Specified by:
configure
in interfaceGeoLocator
-
locate
public Coordinate locate(String zip, String city, String street)
- Specified by:
locate
in interfaceGeoLocator
-
locate
public Coordinate locate(String zip, String city, String street, String country)
- Specified by:
locate
in interfaceGeoLocator
-
append
protected boolean append(StringBuilder query, String street, boolean addSpace)
-
getJsonResponse
protected com.fasterxml.jackson.databind.JsonNode getJsonResponse(URL url) throws IOException, InterruptedException, GeneralSecurityException
-
buildUrl
protected URL buildUrl(String requestUrl) throws MalformedURLException, GeneralSecurityException, IOException
-
-