com.isti.quakewatch.message
Class QWDataMsgRecord

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

public class QWDataMsgRecord
extends QWMsgRecord

QWDataMsgRecord defines a record of data from a QuakeWatch XML DataMessage.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.isti.util.Archivable
Archivable.Marker
 
Field Summary
 java.lang.String action
          Action string for message ("Update", "Delete").
protected  boolean alarmTriggeredFlag
          Flag set true if an alarm has been triggered for this record.
 org.jdom.Element dataMsgElement
          Handle to the DataMessage 'Element' object used to construct this object.
protected  java.lang.Object displayObject
          Handle for a display object associated with this message record.
protected  java.lang.String locationNote
          Location note text for message.
 java.util.Date relayTimeGen
          Time generated received by QWRelay feeder (or null if not given).
protected  boolean requestedFlag
          Flag set true to indicate that record was "requested".
protected  boolean showMapSymbolFlag
          Flag set true if symbol for message should be shown on map.
 java.util.Date timeReceived
          Time that message was received at server (or null if not given).
protected  boolean updateFlag
          Flag set true if this is an update to an existing record.
protected  java.lang.Object utilityObject
          Handle for a utility object associated with this message record.
 
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
QWDataMsgRecord(org.jdom.Element qwMsgElement, org.jdom.Element dataMsgElement)
          Creates a record of data from a QuakeWatch XML DataMessage.
QWDataMsgRecord(org.jdom.Element qwMsgElement, org.jdom.Element dataMsgElement, long msgNumber, java.util.Date timeGenerated, java.lang.String action, java.util.Date timeReceived)
          Creates a record of data from existing data items.
QWDataMsgRecord(java.lang.String dataStr, Archivable.Marker mkrObj)
          ***Not implemented.*** Creates a record of data from the archived-string data for an XML QWmessage.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 boolean equals(QWDataMsgRecord obj)
          Indicates whether some other object is "equal to" this one.
 boolean getAlarmTriggeredFlag()
          Returns the 'alarmTriggered' flag to indicate whether or not an alarm has been triggered for this record.
 java.lang.Object getDisplayObject()
          Returns the display object associated with this message record.
protected  org.jdom.Element getIdentifierElement(org.jdom.Element searchElement, java.lang.String searchElemNameStr)
          Fetches the "Identifier" element under the given search element.
 java.lang.String getLocationNote()
          Returns the "Location Note" value for this message record.
 boolean getRequestedFlag()
          Returns the "requested" flag.
 boolean getShowMapSymbolFlag()
          Returns the 'showMapSymbolFlag' flag to indicate whether or not the symbol for this message should be shown on the map.
 boolean getUpdateFlag()
          Returns true if this record is an update to a previously existing message record, false if it is a new message record.
 java.lang.Object getUtilityObject()
          Returns the utility object associated with this event record.
 void setAlarmTriggeredFlag(boolean flgVal)
          Sets the 'alarmTriggered' flag to indicate whether or not an alarm has been triggered for this record.
 void setDisplayObject(java.lang.Object obj)
          Sets the display object associated with this message record.
 void setLocationNote(java.lang.String str)
          Sets the "Location Note" value for this message record.
 void setRequestedFlag(boolean flgVal)
          Sets the "requested" flag.
 void setShowMapSymbolFlag(boolean flgVal)
          Sets the 'showMapSymbolFlag' flag to indicate whether or not the symbol for this message should be shown on the map.
 void setUpdateFlag(boolean flgVal)
          Sets the 'update' flag to indicate whether or not this record is an update to a previously existing message record.
 void setUtilityObject(java.lang.Object obj)
          Sets the utility object associated with this event record.
 
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

dataMsgElement

public final org.jdom.Element dataMsgElement
Handle to the DataMessage 'Element' object used to construct this object.


action

public final java.lang.String action
Action string for message ("Update", "Delete").


timeReceived

public final java.util.Date timeReceived
Time that message was received at server (or null if not given).


relayTimeGen

public final java.util.Date relayTimeGen
Time generated received by QWRelay feeder (or null if not given).


requestedFlag

protected boolean requestedFlag
Flag set true to indicate that record was "requested".


updateFlag

protected boolean updateFlag
Flag set true if this is an update to an existing record.


alarmTriggeredFlag

protected boolean alarmTriggeredFlag
Flag set true if an alarm has been triggered for this record.


showMapSymbolFlag

protected boolean showMapSymbolFlag
Flag set true if symbol for message should be shown on map.


locationNote

protected java.lang.String locationNote
Location note text for message.


displayObject

protected java.lang.Object displayObject
Handle for a display object associated with this message record.


utilityObject

protected java.lang.Object utilityObject
Handle for a utility object associated with this message record.

