Quadcap Embeddable Server

com.quadcap.pop3.client.Pop3Agent Class Reference

List of all members.

Detailed Description

This simple Pop3 agent transfers all new messages in a remote Pop3 mailbox into the specified folder in the quadcap message store.

A more sophisticated agent would scan the headers first and apply filters to certain messages without having to fetch the bodies.

Author:
Stan Bailes

Definition at line 70 of file Pop3Agent.java.

Public Member Functions

void write (OutputStream w) throws IOException
void read (InputStream r) throws IOException
 Pop3Agent ()
 Default constructor for factory.

void run (Properties props, MessageHook hook)
 Check for mail.


Package Functions

void getMail (MessageHook hook) throws IOException
 Figure out what's new and deliver it.

void getMessages (MessageHook hook, ArrayList v) throws IOException
 Get the specified list of messages.

void deleteMessages (ArrayList v) throws IOException
 Delete the specified list of messages.

UidlEntry getUidlEntry (String uidl)
 Search the map for a specified UIDL entry.

UidlEntry putUidlEntry (String uidl, int msgNum, Date d)
 Create and store a new UidlEntry in the map.


Package Attributes

HashMap uidlMap = new HashMap()
String hostName = null
int portNumber = 110
String login = null
String passwd = null
int daysKeep = 999999
boolean enabled = true
Session pop3 = null


Constructor & Destructor Documentation

com.quadcap.pop3.client.Pop3Agent.Pop3Agent  ) 
 

Default constructor for factory.

Definition at line 104 of file Pop3Agent.java.


Member Function Documentation

void com.quadcap.pop3.client.Pop3Agent.deleteMessages ArrayList  v  )  throws IOException [package]
 

Delete the specified list of messages.

Parameters:
v a ArrayList of UidlEntry types, specifying the messages to delete.

Definition at line 264 of file Pop3Agent.java.

References com.quadcap.pop3.client.Session.dele(), com.quadcap.pop3.client.Pop3Agent.deleteMessages(), com.quadcap.pop3.client.UidlEntry.getMessageNumber(), com.quadcap.pop3.client.UidlEntry.getUidl(), com.quadcap.pop3.client.Pop3Agent.pop3, and com.quadcap.pop3.client.Pop3Agent.uidlMap.

Referenced by com.quadcap.pop3.client.Pop3Agent.deleteMessages(), and com.quadcap.pop3.client.Pop3Agent.getMail().

void com.quadcap.pop3.client.Pop3Agent.getMail MessageHook  hook  )  throws IOException [package]
 

Figure out what's new and deliver it.

Figure out what's old and delete it.

Definition at line 156 of file Pop3Agent.java.

References com.quadcap.pop3.client.Pop3Agent.daysKeep, com.quadcap.pop3.client.Pop3Agent.deleteMessages(), com.quadcap.pop3.client.UidlEntry.getFirstSeen(), com.quadcap.pop3.client.Pop3Agent.getMail(), com.quadcap.pop3.client.Pop3Agent.getMessages(), com.quadcap.pop3.client.Pop3Agent.getUidlEntry(), com.quadcap.pop3.client.UidlEntry.markedForDeletion, com.quadcap.pop3.client.Pop3Agent.pop3, com.quadcap.pop3.client.Pop3Agent.putUidlEntry(), com.quadcap.pop3.client.UidlEntry.setMessageNumber(), and com.quadcap.pop3.client.Session.uidl().

Referenced by com.quadcap.pop3.client.Pop3Agent.getMail(), and com.quadcap.pop3.client.Pop3Agent.run().

void com.quadcap.pop3.client.Pop3Agent.getMessages MessageHook  hook,
ArrayList  v
throws IOException [package]
 

Get the specified list of messages.

Parameters:
v a ArrayList of UidlEntry types, specifying the messages to get.

Definition at line 219 of file Pop3Agent.java.

References com.quadcap.pop3.client.Session.dele(), com.quadcap.pop3.client.UidlEntry.getMessageNumber(), com.quadcap.pop3.client.Pop3Agent.getMessages(), com.quadcap.pop3.client.UidlEntry.markedForDeletion, com.quadcap.pop3.client.Pop3Agent.pop3, com.quadcap.pop3.client.Session.retr(), and com.quadcap.pop3.client.Session.top().

Referenced by com.quadcap.pop3.client.Pop3Agent.getMail(), and com.quadcap.pop3.client.Pop3Agent.getMessages().

UidlEntry com.quadcap.pop3.client.Pop3Agent.getUidlEntry String  uidl  )  [package]
 

Search the map for a specified UIDL entry.

Parameters:
uidl the UIDL text to search for
Returns:
if found, the corresponding entry in the map. Otherwise, null.

Definition at line 280 of file Pop3Agent.java.

References com.quadcap.pop3.client.Pop3Agent.getUidlEntry(), and com.quadcap.pop3.client.Pop3Agent.uidlMap.

Referenced by com.quadcap.pop3.client.Pop3Agent.getMail(), and com.quadcap.pop3.client.Pop3Agent.getUidlEntry().

