Class SearchXML

java.lang.Object
gov.usgs.earthquake.indexer.SearchXML

public class SearchXML extends Object
Formatter for Search XML.
  • Field Details

  • Constructor Details

    • SearchXML

      public SearchXML()
  • Method Details

    • parseRequest

      public static SearchRequest parseRequest(InputStream in) throws Exception
      Parse an input stream with xml to a SearchRequest object.
      Parameters:
      in - the input stream containing xml.
      Returns:
      the parsed SearchRequest object.
      Throws:
      Exception - if error occurs
    • parseResponse

      public static SearchResponse parseResponse(InputStream in, FileProductStorage storage) throws Exception
      Parse an input stream with xml to a SearchResponse object.
      Parameters:
      in - the input stream containing xml.
      storage - the storage where received products are stored.
      Returns:
      the parsed SearchResponse object.
      Throws:
      Exception - if error occurs
    • toXML

      public static void toXML(SearchRequest request, OutputStream out) throws Exception
      Convert a SearchRequest object to xml.
      Parameters:
      request - the search request object to convert.
      out - the output stream where xml is written.
      Throws:
      Exception - if error occurs
    • toXML

      public static void toXML(SearchResponse response, OutputStream out) throws Exception
      Convert a SearchResponse object to xml.
      Parameters:
      response - the search response object to convert.
      out - the output stream where xml is written.
      Throws:
      Exception - if error occurs