Class AbstractFDSNQuerier

java.lang.Object
edu.sc.seis.seisFile.fdsnws.AbstractFDSNQuerier
All Implemented Interfaces:
java.lang.AutoCloseable
Direct Known Subclasses:
FDSNDataSelectQuerier, FDSNEventCatalogQuerier, FDSNEventQuerier, FDSNStationQuerier, IRISWSVirtualNetworkQuerier

public abstract class AbstractFDSNQuerier
extends java.lang.Object
implements java.lang.AutoCloseable
  • Field Details

    • DEFAULT_USER_AGENT

      public static final java.lang.String DEFAULT_USER_AGENT
    • proxyHost

      protected java.lang.String proxyHost
    • proxyPort

      protected int proxyPort
    • proxyProtocol

      protected java.lang.String proxyProtocol
    • connectionUri

      protected java.net.URI 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

      public abstract java.net.URI formURI() throws java.net.URISyntaxException
      Throws:
      java.net.URISyntaxException
    • getSchemaURL

      public abstract java.net.URL getSchemaURL()
    • connect

      public void connect() throws java.net.URISyntaxException, FDSNWSException
      Throws:
      java.net.URISyntaxException
      FDSNWSException
    • processConnection

      protected void processConnection​(org.apache.http.client.methods.CloseableHttpResponse response) throws java.io.IOException, FDSNWSException
      Throws:
      java.io.IOException
      FDSNWSException
    • validate

      public static void validate​(javax.xml.stream.XMLStreamReader reader, java.net.URL schemaURL) throws org.xml.sax.SAXException, java.io.IOException
      Throws:
      org.xml.sax.SAXException
      java.io.IOException
    • outputRaw

      public void outputRaw​(java.io.OutputStream out) throws java.net.MalformedURLException, java.io.IOException, java.net.URISyntaxException, FDSNWSException
      Throws:
      java.net.MalformedURLException
      java.io.IOException
      java.net.URISyntaxException
      FDSNWSException
    • outputRaw

      public void outputRaw​(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
      Throws:
      java.io.IOException
    • getRawXML

      public java.lang.String getRawXML() throws java.io.IOException
      Throws:
      java.io.IOException
    • isError

      public boolean isError()
    • getErrorMessage

      public java.lang.String getErrorMessage()
    • isEmpty

      public boolean isEmpty()
    • getInputStream

      public java.io.InputStream getInputStream()
    • getConnectionUri

      public java.net.URI 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

      public javax.xml.stream.XMLEventReader getReader() throws javax.xml.stream.XMLStreamException, java.net.URISyntaxException
      Throws:
      javax.xml.stream.XMLStreamException
      java.net.URISyntaxException
    • extractErrorMessage

      public static java.lang.String extractErrorMessage​(org.apache.http.HttpResponse response)
    • getAcceptHeader

      public java.lang.String getAcceptHeader()
    • setAcceptHeader

      public void setAcceptHeader​(java.lang.String acceptHeader)
      set the Accept: html header, default is application/xml.
    • setUserAgent

      public void setUserAgent​(java.lang.String userAgent)
    • getUserAgent

      public java.lang.String getUserAgent()
    • setProxyHost

      public void setProxyHost​(java.lang.String proxyHost)
    • getProxyHost

      public java.lang.String getProxyHost()
    • setProxyPort

      public void setProxyPort​(int proxyPort)
    • getProxyPort

      public int getProxyPort()
    • setProxyProtocol

      public void setProxyProtocol​(java.lang.String proxyProtocol)
    • getProxyProtocol

      public java.lang.String getProxyProtocol()
    • getResponseCode

      public int getResponseCode()
    • 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

      public static java.lang.Throwable extractRootCause​(java.lang.Throwable t)
    • isValidate

      public boolean isValidate()
    • setValidate

      public void setValidate​(boolean validate)
    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable