com.isti.quakewatch.alertemail
Class AlertEmailMessage

java.lang.Object
  extended by com.isti.quakewatch.alert.AlertMessage
      extended by com.isti.quakewatch.alertemail.AlertEmailMessage
All Implemented Interfaces:
AlertEmailMessageInterface

public class AlertEmailMessage
extends AlertMessage
implements AlertEmailMessageInterface

Class AlertEmailMessage defines an alert email message.


Field Summary
static java.lang.String ADDITIONAL_EQPARAMS_STR
          "Additional Earthquake Parameters" string.
static java.lang.String CANCELLED_EQREP_HDRSTR
          "Earthquake Report Cancellation" header string; centered.
static java.lang.String CSSTR
          String containing ", ".
static java.lang.String EQ_DELETED_STR
          "Earthquake Deleted" string.
static java.lang.String EQ_MESSAGE_STR
          "Earthquake Message" string.
static java.lang.String EVENT_DELETED_STR
          "The duty seismologist has deleted event" string.
static java.lang.String EVENT_REVIEWED_STR
          "This event has been reviewed..." string.
 boolean longMsgFormatFlag
          Format flag for message; true = "long", false = "short".
static java.lang.String MORE_INFOABOUT_STR
          "More information about..." string.
static java.lang.String NLSTR
          String containing the newline character.
static java.lang.String NOT_REVIEWED_STR
          "This is a computer-generated message..." string.
static java.lang.String PRELIM_EQREP_HDRSTR
          "Preliminary Earthquake Report" header string; centered.
static java.lang.String PRINCIPAL_EQPARAMS_STR
          "Principal Earthquake Parameters" string.
static java.lang.String QUAKE_DELETED_STR
          " Quake Deleted" string.
static java.lang.String QUAKE_REPORT_STR
          " Quake Report" string.
static java.lang.String REP_SUPERSEDES_STR
          "This report supersedes..." string.
static java.lang.String SOURCE_CONTACTS_STR
          "Source of Information/Contacts" string.
static java.lang.String UNDERLINE_32CHARS_STR
          "_______________________________" string.
 
Fields inherited from class com.isti.quakewatch.alert.AlertMessage
eventMagTypeStr, eventMagValStr, eventMsgRecObj, evtMagValTypeStr, logFileObj, messageType, MSTR, NASTR, networkInfoObj
 
Constructor Summary
protected AlertEmailMessage(LogFile logObj, AlertEmailSenderInterface emailSenderObj, int messageType, QWEventMsgRecord eventMsgRecObj, boolean longMsgFormatFlag, SeismicNetworkInfo networkInfoObj)
          Creates an alert email message.
 
Method Summary
static AlertEmailMessage createAlertEmailMessage(LogFile logObj, AlertEmailSenderInterface emailSenderObj, int messageType, QWEventMsgRecord eventMsgRecObj, boolean longMsgFormatFlag)
          Creates an alert email message.
 java.lang.String getMessageTextString()
          Returns the text for the body of the email message.
 java.lang.String getSubjectTextString()
          Returns the text for the subject of the email message.
 boolean isSameParams(int messageType, QWEventMsgRecord eventMsgRecObj, boolean longMsgFormatFlag)
          Returns an indicator of whether or not the given parameters match those used to create this alert email message.
protected  void setMessageTextString(java.lang.String s)
          Sets the text for the body of the email message.
protected  void setSubjectTextString(java.lang.String s)
          Sets the text for the subject of the email message.
 java.lang.String toString()
          Returns a string containing a summary of the message.
 
Methods inherited from class com.isti.quakewatch.alert.AlertMessage
getMsgTypeTagStr, getMsgTypeTagStr, getNetworkInfo, showValOrNA
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NLSTR

public static final java.lang.String NLSTR
String containing the newline character.

See Also:
Constant Field Values

CSSTR

public static final java.lang.String CSSTR
String containing ", ".

See Also:
Constant Field Values

EQ_MESSAGE_STR

public static final java.lang.String EQ_MESSAGE_STR
"Earthquake Message" string.

See Also:
Constant Field Values

EQ_DELETED_STR

public static final java.lang.String EQ_DELETED_STR
"Earthquake Deleted" string.

See Also:
Constant Field Values

PRELIM_EQREP_HDRSTR

public static final java.lang.String PRELIM_EQREP_HDRSTR
"Preliminary Earthquake Report" header string; centered.


CANCELLED_EQREP_HDRSTR

public static final java.lang.String CANCELLED_EQREP_HDRSTR
"Earthquake Report Cancellation" header string; centered.


REP_SUPERSEDES_STR

public static final java.lang.String REP_SUPERSEDES_STR
"This report supersedes..." string.

