Package gov.usgs.earthquake.distribution
Class URLNotificationJSONConverter
- java.lang.Object
-
- gov.usgs.earthquake.distribution.URLNotificationJSONConverter
-
public class URLNotificationJSONConverter extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTRIBUTE_CODE
attribute for codestatic java.lang.String
ATTRIBUTE_EXPIRES
attribute for expiresstatic java.lang.String
ATTRIBUTE_PRODUCT_ID
attribute for product idstatic java.lang.String
ATTRIBUTE_SOURCE
attribute for sourcestatic java.lang.String
ATTRIBUTE_TRACKER_URL
attribute for trackerURLstatic java.lang.String
ATTRIBUTE_TYPE
attribute for typestatic java.lang.String
ATTRIBUTE_UPDATE_TIME
attribute for updatetimestatic java.lang.String
ATTRIBUTE_URL
attribute for url
-
Constructor Summary
Constructors Constructor Description URLNotificationJSONConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
Main function to run a test JSON-ifying a URLnotificationstatic URLNotification
parseJSON(java.io.InputStream message)
parse a message from the input streamstatic URLNotification
parseJSON(javax.json.JsonObject json)
Parse a JsonObjectstatic java.lang.String
toJSON(URLNotification notification)
Converts a URLNotification into a JSON string
-
-
-
Field Detail
-
ATTRIBUTE_PRODUCT_ID
public static final java.lang.String ATTRIBUTE_PRODUCT_ID
attribute for product id- See Also:
- Constant Field Values
-
ATTRIBUTE_SOURCE
public static final java.lang.String ATTRIBUTE_SOURCE
attribute for source- See Also:
- Constant Field Values
-
ATTRIBUTE_TYPE
public static final java.lang.String ATTRIBUTE_TYPE
attribute for type- See Also:
- Constant Field Values
-
ATTRIBUTE_CODE
public static final java.lang.String ATTRIBUTE_CODE
attribute for code- See Also:
- Constant Field Values
-
ATTRIBUTE_UPDATE_TIME
public static final java.lang.String ATTRIBUTE_UPDATE_TIME
attribute for updatetime- See Also:
- Constant Field Values
-
ATTRIBUTE_TRACKER_URL
public static final java.lang.String ATTRIBUTE_TRACKER_URL
attribute for trackerURL- See Also:
- Constant Field Values
-
ATTRIBUTE_EXPIRES
public static final java.lang.String ATTRIBUTE_EXPIRES
attribute for expires- See Also:
- Constant Field Values
-
ATTRIBUTE_URL
public static final java.lang.String ATTRIBUTE_URL
attribute for url- See Also:
- Constant Field Values
-
-
Method Detail
-
toJSON
public static java.lang.String toJSON(URLNotification notification)
Converts a URLNotification into a JSON string- Parameters:
notification
- URLNotification to convert- Returns:
- JSON string
-
parseJSON
public static URLNotification parseJSON(java.io.InputStream message) throws java.lang.Exception
parse a message from the input stream- Parameters:
message
- InputStream message- Returns:
- URLNotification
- Throws:
java.lang.Exception
- if error occurs
-
parseJSON
public static URLNotification parseJSON(javax.json.JsonObject json) throws java.lang.Exception
Parse a JsonObject- Parameters:
json
- JsonObject- Returns:
- URLNotification
- Throws:
java.lang.Exception
- if error occurs
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
Main function to run a test JSON-ifying a URLnotification- Parameters:
args
- arguments- Throws:
java.lang.Exception
- if error occurs
-
-