01: package com.quadcap.pop3.client;
02:
03: /*
04: * Copyright 1997 - 2003 by Stan Bailes and Quadcap Software.
05: *
06: **/
07:
08: import java.io.InputStream;
09:
10: import java.util.Map;
11: import java.util.Properties;
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 p) throws Exception;
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 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 is) throws Exception;
46: }
|