Quadcap Embeddable Server

com/quadcap/pop3/client/MessageHook.java

Go to the documentation of this file.
00001 package com.quadcap.pop3.client; 00002 00003 /* 00004 * Copyright 1997 - 2003 by Stan Bailes and Quadcap Software. 00005 * 00006 **/ 00007 00008 import java.io.InputStream; 00009 00010 import java.util.Map; 00011 import java.util.Properties; 00012 00013 /** 00014 * Interface for message delivery. 00015 * 00016 * @author Stan Bailes 00017 */ 00018 public interface MessageHook { 00019 /** 00020 * Initialize the hook with its property set 00021 */ 00022 public void init(Properties p) throws Exception; 00023 00024 /** 00025 * Return <code>true</code> if the call to 00026 * <code>boolean passHeaders(Map headers)</code> will always return 00027 * true, so the message receiver can avoid calling it. 00028 */ 00029 public boolean passAllHeaders(); 00030 00031 /** 00032 * A hook first gets called with the parsed headers from the message. 00033 * If the hook returns 'true' to this call, it will be called again 00034 * to process the body using <code>sendMessage()</code>, below. 00035 */ 00036 public boolean passHeaders(Map headers); 00037 00038 /** 00039 * The hook is called to process the entire message (including headers) 00040 * as an octet stream. 00041 * 00042 * @return <code>false</code> if the message is to be retained in 00043 * the store, <code>true</code> to delete it. 00044 */ 00045 public boolean passMessage(InputStream is) throws Exception; 00046 }