com.jthomas.mailfaces
Class FaceMailboxJMail

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

public class FaceMailboxJMail
extends FaceMailbox

SubClass of FaceMailbox for a server that is supported by JavaMail. This uses the Sun JavaMail product to access an Pop3 or IMAP server.

 The following are implementations of 
 the FaceMailbox abstract methods

   void  		open()

	 void		read()

   void 		close()
   
   boolean    delete(Mailmsg[] mailmsgs)

 

Author:
John Thomas jthomas@cruzio.com
See Also:
FaceMailbox

Field Summary
 
Fields inherited from class com.jthomas.mailfaces.FaceMailbox
_Cache, _Count, _Host, _Modified, _OpenFailure, _Options, _Password, _Server, _Type, _User, _ValidInfo, _ValidTypes, COPY_HEADER
 
Method Summary
 void close()
          Method: close() This is called on each pass
 void dumpMsg(javax.mail.Message jmailMsg)
           
 boolean isCopySupported()
          Method: isCopySupported queries ability to copy Mailmsgs.
 boolean isDeleteSupported()
          Method: isDeleteSupported queries ability to delete Mailmsgs.
static void main(java.lang.String[] args)
          Method: main code to allow independent testing of this class
 boolean open()
          open() will setup the connection to the server and login.
 void read()
          The read() method creates a Mailmsg object for each new waiting Mail msg.
 void terminate()
          Method: terminate() We are shutting down so Close the connection to the server
 
Methods inherited from class com.jthomas.mailfaces.FaceMailbox
addMailmsg, copymsg, count, delete, getMailmsg, getMailmsgs, getModified, init, refreshOptions, removeMailmsg, resetMailmsgs, run, setModified, setServer, toString, verifyLoginInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

open

public boolean open()
open() will setup the connection to the server and login.
  Sets up the connection to the MailServer
  and logs in to the server.  It also sets the
  _Count variable to the number of messages waiting
 

Specified by:
open in class FaceMailbox
Returns:
boolean - true if Open OK and false if it fails

read

public void read()
The read() method creates a Mailmsg object for each new waiting Mail msg.

This will get the POP messages from the server and pass them to the checkForNewmsg method which will determine if it is a new message and if so return a Mailmsg object. This Mailmsg object contains the Mail Headers and the size of the msg

Specified by:
read in class FaceMailbox
Returns:
void
See Also:
Mailmsg

close

public void close()
Method: close() This is called on each pass

Specified by:
close in class FaceMailbox
Returns:
void

terminate

public void terminate()
Method: terminate() We are shutting down so Close the connection to the server

Specified by:
terminate in class FaceMailbox
Returns:
void

isDeleteSupported

public boolean isDeleteSupported()
Method: isDeleteSupported queries ability to delete Mailmsgs. Return true to show that we support the delete method.

Overrides:
isDeleteSupported in class FaceMailbox
Returns:
boolean

isCopySupported

public boolean isCopySupported()
Method: isCopySupported queries ability to copy Mailmsgs. Return true to show that we support the copy method.

Overrides:
isCopySupported in class FaceMailbox
Returns:
boolean

dumpMsg

public void dumpMsg(javax.mail.Message jmailMsg)

main

public static void main(java.lang.String[] args)
Method: main code to allow independent testing of this class

Returns:
void
  Args:
     host
     user
     password