public class GeoLocatorService extends GenericService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
GeoLocatorService() |
Modifier and Type | Method and Description |
---|---|
java.util.Locale |
getDefaultLocale()
Returns property DefaultLocale.
|
Coordinate |
getGeoLocation(java.lang.String pPostalOrAddress)
Get a geolocation from the configured provider based on either a free form address input or a postal code.
|
Coordinate |
getGeoLocation(java.lang.String pPostalOrAddress,
java.util.Locale pLocale)
Get a geolocation based on either a free form address input or a postal code.
|
Coordinate |
getGeoLocation(java.lang.String pCity,
java.lang.String pArea)
Find a geolocation based on a city and a state or province.
|
Coordinate |
getGeoLocation(java.lang.String pCity,
java.lang.String pArea,
java.util.Locale pLocale)
Find a geolocation based on a city and a state or province.
|
GeoLocatorProvider |
getProvider()
Gets the provider
|
boolean |
isAllowCityAndState()
Whether or not the configured provider only supports postal code or free form address geo-location.
|
boolean |
isAllowFreeFormEntry()
Whether or not the configured provider uses an entry method that can take in
an address of arbitrary format (e.g '02139', 'Cambridge Ma', or '1 Main Street Cambridge Ma')
If this flag is false then getGeoLocation(String, String) is expected to be provided with only a
postal code input.
|
void |
setDefaultLocale(java.util.Locale pDefaultLocale)
Sets property DefaultLocale
|
void |
setProvider(GeoLocatorProvider pProvider)
Sets the provider
|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public void setProvider(GeoLocatorProvider pProvider)
pProvider
- A GeoLocatorProvider that will determine a coordinate based on an addresspublic GeoLocatorProvider getProvider()
public void setDefaultLocale(java.util.Locale pDefaultLocale)
public java.util.Locale getDefaultLocale()
public boolean isAllowFreeFormEntry()
public boolean isAllowCityAndState()
public Coordinate getGeoLocation(java.lang.String pPostalOrAddress)
pPostalOrAddress
- An address String if isFreeFormEntry is true, otherwise a postal/zip code.public Coordinate getGeoLocation(java.lang.String pCity, java.lang.String pArea)
pCity
- The city to find a coordinate for.pArea
- An input for the general area where the city is located. Typically a state, county, or province.pLocale
- The locale of the input. Can be used to determine country and language of input.public Coordinate getGeoLocation(java.lang.String pPostalOrAddress, java.util.Locale pLocale)
pPostalOrAddress
- An address String if isFreeFormEntry is true, otherwise a postal/zip code.pLocale
- The locale of the input. Can be used to determine country and language of input.public Coordinate getGeoLocation(java.lang.String pCity, java.lang.String pArea, java.util.Locale pLocale)
pCity
- The city to find a coordinate for.pArea
- An input for the general area where the city is located. Typically a state, county, or province.pLocale
- The locale of the input. Can be used to determine country and language of input.