com.jthomas.mailfaces
Class FaceSMS

java.lang.Object
  |
  +--com.jthomas.mailfaces.FaceSMS

public class FaceSMS
extends java.lang.Object

FaceSMS will handle the sending of an SMS message (Short Message Service) to the specified cellphone. The subject and body of the email will be extracted and made into a 160 byte message and emailed to a server using the original From: header. The SMS server (from the SMSEmail parameter in the faces.opt file) is supplied by the cell phone carrier and will convert the email and send the SMS message.

Author:
John Thomas
Constructor Summary
FaceSMS()
          Default constructor for FaceSMS.
 
Method Summary
 boolean getSMSActive()
           
protected  java.lang.String getText(Mailmsg mailmsg, int max)
          getText will get the text from the original mailmessage and prepare it tfor the SMS Message.
 void refreshOptions()
          Method: refreshOptions() get control initially and when the user refreshes the Option file.
 void sendSMS(Mailmsg mailmsg)
          Send an SMS message based on the specified Mailmsg.
 void setSMSActive(boolean onOff)
          get/set SMS active flag The user can activate and deactivate the SMS service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaceSMS

public FaceSMS()
Default constructor for FaceSMS. It will processs the Options, ask to be informed if the options change, .

Method Detail

refreshOptions

public void refreshOptions()
Method: refreshOptions() get control initially and when the user refreshes the Option file. It will setup the information needed to send an SMS message The following entries are used from the Options file:
  SMS
  SMSEmail
  SendMailHost
  SMSMaxLength
 

Returns:
void

sendSMS

public void sendSMS(Mailmsg mailmsg)
Send an SMS message based on the specified Mailmsg. We will extract a 160 character or less message based on the send,subject and text of the specified Mailmsg.

Parameters:
mailmsg - The instance of Mailmsg that we will use to compose the SMS message
Returns:
void

getText

protected java.lang.String getText(Mailmsg mailmsg,
                                   int max)
getText will get the text from the original mailmessage and prepare it tfor the SMS Message. It will try to be smart and replace all quoted text by a single "> ..."

Parameters:
mailmsg - The original error message
max - The mas length that we can send in SMS
Returns:
resulting text message

setSMSActive

public void setSMSActive(boolean onOff)
get/set SMS active flag The user can activate and deactivate the SMS service

Returns:
void

getSMSActive

public boolean getSMSActive()