com.isti.quakewatch.message
Class QWIdentDataMsgRecord

java.lang.Object
  extended by com.isti.quakewatch.message.QWRecord
      extended by com.isti.quakewatch.message.QWMsgRecord
          extended by com.isti.quakewatch.message.QWDataMsgRecord
              extended by com.isti.quakewatch.message.QWIdentDataMsgRecord
All Implemented Interfaces:
QWMsgNumTimeRec, Archivable
Direct Known Subclasses:
QWDelEventMsgRecord, QWDelProductMsgRecord, QWEQEventMsgRecord, QWProductMsgRecord, QWTrumpMsgRecord

public abstract class QWIdentDataMsgRecord
extends QWDataMsgRecord

QWIdentDataMsgRecord defines a base-record of functionality for records that use an "Identifier" element (or an ANSS-EQ-XML-format "Event" element)..


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.isti.util.Archivable
Archivable.Marker
 
Field Summary
 java.lang.String dataSource
          Data source code string for event.
 java.lang.String eventID
          Identification string for event (not including data source code).
 java.lang.String eventIDKey
          Identification key string for event (includes data source code).
protected  java.lang.String lcEventIDKeyStr
          Handle/indicator for lower-cased version of event-ID string.
 int messageFormatSpec
          Specifier for message-format type (one of 'MFMT_...' values).
static int MFMT_ANSSEQXML
          Specifier index for ANSS-EQ-XML format for 'messageFormatSpec'.
static int MFMT_QUAKEML
          Specifier index for QuakeML format for 'messageFormatSpec'.
static int MFMT_QWMESSAGE
          Specifier index for "QWmessage" format for 'messageFormatSpec'.
 java.lang.String version
          Version code string for event, or null if none given.
 
Fields inherited from class com.isti.quakewatch.message.QWDataMsgRecord
action, alarmTriggeredFlag, dataMsgElement, displayObject, locationNote, relayTimeGen, requestedFlag, showMapSymbolFlag, timeReceived, updateFlag, utilityObject
 
Fields inherited from class com.isti.quakewatch.message.QWMsgRecord
archiveFormStr, msgNumber, origTimeGenerated, qwMsgElement, timeGenerated
 
Fields inherited from class com.isti.quakewatch.message.QWRecord
currentElement
 
Constructor Summary
QWIdentDataMsgRecord(org.jdom.Element qwMsgElement, org.jdom.Element dataMsgElement, org.jdom.Element eventElement)
          Creates a data record that uses a QuakeWatch message format "Identifier" element and loads attributes from the element.
QWIdentDataMsgRecord(org.jdom.Element qwMsgElement, org.jdom.Element dataMsgElement, org.jdom.Element eventElement, boolean anssEQMsgFormatFlag)
          Deprecated. Use version with 'messageFormatSpec' parameter.
QWIdentDataMsgRecord(org.jdom.Element qwMsgElement, org.jdom.Element dataMsgElement, org.jdom.Element eventElement, boolean anssEQMsgFormatFlag, java.lang.String versionStr)
          Deprecated. Use version with 'messageFormatSpec' parameter.
QWIdentDataMsgRecord(org.jdom.Element qwMsgElement, org.jdom.Element dataMsgElement, org.jdom.Element eventElement, int messageFormatSpec)
          Creates a data record that contains event-identification information, loading data from the given elements.
QWIdentDataMsgRecord(org.jdom.Element qwMsgElement, org.jdom.Element dataMsgElement, org.jdom.Element eventElement, int messageFormatSpec, java.lang.String versionStr)
          Creates a data record that contains event-identification information, loading data from the given elements.
QWIdentDataMsgRecord(org.jdom.Element qwMsgElement, org.jdom.Element dataMsgElement, org.jdom.Element eventElement, long msgNumber, java.util.Date timeGenerated, java.lang.String action, java.util.Date timeReceived, java.lang.String eventIDKey, java.lang.String dataSource, java.lang.String version)
          Creates a data record that uses an "Identifier" element and loads attributes from the element.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 boolean equals(QWIdentDataMsgRecord obj)
          Indicates whether some other object is "equal to" this one.
 java.lang.String getDataSource()
          Returns the event data-source code.
 java.lang.String getEventID()
          Returns the event ID code.
 java.lang.String getEventIDKey()
          Returns the event ID key (usually including a leading data-source code).
 java.lang.String getLCEventIDKey()
          Returns a lower-cased version of the event ID key (usually including a leading data-source code).
 java.lang.String getVersion()
          Returns the version code string for the event.
