KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quadcap > pop3 > client > MessageHook


1 package com.quadcap.pop3.client;
2
3 /*
4  * Copyright 1997 - 2003 by Stan Bailes and Quadcap Software.
5  *
6  **/

7
8 import java.io.InputStream JavaDoc;
9
10 import java.util.Map JavaDoc;
11 import java.util.Properties JavaDoc;
12
13 /**
14  * Interface for message delivery.
15  *
16  * @author Stan Bailes
17  */

18 public interface MessageHook {
19     /**
20      * Initialize the hook with its property set
21      */

22     public void init(Properties JavaDoc p) throws Exception JavaDoc;
23
24     /**
25      * Return <code>true</code> if the call to
26      * <code>boolean passHeaders(Map headers)</code> will always return
27      * true, so the message receiver can avoid calling it.
28      */

29     public boolean passAllHeaders();
30
31     /**
32      * A hook first gets called with the parsed headers from the message.
33      * If the hook returns 'true' to this call, it will be called again
34      * to process the body using <code>sendMessage()</code>, below.
35      */

36     public boolean passHeaders(Map JavaDoc headers);
37
38     /**
39      * The hook is called to process the entire message (including headers)
40      * as an octet stream.
41      *
42      * @return <code>false</code> if the message is to be retained in
43      * the store, <code>true</code> to delete it.
44      */

45     public boolean passMessage(InputStream JavaDoc is) throws Exception JavaDoc;
46 }
47
Popular Tags