See Also:
Constant Field Values

NOT_REVIEWED_STR

public static final java.lang.String NOT_REVIEWED_STR
"This is a computer-generated message..." string.

See Also:
Constant Field Values

EVENT_REVIEWED_STR

public static final java.lang.String EVENT_REVIEWED_STR
"This event has been reviewed..." string.

See Also:
Constant Field Values

EVENT_DELETED_STR

public static final java.lang.String EVENT_DELETED_STR
"The duty seismologist has deleted event" string.

See Also:
Constant Field Values

PRINCIPAL_EQPARAMS_STR

public static final java.lang.String PRINCIPAL_EQPARAMS_STR
"Principal Earthquake Parameters" string.

See Also:
Constant Field Values

UNDERLINE_32CHARS_STR

public static final java.lang.String UNDERLINE_32CHARS_STR
"_______________________________" string.

See Also:
Constant Field Values

MORE_INFOABOUT_STR

public static final java.lang.String MORE_INFOABOUT_STR
"More information about..." string.

See Also:
Constant Field Values

ADDITIONAL_EQPARAMS_STR

public static final java.lang.String ADDITIONAL_EQPARAMS_STR
"Additional Earthquake Parameters" string.

See Also:
Constant Field Values

SOURCE_CONTACTS_STR

public static final java.lang.String SOURCE_CONTACTS_STR
"Source of Information/Contacts" string.

See Also:
Constant Field Values

QUAKE_REPORT_STR

public static final java.lang.String QUAKE_REPORT_STR
" Quake Report" string.

See Also:
Constant Field Values

QUAKE_DELETED_STR

public static final java.lang.String QUAKE_DELETED_STR
" Quake Deleted" string.

See Also:
Constant Field Values

longMsgFormatFlag

public final boolean longMsgFormatFlag
Format flag for message; true = "long", false = "short".

Constructor Detail

AlertEmailMessage

protected AlertEmailMessage(LogFile logObj,
                            AlertEmailSenderInterface emailSenderObj,
                            int messageType,
                            QWEventMsgRecord eventMsgRecObj,
                            boolean longMsgFormatFlag,
                            SeismicNetworkInfo networkInfoObj)
Creates an alert email message.

Parameters:
logObj - the 'LogFile' object.
emailSenderObj - 'EmailSenderInterface' object.
messageType - message type value for message.
eventMsgRecObj - event-message-record object for message.
longMsgFormatFlag - format flag for message; true = "long", false = "short".
networkInfoObj - seismic-network information for building the message.
Method Detail

getSubjectTextString

public java.lang.String getSubjectTextString()
Returns the text for the subject of the email message.

Specified by:
getSubjectTextString in interface AlertEmailMessageInterface
Returns:
The text for the subject of the email message.

setSubjectTextString

protected void setSubjectTextString(java.lang.String s)
Sets the text for the subject of the email message.

Parameters:
s - The text for the subject of the email message.

getMessageTextString

public java.lang.String getMessageTextString()
Returns the text for the body of the email message.

Specified by:
getMessageTextString in interface AlertEmailMessageInterface
Returns:
The text for the body of the email message.

setMessageTextString

protected void setMessageTextString(java.lang.String s)
Sets the text for the body of the email message.

Parameters:
s - The text for the body of the email message.

isSameParams

public boolean isSameParams(int messageType,
                            QWEventMsgRecord eventMsgRecObj,
                            boolean longMsgFormatFlag)
Returns an indicator of whether or not the given parameters match those used to create this alert email message.

Parameters:
messageType - message type value for message.
eventMsgRecObj - event-message-record object for message.
longMsgFormatFlag - format flag for message; true = "long", false = "short".
Returns:
true if the given parameters match those used to create this alert email message; false if not.

toString

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

Overrides:
toString in class AlertMessage
Returns:
A string containing a summary of the message.

createAlertEmailMessage

public static AlertEmailMessage createAlertEmailMessage(LogFile logObj,
                                                        AlertEmailSenderInterface emailSenderObj,
                                                        int messageType,
                                                        QWEventMsgRecord eventMsgRecObj,
                                                        boolean longMsgFormatFlag)
Creates an alert email message. If the parameters match those used to create the previous alert email message then the previous object will be reused.

Parameters:
logObj - the 'LogFile' object.
emailSenderObj - 'AlertEmailSenderInterface' object.
messageType - message type value for message.
eventMsgRecObj - event-message-record object for message.
longMsgFormatFlag - format flag for message; true = "long", false = "short".
Returns:
An 'AlertEmailMessage' for the given parameters, or null if the network data-source code for the given event-message record is not supported.