Package gov.usgs.earthquake.distribution
Class URLNotificationJSONConverter
java.lang.Object
gov.usgs.earthquake.distribution.URLNotificationJSONConverter
Converts to and from JSON for URL notifications
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
attribute for codestatic final String
attribute for expiresstatic final String
attribute for product idstatic final String
attribute for sourcestatic final String
attribute for typestatic final String
attribute for updatetimestatic final String
attribute for url -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Main function to run a test JSON-ifying a URLnotificationstatic URLNotification
parseJSON
(InputStream message) parse a message from the input streamstatic URLNotification
parseJSON
(javax.json.JsonObject json) Parse a JsonObjectstatic String
toJSON
(URLNotification notification) Converts a URLNotification into a JSON string
-
Field Details
-
ATTRIBUTE_PRODUCT_ID
attribute for product id- See Also:
-
ATTRIBUTE_SOURCE
attribute for source- See Also:
-
ATTRIBUTE_TYPE
attribute for type- See Also:
-
ATTRIBUTE_CODE
attribute for code- See Also:
-
ATTRIBUTE_UPDATE_TIME
attribute for updatetime- See Also:
-
ATTRIBUTE_EXPIRES
attribute for expires- See Also:
-
ATTRIBUTE_URL
attribute for url- See Also:
-
-
Constructor Details
-
URLNotificationJSONConverter
public URLNotificationJSONConverter()
-
-
Method Details
-
toJSON
Converts a URLNotification into a JSON string- Parameters:
notification
- URLNotification to convert- Returns:
- JSON string
-
parseJSON
parse a message from the input stream- Parameters:
message
- InputStream message- Returns:
- URLNotification
- Throws:
Exception
- if error occurs
-
parseJSON
Parse a JsonObject- Parameters:
json
- JsonObject- Returns:
- URLNotification
- Throws:
Exception
- if error occurs
-
main
Main function to run a test JSON-ifying a URLnotification- Parameters:
args
- arguments- Throws:
Exception
- if error occurs
-