Constructor Detail

QWDataMsgRecord

public QWDataMsgRecord(org.jdom.Element qwMsgElement,
                       org.jdom.Element dataMsgElement)
                throws QWRecordException
Creates a record of data from a QuakeWatch XML DataMessage.

Parameters:
qwMsgElement - the XML "QWmessage" element object.
dataMsgElement - the XML "DataMessage" element object.
Throws:
QWRecordException - if an error occurs while creating the data record.

QWDataMsgRecord

public QWDataMsgRecord(java.lang.String dataStr,
                       Archivable.Marker mkrObj)
                throws QWRecordException
***Not implemented.*** Creates a record of data from the archived-string data for an XML QWmessage. This constructor is needed to have this class implement the 'Archivable' interface.

Parameters:
dataStr - the archived-string data to use.
mkrObj - Archivable.Marker parameter to indicate that this constructor is used to dearchive a record.
Throws:
QWRecordException - if an error occurs while creating the data record.

QWDataMsgRecord

public QWDataMsgRecord(org.jdom.Element qwMsgElement,
                       org.jdom.Element dataMsgElement,
                       long msgNumber,
                       java.util.Date timeGenerated,
                       java.lang.String action,
                       java.util.Date timeReceived)
                throws QWRecordException
Creates a record of data from existing data items.

Parameters:
qwMsgElement - the XML "QWmessage" element object.
dataMsgElement - the XML "DataMessage" element object.
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).
Throws:
QWRecordException - if an error occurs while creating the data record.
Method Detail

equals

public boolean equals(QWDataMsgRecord 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 QWMsgRecord
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

getIdentifierElement

protected org.jdom.Element getIdentifierElement(org.jdom.Element searchElement,
                                                java.lang.String searchElemNameStr)
                                         throws QWRecordException
Fetches the "Identifier" element under the given search element.

Parameters:
searchElement - the element to search.
searchElemNameStr - the display name of the search element (for error messages).
Returns:
The "Identifier" element object.
Throws:
QWRecordException - if something other than a single "Identifier" element if found.

setRequestedFlag

public void setRequestedFlag(boolean flgVal)
Sets the "requested" flag.

Parameters:
flgVal - the flag value to set.

getRequestedFlag

public boolean getRequestedFlag()
Returns the "requested" flag.

Returns:
the value of the flag.

setUpdateFlag

public void setUpdateFlag(boolean flgVal)
Sets the 'update' flag to indicate whether or not this record is an update to a previously existing message record.

Parameters:
flgVal - true if this record is an update, false if it is a new message record.

getUpdateFlag

public boolean getUpdateFlag()
Returns true if this record is an update to a previously existing message record, false if it is a new message record.

Returns:
true if this record is an update.

setAlarmTriggeredFlag

public void setAlarmTriggeredFlag(boolean flgVal)
Sets the 'alarmTriggered' flag to indicate whether or not an alarm has been triggered for this record.

Parameters:
flgVal - true if an alarm has been triggered for this record, false if not.

getAlarmTriggeredFlag

public boolean getAlarmTriggeredFlag()
Returns the 'alarmTriggered' flag to indicate whether or not an alarm has been triggered for this record.

Returns:
true if an alarm has been triggered for this record, false if not.

setShowMapSymbolFlag

public void setShowMapSymbolFlag(boolean flgVal)
Sets the 'showMapSymbolFlag' flag to indicate whether or not the symbol for this message should be shown on the map. If this method is not called then then 'showMapSymbolFlag' flag will default to 'true' (symbol shown on map).

Parameters:
flgVal - true if the symbol for this message should be shown on the map; false if not.

getShowMapSymbolFlag

public boolean getShowMapSymbolFlag()
Returns the 'showMapSymbolFlag' flag to indicate whether or not the symbol for this message should be shown on the map.

Returns:
true if the symbol for this message should be shown on the map; false if not.

setLocationNote

public void setLocationNote(java.lang.String str)
Sets the "Location Note" value for this message record.

Parameters:
str - the "Location Note" value to use.

getLocationNote

public java.lang.String getLocationNote()
Returns the "Location Note" value for this message record.

Returns:
A string containing the "Location Note" value.

setDisplayObject

public void setDisplayObject(java.lang.Object obj)
Sets the display object associated with this message record.

Parameters:
obj - the object to use.

getDisplayObject

public java.lang.Object getDisplayObject()
Returns the display object associated with this message record.

Returns:
The display object.

setUtilityObject

public void setUtilityObject(java.lang.Object obj)
Sets the utility object associated with this event record.

Parameters:
obj - the object to use.

getUtilityObject

public java.lang.Object getUtilityObject()
Returns the utility object associated with this event record.

Returns:
The utility object.