static boolean isShakeMapProduct(java.lang.String typeStr, java.lang.String codeStr, java.lang.String linkStr)
          Determines if the given attributes indicate a ShakeMap product.
 
Methods inherited from class com.isti.quakewatch.message.QWDataMsgRecord
equals, getAlarmTriggeredFlag, getDisplayObject, getIdentifierElement, getLocationNote, getRequestedFlag, getShowMapSymbolFlag, getUpdateFlag, getUtilityObject, setAlarmTriggeredFlag, setDisplayObject, setLocationNote, setRequestedFlag, setShowMapSymbolFlag, setUpdateFlag, setUtilityObject
 
Methods inherited from class com.isti.quakewatch.message.QWMsgRecord
checkQWMsgRecordName, elemToStr, equals, getArchiveDate, getMsgNum, getServerAddress, getServerIDName, getServerRevStr, getTimeGenerated, toArchivedForm
 
Methods inherited from class com.isti.quakewatch.message.QWRecord
getAttribDouble, getAttribInteger, getAttribLong, getAttribStr, getAttribTime, getChildElementDouble, getChildElementDouble, getChildElementInteger, getChildElementInteger, getChildElementStr, getChildElementStr, getCurrentElement, getDefAttribBoolean, getDefElementBoolean, getElementDouble, getElementInteger, getElementLong, getElementStr, getElementTime, getElementValueDouble, getElementValueStr, getElementValueTime, getNonNullOptAttribStr, getNonNullOptElementStr, getOptAttribBoolean, getOptAttribDouble, getOptAttribInteger, getOptAttribStr, getOptAttribTime, getOptElementBoolean, getOptElementDouble, getOptElementInteger, getOptElementStr, getOptElementTime, getOptElementValueDouble, getOptTextDouble, parseDataBoolean, parseDataDouble, parseDataInteger, parseDataLong, parseDataTime
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eventIDKey

public final java.lang.String eventIDKey
Identification key string for event (includes data source code).


eventID

public final java.lang.String eventID
Identification string for event (not including data source code).


dataSource

public final java.lang.String dataSource
Data source code string for event.


version

public final java.lang.String version
Version code string for event, or null if none given.


lcEventIDKeyStr

protected final java.lang.String lcEventIDKeyStr
Handle/indicator for lower-cased version of event-ID string.


messageFormatSpec

public final int messageFormatSpec
Specifier for message-format type (one of 'MFMT_...' values).


MFMT_QWMESSAGE

public static final int MFMT_QWMESSAGE
Specifier index for "QWmessage" format for 'messageFormatSpec'.

See Also:
Constant Field Values

MFMT_ANSSEQXML

public static final int MFMT_ANSSEQXML
Specifier index for ANSS-EQ-XML format for 'messageFormatSpec'.

See Also:
Constant Field Values

MFMT_QUAKEML

public static final int MFMT_QUAKEML
Specifier index for QuakeML format for 'messageFormatSpec'.

See Also:
Constant Field Values
Constructor Detail

QWIdentDataMsgRecord

public QWIdentDataMsgRecord(org.jdom.Element qwMsgElement,
                            org.jdom.Element dataMsgElement,
                            org.jdom.Element eventElement,
                            int messageFormatSpec,
                            java.lang.String versionStr)
                     throws QWRecordException
Creates a data record that contains event-identification information, loading data from the given elements.

Parameters:
qwMsgElement - the XML "QWmessage" element object.
dataMsgElement - the XML "DataMessage" element object.
eventElement - the XML "Event" element object or the XML element that contains the "Identifier" element.
messageFormatSpec - specifier for message-format type (one of the 'MFMT_...' values).
versionStr - the version string to be used, or null to retrieve version string from the 'eventElement' object.
Throws:
QWRecordException - if an error occurs while creating the data record.

QWIdentDataMsgRecord

public QWIdentDataMsgRecord(org.jdom.Element qwMsgElement,
                            org.jdom.Element dataMsgElement,
                            org.jdom.Element eventElement,
                            int messageFormatSpec)
                     throws QWRecordException
Creates a data record that contains event-identification information, loading data from the given elements.

Parameters:
qwMsgElement - the XML "QWmessage" element object.
dataMsgElement - the XML "DataMessage" element object.
eventElement - the XML "Event" element object or the XML element that contains the "Identifier" element.
messageFormatSpec - specifier for message-format type (one of the 'MFMT_...' values).
Throws:
QWRecordException - if an error occurs while creating the data record.

QWIdentDataMsgRecord

