/*
 * COPYRIGHT (c) 1998-1999 Jan-Henrik Haukeland, http://www.tildeslash.com/
 */

package ts.mail;

import java.util.Vector;

import ts.mail.GetMailException;
import ts.biff.SafeTerminate;

/**
 * This interface represent an abstract Mail Fetch Agent. A MFA is
 * used for fetching mail messages. Implementors should implement the
 * getMail method which will be the actual protocol used for fetching
 * mail.
 *
 * @see MboxAgent
 *
 * @author  Jan-Henrik Haukeland &lt;hauk@tildeslash.com&gt;
 * @version $Id: FetchAgent.java,v 1.5 1999/06/09 18:55:57 hauk Exp $ 
 */
public interface FetchAgent extends SafeTerminate
{

  // ----------------------- Abstract methods --------------------- //

  /**
   * Fetch mail messages using a certain protocol. 
   *
   * @exception GetMailException Is thrown if mail for some reason
   *                             could not be fetched
   *
   * @return A vector with MailModel objects
   */
  public Vector getMail() throws GetMailException ;
  

  /**
   * Stop reading mail
   */
  public void stopScan() ;


  /**
   * @return The protocol used
   */
  public String getProtocol() ;

}
