Package gov.usgs.earthquake.geoserve
Class GeoserveRegionsService
java.lang.Object
gov.usgs.earthquake.geoserve.GeoserveRegionsService
Access regions from the Geoserve regions service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default connection timeoutstatic final String
Default URL for GeoServe Regions service.static final int
Default read timeout -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorGeoserveRegionsService
(int connectTimeout, int readTimeout) Constructor taking in timeouts and using default endpoint URLGeoserveRegionsService
(String endpointUrl) Constructor taking in endpointURLGeoserveRegionsService
(String endpointUrl, int connectTimeout, int readTimeout) Custom constructor -
Method Summary
Modifier and TypeMethodDescriptionint
javax.json.JsonObject
getFeRegion
(BigDecimal latitude, BigDecimal longitude) Find an event in the Region service via a latitude and longitudegetFeRegionName
(BigDecimal latitude, BigDecimal longitude) Get name of FeRegionint
void
setConnectTimeout
(int connectTimeout) void
setEndpointURL
(String endpointUrl) void
setReadTimeout
(int readTimeout)
-
Field Details
-
DEFAULT_ENDPOINT_URL
Default URL for GeoServe Regions service.- See Also:
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUTDefault connection timeout- See Also:
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUTDefault read timeout- See Also:
-
-
Constructor Details
-
GeoserveRegionsService
public GeoserveRegionsService()Default constructor -
GeoserveRegionsService
Constructor taking in endpointURL- Parameters:
endpointUrl
- for places service
-
GeoserveRegionsService
public GeoserveRegionsService(int connectTimeout, int readTimeout) Constructor taking in timeouts and using default endpoint URL- Parameters:
connectTimeout
- in msreadTimeout
- in ms
-
GeoserveRegionsService
Custom constructor- Parameters:
endpointUrl
- for Places serviceconnectTimeout
- in msreadTimeout
- in ms
-
-
Method Details
-
getConnectTimeout
public int getConnectTimeout()- Returns:
- connectTimemout
-
getEndpointURL
- Returns:
- endpointURL
-
getFeRegion
public javax.json.JsonObject getFeRegion(BigDecimal latitude, BigDecimal longitude) throws IOException, MalformedURLException Find an event in the Region service via a latitude and longitude- Parameters:
latitude
- of eventlongitude
- of event- Returns:
- JSONObject of Fe Region
- Throws:
IOException
- on IO errorMalformedURLException
- or URL error
-
getFeRegionName
public String getFeRegionName(BigDecimal latitude, BigDecimal longitude) throws IOException, MalformedURLException Get name of FeRegion- Parameters:
latitude
- of eventlongitude
- of event- Returns:
- string of FeRegion name
- Throws:
IOException
- on IO errorMalformedURLException
- or URL error
-
getReadTimeout
public int getReadTimeout()- Returns:
- readTimeout
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout) - Parameters:
connectTimeout
- int to set
-
setEndpointURL
- Parameters:
endpointUrl
- string to set
-
setReadTimeout
public void setReadTimeout(int readTimeout) - Parameters:
readTimeout
- int to set
-