public QWIdentDataMsgRecord(org.jdom.Element qwMsgElement,
                            org.jdom.Element dataMsgElement,
                            org.jdom.Element eventElement,
                            boolean anssEQMsgFormatFlag,
                            java.lang.String versionStr)
                     throws QWRecordException
Deprecated. Use version with 'messageFormatSpec' parameter.

Creates a data record that contains event-identification information, loading data from the given elements.

Parameters:
qwMsgElement - the XML "QWmessage" element object.
dataMsgElement - the XML "DataMessage" element object.
eventElement - the XML "Event" element object or the XML element that contains the "Identifier" element.
anssEQMsgFormatFlag - true for ANSS-EQ-XML message format; false for QuakeWatch message format.
versionStr - the version string to be used, or null to retrieve version string from the 'eventElement' object.
Throws:
QWRecordException - if an error occurs while creating the data record.

QWIdentDataMsgRecord

public QWIdentDataMsgRecord(org.jdom.Element qwMsgElement,
                            org.jdom.Element dataMsgElement,
                            org.jdom.Element eventElement,
                            boolean anssEQMsgFormatFlag)
                     throws QWRecordException
Deprecated. Use version with 'messageFormatSpec' parameter.

Creates a data record that contains event-identification information, loading data from the given elements.

Parameters:
qwMsgElement - the XML "QWmessage" element object.
dataMsgElement - the XML "DataMessage" element object.
eventElement - the XML "Event" element object or the XML element that contains the "Identifier" element.
anssEQMsgFormatFlag - true for ANSS-EQ-XML message format; false for QuakeWatch message format.
Throws:
QWRecordException - if an error occurs while creating the data record.

QWIdentDataMsgRecord

public QWIdentDataMsgRecord(org.jdom.Element qwMsgElement,
                            org.jdom.Element dataMsgElement,
                            org.jdom.Element eventElement)
                     throws QWRecordException
Creates a data record that uses a QuakeWatch message format "Identifier" element and loads attributes from the element.

Parameters:
qwMsgElement - the XML "QWmessage" element object.
dataMsgElement - the XML "DataMessage" element object.
eventElement - the XML "Event" element object or the XML element that contains the "Identifier" element.
Throws:
QWRecordException - if an error occurs while creating the data record.

QWIdentDataMsgRecord

public QWIdentDataMsgRecord(org.jdom.Element qwMsgElement,
                            org.jdom.Element dataMsgElement,
                            org.jdom.Element eventElement,
                            long msgNumber,
                            java.util.Date timeGenerated,
                            java.lang.String action,
                            java.util.Date timeReceived,
                            java.lang.String eventIDKey,
                            java.lang.String dataSource,
                            java.lang.String version)
                     throws QWRecordException
Creates a data record that uses an "Identifier" element and loads attributes from the element.

Parameters:
qwMsgElement - the XML "QWmessage" element object.
dataMsgElement - the XML "DataMessage" element object.
eventElement - the XML element that contains the "Identifier" element.
msgNumber - message number from the 'QWmessage' element for this message.
timeGenerated - time that message was created by server (or null if not given).
action - "Action" string for message ("Update", "Delete").
timeReceived - time that message was received at server (or null if not given).
eventIDKey - identification key string for event.
dataSource - data source code string for event.
version - version code string for event, or null if none given.
Throws:
QWRecordException - if an error occurs while creating the data record.
Method Detail

equals

public boolean equals(QWIdentDataMsgRecord obj)
Indicates whether some other object is "equal to" this one.

Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class QWDataMsgRecord
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

getEventID

public java.lang.String getEventID()
Returns the event ID code. This is the same as the event-ID key except that any leading data-source code is removed.

Returns:
The event ID code.

getEventIDKey

public java.lang.String getEventIDKey()
Returns the event ID key (usually including a leading data-source code).

Returns:
The event ID key.

getLCEventIDKey

public java.lang.String getLCEventIDKey()
Returns a lower-cased version of the event ID key (usually including a leading data-source code).

Returns:
The lower-cased event ID key.

getDataSource

public java.lang.String getDataSource()
Returns the event data-source code.

Returns:
The event data-source code.

getVersion

public java.lang.String getVersion()
Returns the version code string for the event.

Returns:
The version code string for the event, or null if none given.

isShakeMapProduct

public static boolean isShakeMapProduct(java.lang.String typeStr,
                                        java.lang.String codeStr,
                                        java.lang.String linkStr)
Determines if the given attributes indicate a ShakeMap product.

Parameters:
typeStr - product-type value.
codeStr - product-code value.
linkStr - URL-link string for product, or null for none.
Returns:
true if the given attributes indicate a ShakeMap product; false if not.