UidlEntry com.quadcap.pop3.client.Pop3Agent.putUidlEntry String  uidl,
int  msgNum,
Date  d
[package]
 

Create and store a new UidlEntry in the map.

Parameters:
uidl the UIDL text
msgNum the current POP3 session's message number.
d the date for this entry.
Returns:
the new UidlEntry

Definition at line 293 of file Pop3Agent.java.

References com.quadcap.pop3.client.Pop3Agent.putUidlEntry(), and com.quadcap.pop3.client.Pop3Agent.uidlMap.

Referenced by com.quadcap.pop3.client.Pop3Agent.getMail(), and com.quadcap.pop3.client.Pop3Agent.putUidlEntry().

void com.quadcap.pop3.client.Pop3Agent.read InputStream  r  )  throws IOException
 

Definition at line 89 of file Pop3Agent.java.

References com.quadcap.pop3.client.UidlEntry.getUidl(), com.quadcap.pop3.client.Pop3Agent.read(), and com.quadcap.pop3.client.Pop3Agent.uidlMap.

Referenced by com.quadcap.pop3.client.Pop3Agent.read(), and com.quadcap.pop3.client.Pop3Service.readAgent().

void com.quadcap.pop3.client.Pop3Agent.run Properties  props,
MessageHook  hook
 

Check for mail.

Definition at line 110 of file Pop3Agent.java.

References com.quadcap.pop3.client.Session.connect(), com.quadcap.pop3.client.Pop3Agent.daysKeep, com.quadcap.pop3.client.Pop3Agent.enabled, com.quadcap.pop3.client.Pop3Agent.getMail(), com.quadcap.pop3.client.Pop3Agent.hostName, com.quadcap.pop3.client.Pop3Agent.login, com.quadcap.pop3.client.Session.pass(), com.quadcap.pop3.client.Pop3Agent.passwd, com.quadcap.pop3.client.Pop3Agent.pop3, com.quadcap.pop3.client.Pop3Agent.portNumber, com.quadcap.pop3.client.Session.quit(), com.quadcap.pop3.client.Pop3Agent.run(), and com.quadcap.pop3.client.Session.user().

Referenced by com.quadcap.pop3.client.MailSuck.main(), com.quadcap.pop3.client.Pop3Agent.run(), com.quadcap.pop3.client.Pop3Service.runAgent(), and com.quadcap.pop3.client.MailSuck.runMany().

void com.quadcap.pop3.client.Pop3Agent.write OutputStream  w  )  throws IOException
 

Definition at line 81 of file Pop3Agent.java.

References com.quadcap.pop3.client.UidlEntry.toString(), com.quadcap.pop3.client.Pop3Agent.uidlMap, and com.quadcap.pop3.client.Pop3Agent.write().

Referenced by com.quadcap.pop3.client.Pop3Agent.write(), and com.quadcap.pop3.client.Pop3Service.writeAgent().


Member Data Documentation

int com.quadcap.pop3.client.Pop3Agent.daysKeep = 999999 [package]
 

Definition at line 76 of file Pop3Agent.java.

Referenced by com.quadcap.pop3.client.Pop3Agent.getMail(), and com.quadcap.pop3.client.Pop3Agent.run().

boolean com.quadcap.pop3.client.Pop3Agent.enabled = true [package]
 

Definition at line 77 of file Pop3Agent.java.

Referenced by com.quadcap.pop3.client.Pop3Agent.run().

String com.quadcap.pop3.client.Pop3Agent.hostName = null [package]
 

Definition at line 72 of file Pop3Agent.java.

Referenced by com.quadcap.pop3.client.Pop3Agent.run().

String com.quadcap.pop3.client.Pop3Agent.login = null [package]
 

Definition at line 74 of file Pop3Agent.java.

Referenced by com.quadcap.pop3.client.Pop3Agent.run().

String com.quadcap.pop3.client.Pop3Agent.passwd = null [package]
 

Definition at line 75 of file Pop3Agent.java.

Referenced by com.quadcap.pop3.client.Pop3Agent.run().

Session com.quadcap.pop3.client.Pop3Agent.pop3 = null [package]
 

Definition at line 79 of file Pop3Agent.java.

Referenced by com.quadcap.pop3.client.Pop3Agent.deleteMessages(), com.quadcap.pop3.client.Pop3Agent.getMail(), com.quadcap.pop3.client.Pop3Agent.getMessages(), and com.quadcap.pop3.client.Pop3Agent.run().

int com.quadcap.pop3.client.Pop3Agent.portNumber = 110 [package]
 

Definition at line 73 of file Pop3Agent.java.

Referenced by com.quadcap.pop3.client.Pop3Agent.run().

HashMap com.quadcap.pop3.client.Pop3Agent.uidlMap = new HashMap() [package]
 

Definition at line 71 of file Pop3Agent.java.

Referenced by com.quadcap.pop3.client.Pop3Agent.deleteMessages(), com.quadcap.pop3.client.Pop3Agent.getUidlEntry(), com.quadcap.pop3.client.Pop3Agent.putUidlEntry(), com.quadcap.pop3.client.Pop3Agent.read(), and com.quadcap.pop3.client.Pop3Agent.write().