com.isti.quakewatch.alert
Class AlertMessage

java.lang.Object
  extended by com.isti.quakewatch.alert.AlertMessage
Direct Known Subclasses:
AlertEmailMessage

public abstract class AlertMessage
extends java.lang.Object

Class AlertMessage defines an alert message.


Field Summary
 java.lang.String eventMagTypeStr
          Magnitude-type string or null if not available.
 java.lang.String eventMagValStr
          Magnitude-value string.
 QWEventMsgRecord eventMsgRecObj
          Event-message-record object for message.
 java.lang.String evtMagValTypeStr
          Magnitude-with-type display string.
 LogFile logFileObj
          Log file object.
 int messageType
          Message type value for message.
static java.lang.String MSTR
          String containing the 'M' character.
protected static java.lang.String NASTR
          String containing "N/A".
 SeismicNetworkInfo networkInfoObj
          Seismic-network information for message.
 
Constructor Summary
protected AlertMessage(LogFile logObj, int messageType, QWEventMsgRecord eventMsgRecObj, SeismicNetworkInfo networkInfoObj)
          Creates an alert message.
 
Method Summary
 java.lang.String getMsgTypeTagStr()
          Returns a tag string corresponding to the message type.
static java.lang.String getMsgTypeTagStr(int messageType)
          Returns a tag string corresponding to the message type.
static SeismicNetworkInfo getNetworkInfo(QWEventMsgRecord eventMsgRecObj)
          Returns the 'SeismicNetworkInfo' object for the given event-message-record.
protected static java.lang.String showValOrNA(java.lang.String str)
          Returns the given string (if not null) or "N/A" (if null).
 java.lang.String toString()
          Returns a string containing a summary of the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MSTR

public static final java.lang.String MSTR
String containing the 'M' character.

See Also:
Constant Field Values

NASTR

protected static final java.lang.String NASTR
String containing "N/A".

See Also:
Constant Field Values

messageType

public final int messageType
Message type value for message.


eventMsgRecObj

public final QWEventMsgRecord eventMsgRecObj
Event-message-record object for message.


networkInfoObj

public final SeismicNetworkInfo networkInfoObj
Seismic-network information for message.


logFileObj

public final LogFile logFileObj
Log file object.


eventMagValStr

public final java.lang.String eventMagValStr
Magnitude-value string.


eventMagTypeStr

public final java.lang.String eventMagTypeStr
Magnitude-type string or null if not available.


evtMagValTypeStr

public final java.lang.String evtMagValTypeStr
Magnitude-with-type display string.

Constructor Detail

AlertMessage

protected AlertMessage(LogFile logObj,
                       int messageType,
                       QWEventMsgRecord eventMsgRecObj,
                       SeismicNetworkInfo networkInfoObj)
Creates an alert message.

Parameters:
logObj - the 'LogFile' object.
messageType - message type value for message.
eventMsgRecObj - event-message-record object for message.
networkInfoObj - seismic-network information for building the message.
Method Detail

showValOrNA

protected static final java.lang.String showValOrNA(java.lang.String str)
Returns the given string (if not null) or "N/A" (if null).

Parameters:
str - the string to use.
Returns:
The given string (if not null) or "N/A" (if null).

getNetworkInfo

public static SeismicNetworkInfo getNetworkInfo(QWEventMsgRecord eventMsgRecObj)
Returns the 'SeismicNetworkInfo' object for the given event-message-record.

Parameters:
eventMsgRecObj - event-message-record object for message.
Returns:
The 'SeismicNetworkInfo' object for the given data-source code, or null if no match was found.

getMsgTypeTagStr

public static java.lang.String getMsgTypeTagStr(int messageType)
Returns a tag string corresponding to the message type.

Parameters:
messageType - message type value.
Returns:
a tag string corresponding to the message type.

getMsgTypeTagStr

public java.lang.String getMsgTypeTagStr()
Returns a tag string corresponding to the message type.

Returns:
"New-Event", "Update", "Cancel" or "Unknown".

toString

public java.lang.String toString()
Returns a string containing a summary of the message.

Overrides:
toString in class java.lang.Object
Returns:
A string containing a summary of the message.