Class URLNotificationJSONConverter

java.lang.Object
gov.usgs.earthquake.distribution.URLNotificationJSONConverter

public class URLNotificationJSONConverter extends Object
Converts to and from JSON for URL notifications
  • Field Details

  • Constructor Details

    • URLNotificationJSONConverter

      public URLNotificationJSONConverter()
  • Method Details

    • toJSON

      public static String toJSON(URLNotification notification)
      Converts a URLNotification into a JSON string
      Parameters:
      notification - URLNotification to convert
      Returns:
      JSON string
    • parseJSON

      public static URLNotification parseJSON(InputStream message) throws Exception
      parse a message from the input stream
      Parameters:
      message - InputStream message
      Returns:
      URLNotification
      Throws:
      Exception - if error occurs
    • parseJSON

      public static URLNotification parseJSON(javax.json.JsonObject json) throws Exception
      Parse a JsonObject
      Parameters:
      json - JsonObject
      Returns:
      URLNotification
      Throws:
      Exception - if error occurs
    • main

      public static void main(String[] args) throws Exception
      Main function to run a test JSON-ifying a URLnotification
      Parameters:
      args - arguments
      Throws:
      Exception - if error occurs