Permalink
Browse files

Updated QuakemlToCubeConverter to read creationTime from eventParameters

  • Loading branch information...
1 parent ec51293 commit b13f35e77f9c4347f0f184180ed2a1f9c3739f94 @jmfee-usgs jmfee-usgs committed Mar 5, 2013
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/gov/usgs/earthquake/event/QuakemlToCubeConverter.java
@@ -52,9 +52,9 @@ public CubeMessage convertQuakeml(final Quakeml message) throws Exception {
Event event = events.get(0);
EventType eventType = event.getType();
if (eventType == EventType.NOT_EXISTING) {
- return convertQuakemlDeleteMessage(message, event);
+ return convertQuakemlDeleteMessage(message, event, eventParameters);
} else {
- return convertQuakemlEventMessage(message, event);
+ return convertQuakemlEventMessage(message, event, eventParameters);
}
}
@@ -68,7 +68,7 @@ public CubeMessage convertQuakeml(final Quakeml message) throws Exception {
* @return CubeDelete representation of Quakeml event.
* @throws Exception
*/
- public CubeDelete convertQuakemlDeleteMessage(Quakeml message, Event event)
+ public CubeDelete convertQuakemlDeleteMessage(Quakeml message, Event event, EventParameters eventParameters)
throws Exception {
if (event.getType() != EventType.NOT_EXISTING) {
// not a delete message
@@ -88,6 +88,8 @@ public CubeDelete convertQuakemlDeleteMessage(Quakeml message, Event event)
// read version and sent timestamp from event creation info
CreationInfo creationInfo = event.getCreationInfo();
cubeDelete.setVersion(creationInfo.getVersion());
+
+ creationInfo = eventParameters.getCreationInfo();
cubeDelete.setSent(creationInfo.getCreationTime());
try {
@@ -110,7 +112,7 @@ public CubeDelete convertQuakemlDeleteMessage(Quakeml message, Event event)
* @return CubeEvent representation of Quakeml event.
* @throws Exception
*/
- public CubeEvent convertQuakemlEventMessage(Quakeml message, Event event)
+ public CubeEvent convertQuakemlEventMessage(Quakeml message, Event event, EventParameters eventParameters)
throws Exception {
if (event.getType() == EventType.NOT_EXISTING) {
// not a event
@@ -130,6 +132,8 @@ public CubeEvent convertQuakemlEventMessage(Quakeml message, Event event)
// read version and sent timestamp from event creation info
CreationInfo creationInfo = event.getCreationInfo();
cubeEvent.setVersion(creationInfo.getVersion());
+
+ creationInfo = eventParameters.getCreationInfo();
cubeEvent.setSent(creationInfo.getCreationTime());
String preferredOriginID = event.getPreferredOriginID();

0 comments on commit b13f35e

Please sign in to comment.