Package edu.sc.seis.seisFile.fdsnws
Class AbstractFDSNQuerier
java.lang.Object
edu.sc.seis.seisFile.fdsnws.AbstractFDSNQuerier
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
FDSNDataSelectQuerier
,FDSNEventCatalogQuerier
,FDSNEventQuerier
,FDSNStationQuerier
,IRISWSVirtualNetworkQuerier
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
void
connect()
static String
extractErrorMessage
(org.apache.http.HttpResponse response) static Throwable
abstract URI
formURI()
returns the URI that was used to open the connection.int
org.apache.http.HttpResponse
int
int
int
abstract URL
boolean
boolean
isEmpty()
boolean
isError()
boolean
void
outputRaw
(InputStream in, OutputStream out) void
outputRaw
(OutputStream out) protected void
processConnection
(org.apache.http.client.methods.CloseableHttpResponse response) void
setAcceptHeader
(String acceptHeader) set the Accept: html header, default is application/xml.void
setConnectTimeout
(int milliseconds) set the HttpConnection connectionTimeout in milliseconds.void
setProxyHost
(String proxyHost) void
setProxyPort
(int proxyPort) void
setProxyProtocol
(String proxyProtocol) void
setReadTimeout
(int milliseconds) set the HttpConnection readTimeout in milliseconds.void
setUserAgent
(String userAgent) void
setValidate
(boolean validate) static void
validate
(XMLStreamReader reader, URL schemaURL)
-
Field Details
-
DEFAULT_USER_AGENT
-
proxyHost
-
proxyPort
protected int proxyPort -
proxyProtocol
-
connectionUri
-
connectTimeout
protected int connectTimeout -
readTimeout
protected int readTimeout -
validate
protected boolean validate -
DEFAULT_CONNECT_TIMEOUT
public static int DEFAULT_CONNECT_TIMEOUT -
DEFAULT_READ_TIMEOUT
public static int DEFAULT_READ_TIMEOUT
-
-
Constructor Details
-
AbstractFDSNQuerier
public AbstractFDSNQuerier()
-
-
Method Details
-
formURI
- Throws:
URISyntaxException
-
getSchemaURL
-
connect
- Throws:
URISyntaxException
FDSNWSException
-
processConnection
protected void processConnection(org.apache.http.client.methods.CloseableHttpResponse response) throws IOException, FDSNWSException - Throws:
IOException
FDSNWSException
-
validate
- Throws:
SAXException
IOException
-
outputRaw
public void outputRaw(OutputStream out) throws MalformedURLException, IOException, URISyntaxException, FDSNWSException -
outputRaw
- Throws:
IOException
-
getRawXML
- Throws:
IOException
-
isError
public boolean isError() -
getErrorMessage
-
isEmpty
public boolean isEmpty() -
getInputStream
-
getConnectionUri
returns the URI that was used to open the connection. This may be null if connect() has not yet been called. formUri() can be used to get the URI without connecting.- Returns:
-
isConnectionInitiated
public boolean isConnectionInitiated() -
checkConnectionInitiated
public void checkConnectionInitiated() -
getReader
- Throws:
XMLStreamException
URISyntaxException
-
extractErrorMessage
-
getAcceptHeader
-
setAcceptHeader
set the Accept: html header, default is application/xml. -
setUserAgent
-
getUserAgent
-
setProxyHost
-
getProxyHost
-
setProxyPort
public void setProxyPort(int proxyPort) -
getProxyPort
public int getProxyPort() -
setProxyProtocol
-
getProxyProtocol
-
getResponseCode
public int getResponseCode() -
getHttpResponse
public org.apache.http.HttpResponse getHttpResponse() -
setConnectTimeout
public void setConnectTimeout(int milliseconds) set the HttpConnection connectionTimeout in milliseconds. -
setReadTimeout
public void setReadTimeout(int milliseconds) set the HttpConnection readTimeout in milliseconds. -
getConnectTimeout
public int getConnectTimeout() -
getReadTimeout
public int getReadTimeout() -
extractRootCause
-
isValidate
public boolean isValidate() -
setValidate
public void setValidate(boolean validate) -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-