com.jthomas.mailfaces
Class FaceSelect

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

public class FaceSelect
extends java.lang.Object

The FaceSelect class will determine if a specific Mailmsg matches any of the Select statements from the Options file. There is a FaceSelect object for each of the 3 types. Select, SelectAfter and KillSelect. During initialization of the FaceSelect object it processes the SelectList built by FaceOptions for builds a FaceSelection object for each valid Select statement. The FaceResolver class picks the Mailmsg off of the queue and invokes the selectImage(Mailmsg) method for the Select and then KillSelect object. If these both returned null, it is sent to the PICON queue. PiconDB may puts it back in the FaceResolver queue who then calls the selectImage method for the SelectAfter method.

Author:
John Thomas FaceSelection, Regexp, Mailmsg, FaceOptions

Field Summary
static java.lang.String KILLSELECT
           
static java.lang.String NAMED_SELECT
           
static java.lang.String SELECT
           
static java.lang.String SELECT_AFTER
           
 
Constructor Summary
FaceSelect(java.lang.String type)
           
 
Method Summary
 FaceSelection selectImage(Mailmsg mailmsg)
          selectImage(Mailmsg msg) returns the matching Selection Object or null if it does not match any statement.
 void setup()
          Initialization routine called after object is constructed and when the Options file is reparsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KILLSELECT

public static final java.lang.String KILLSELECT
See Also:
Constant Field Values

SELECT

public static final java.lang.String SELECT
See Also:
Constant Field Values

SELECT_AFTER

public static final java.lang.String SELECT_AFTER
See Also:
Constant Field Values

NAMED_SELECT

public static final java.lang.String NAMED_SELECT
See Also:
Constant Field Values
Constructor Detail

FaceSelect

public FaceSelect(java.lang.String type)
Method Detail

setup

public void setup()
Initialization routine called after object is constructed and when the Options file is reparsed. The Select statement has the syntax:
Select headername [RE] match imageURL options KillSelect headername [RE] match [autodelete] SelectAfter headername [RE] match imageURL options Options are: [SMS] [AUDIO audioURL] [EXIT exitvalue]
   - Initialize the FaceSelect object.
   - Get array of Select/killselect/selectafter statements 
    - For each statenment: 
     - call FaceSelection class method to get 
        an instance of FaceSelection. 
     - store the FaceSelection instances in an array.
    
  


selectImage

public FaceSelection selectImage(Mailmsg mailmsg)
selectImage(Mailmsg msg) returns the matching Selection Object or null if it does not match any statement. It is possible that more than one FaceSelection objects may match If one is found that does not specify an image, then it continues searching
    Select subject  SMStest  sms
    Select from  xxxx  imageurl
 

Parameters:
mailmsg - The mail that is being checked.