com.jthomas.mailfaces
Class PiconDB

java.lang.Object
  |
  +--com.jthomas.mailfaces.PiconDB
All Implemented Interfaces:
java.lang.Runnable

public class PiconDB
extends java.lang.Object
implements java.lang.Runnable

Interface to the PICON Database(s).

 Operation:
The PiconDB constructor will create a PiconDBServer object for each PIconDBServer statement in the Opt file. It will also allocate a queue for search requests. The MailFaces main routine will create a thread for the Picondb object and issue the picondbobj.start(). The run method will be given control. It will take requests from the queue (in the form of mailmsgs) and issue a search command for the appropriate image to each of the PiconDBServer Objects. Based on Steve Kinzler's Picon Archive
Picons Archive

Author:
John Thomas jthomas@cruzio.com

Constructor Summary
PiconDB()
          PiconDB() - PiconDB constructor.
 
Method Summary
 boolean checkDeferList(java.lang.String imageurl, java.lang.String host)
          This will check the URL returned from the PICONDB server against the List of "PiconDefer" items specified by the user.
 boolean checkIgnoreList(java.lang.String imageurl, java.lang.String host)
          This will check the URL returned from the PICONDB server against the List of "PiconIgnore" items specified by the user.
 int getCount()
          getCount is a Class method that will return the count of PiconDB objects.
 PiconDBServer[] getList()
          getList will return the list of PiconDBServer objects.
static void main(java.lang.String[] args)
           
 void queuePut(java.lang.Object obj)
          queuePut will place an object in the PiconDB work queue.
 void refreshOptions()
          Method: refreshOptions()
 boolean resolvePiconDB(Mailmsg mailmsg, boolean usecache, boolean domainonly)
          resolvePiconDB() will handle issueing the search request to one or more PiconDBServers.
 void run()
          run() will get control when the Thread is started
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PiconDB

public PiconDB()
PiconDB() - PiconDB constructor.

This will create a PiconDBServer object for each PIconDB statement that it finds in the Options file. The singleton PiconDB object will be created by MailFaces during initialization

Method Detail

queuePut

public void queuePut(java.lang.Object obj)
queuePut will place an object in the PiconDB work queue.


refreshOptions

public void refreshOptions()
Method: refreshOptions()

Returns:
void Invoked when user refreshes the Option file

getList

public PiconDBServer[] getList()
getList will return the list of PiconDBServer objects.


getCount

public int getCount()
getCount is a Class method that will return the count of PiconDB objects.


run

public void run()
run() will get control when the Thread is started

Specified by:
run in interface java.lang.Runnable

resolvePiconDB

public boolean resolvePiconDB(Mailmsg mailmsg,
                              boolean usecache,
                              boolean domainonly)
resolvePiconDB() will handle issueing the search request to one or more PiconDBServers. Note that this can be called directly from FaceResolver.

Returns:
true if the mailmsg is resolved into an appropriate Icon

checkDeferList

public boolean checkDeferList(java.lang.String imageurl,
                              java.lang.String host)
This will check the URL returned from the PICONDB server against the List of "PiconDefer" items specified by the user. It will return true if the URL that that PiconDB returned from the database is in the PiconDefer list.


checkIgnoreList

public boolean checkIgnoreList(java.lang.String imageurl,
                               java.lang.String host)
This will check the URL returned from the PICONDB server against the List of "PiconIgnore" items specified by the user. It will return true if the URL that that PiconDB returned from the database is in the PiconIgnore list.


main

public static void main(java.lang.String[] args)