Package gov.usgs.earthquake.geoserve
Class GeoserveRegionsService
- java.lang.Object
-
- gov.usgs.earthquake.geoserve.GeoserveRegionsService
-
public class GeoserveRegionsService extends java.lang.ObjectAccess regions from the Geoserve regions service.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_CONNECT_TIMEOUTDefault connection timeoutstatic java.lang.StringDEFAULT_ENDPOINT_URLDefault URL for GeoServe Regions service.static intDEFAULT_READ_TIMEOUTDefault read timeout
-
Constructor Summary
Constructors Constructor Description GeoserveRegionsService()Default constructorGeoserveRegionsService(int connectTimeout, int readTimeout)Constructor taking in timeouts and using default endpoint URLGeoserveRegionsService(java.lang.String endpointUrl)Constructor taking in endpointURLGeoserveRegionsService(java.lang.String endpointUrl, int connectTimeout, int readTimeout)Custom constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetConnectTimeout()java.lang.StringgetEndpointURL()javax.json.JsonObjectgetFeRegion(java.math.BigDecimal latitude, java.math.BigDecimal longitude)Find an event in the Region service via a latitude and longitudejava.lang.StringgetFeRegionName(java.math.BigDecimal latitude, java.math.BigDecimal longitude)Get name of FeRegionintgetReadTimeout()voidsetConnectTimeout(int connectTimeout)voidsetEndpointURL(java.lang.String endpointUrl)voidsetReadTimeout(int readTimeout)
-
-
-
Field Detail
-
DEFAULT_ENDPOINT_URL
public static final java.lang.String DEFAULT_ENDPOINT_URL
Default URL for GeoServe Regions service.- See Also:
- Constant Field Values
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT
Default connection timeout- See Also:
- Constant Field Values
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT
Default read timeout- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GeoserveRegionsService
public GeoserveRegionsService()
Default constructor
-
GeoserveRegionsService
public GeoserveRegionsService(java.lang.String endpointUrl)
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
public GeoserveRegionsService(java.lang.String endpointUrl, int connectTimeout, int readTimeout)Custom constructor- Parameters:
endpointUrl- for Places serviceconnectTimeout- in msreadTimeout- in ms
-
-
Method Detail
-
getConnectTimeout
public int getConnectTimeout()
- Returns:
- connectTimemout
-
getEndpointURL
public java.lang.String getEndpointURL()
- Returns:
- endpointURL
-
getFeRegion
public javax.json.JsonObject getFeRegion(java.math.BigDecimal latitude, java.math.BigDecimal longitude) throws java.io.IOException, java.net.MalformedURLExceptionFind an event in the Region service via a latitude and longitude- Parameters:
latitude- of eventlongitude- of event- Returns:
- JSONObject of Fe Region
- Throws:
java.io.IOException- on IO errorjava.net.MalformedURLException- or URL error
-
getFeRegionName
public java.lang.String getFeRegionName(java.math.BigDecimal latitude, java.math.BigDecimal longitude) throws java.io.IOException, java.net.MalformedURLExceptionGet name of FeRegion- Parameters:
latitude- of eventlongitude- of event- Returns:
- string of FeRegion name
- Throws:
java.io.IOException- on IO errorjava.net.MalformedURLException- or URL error
-
getReadTimeout
public int getReadTimeout()
- Returns:
- readTimeout
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
- Parameters:
connectTimeout- int to set
-
setEndpointURL
public void setEndpointURL(java.lang.String endpointUrl)
- Parameters:
endpointUrl- string to set
-
setReadTimeout
public void setReadTimeout(int readTimeout)
- Parameters:
readTimeout- int to set
-
-