com.jthomas.mailfaces
Class FaceSelection

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

public class FaceSelection
extends java.lang.Object

The FaceSelection represents the Select/KillSelect/SelectAfter statements that are read from the option file.

Author:
John Thomas FaceSelect, 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
           
 
Method Summary
 java.lang.String getAudioURL()
          method used to get the AudioURL for the matching Select statement.
 boolean getAutoDelete()
          method used to get the AutoDelete flag.
 java.lang.String getCopyAddress()
          method used to get the copy address.
 FaceExit getExit()
          method used to get the Exit classname.
static FaceSelection getFaceSelection(java.lang.String type, java.lang.String statement)
          static class object to return a FaceSelection Object.
 java.lang.String getImageURL()
          method used to get the ImageURL for the matching Select statement.
 java.lang.String getMoveAddress()
          method used to get the move address.
 java.lang.String getName()
          method used to get the Name assigned to the Select statement.
 boolean getSMS()
          method used to get the SMS message flag.
 boolean getSMSCopy()
          method used to get the SMSCopy flag.
 boolean isValid()
          method used to get the SelectValid flag.
 boolean match(java.lang.String buffer)
          Match the buffer against the specified entry It may be a regular expression or a string comparison.
 boolean matchHeader(Mailmsg mailmsg, java.lang.String header)
          Match the buffer against the specified header.
 boolean selectImage(Mailmsg mailmsg)
          selectImage(Mailmsg msg) returns an index to matching Select statement or -1 if it does not match any statement.
 void setValid(boolean onOff)
          method used to set the SelectValid flag.
 java.lang.String toString()
          toString display method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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
Method Detail

getFaceSelection

public static FaceSelection getFaceSelection(java.lang.String type,
                                             java.lang.String statement)
static class object to return a FaceSelection Object. The Select statement has the syntax:
   Select [not] headername  match imageURL options 
   Select [not] headername re(regexp) [imageurl] [options]
   KillSelect [not] headername [RE] match [autodelete]
   SelectAfter [not] headername [RE] match imageURL options
   
   The "not" modifier makes it a negative test and
   could also be coded as "!"
 
   Options are:
      SMS 
      AUDIO(audioURL)
      EXIT[(exitvalue)]
      copy[(copyaddress)]
      move[(moveaddress)]  
      autodelete
 
 
   - Initialize the FaceSelection object.
  : 
     - parse the statement 
     - store the statement options
    
  


selectImage

public boolean selectImage(Mailmsg mailmsg)
selectImage(Mailmsg msg) returns an index to matching Select statement or -1 if it does not match any statement.
 There are many possible types of Select statements.
    recipient  that will match is the to: or cc: headers  
           match the specified id
    sender      that will match based on from: and reply-to headers
    
    group  that matches if a call to FaceGroup.resolve() returns true
    
    header  that matches if the specified header line matches either the 
            specified string or the specified Regular Expression.
    
    any(name1 name2 ...) 
    all(name1 name2 ...)
            These will cause the names select statements to be tested.
  
    The "not" operand will make reverse the match
 
 
 

Parameters:
mailmsg - The mail that is being checked.

match

public boolean match(java.lang.String buffer)
Match the buffer against the specified entry It may be a regular expression or a string comparison.

Parameters:
buffer - The string to be matched to
Returns:
true if expression matches the buffer.

matchHeader

public boolean matchHeader(Mailmsg mailmsg,
                           java.lang.String header)
Match the buffer against the specified header. It may be a regular expression or a string comparison.

Parameters:
header - The name of the headerto match against
Returns:
true if expression matches the header, false if not matched or header does not exist

getImageURL

public java.lang.String getImageURL()
method used to get the ImageURL for the matching Select statement. The selectImage method returns an index to the matching statement if it finds a match. This method is used to get the imageURL for from the Select statement at that index.


getAudioURL

public java.lang.String getAudioURL()
method used to get the AudioURL for the matching Select statement. The selectImage method returns an index to the matching statement if it finds a match. This method is used to get the audio URL for from the Select statement at that index.


getAutoDelete

public boolean getAutoDelete()
method used to get the AutoDelete flag.


getSMS

public boolean getSMS()
method used to get the SMS message flag.


getSMSCopy

public boolean getSMSCopy()
method used to get the SMSCopy flag.


getCopyAddress

public java.lang.String getCopyAddress()
method used to get the copy address.

Returns:
copy email address.

getMoveAddress

public java.lang.String getMoveAddress()
method used to get the move address.

Returns:
move email address.

getExit

public FaceExit getExit()
method used to get the Exit classname.

Returns:
classname.

getName

public java.lang.String getName()
method used to get the Name assigned to the Select statement.

Returns:
name.

isValid

public boolean isValid()
method used to get the SelectValid flag.


setValid

public void setValid(boolean onOff)
method used to set the SelectValid flag.


toString

public java.lang.String toString()
toString display method

Overrides:
toString in class java.lang.Object