Quadcap Embeddable Server

com/quadcap/pop3/client/HookShell.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.IOException; 00009 import java.io.InputStream; 00010 00011 import java.util.Map; 00012 import java.util.Properties; 00013 00014 /** 00015 * Interface for message delivery. 00016 * 00017 * @author Stan Bailes 00018 */ 00019 public class HookShell implements MessageHook { 00020 /** 00021 * Initialize the hook with its property set 00022 */ 00023 public void init(Properties p) { 00024 } 00025 00026 /** 00027 * Return <code>true</code> if the call to 00028 * <code>boolean passHeaders(Map headers)</code> will always return 00029 * true, so the message receiver can avoid calling it. 00030 */ 00031 public boolean passAllHeaders() { return false; } 00032 00033 /** 00034 * A hook first gets called with the parsed headers from the message. 00035 * If the hook returns 'true' to this call, it will be called again 00036 * to process the body using <code>sendMessage()</code>, below. 00037 */ 00038 public boolean passHeaders(Map headers) { 00039 return "shell".equals(headers.get("X-MessageHook")); 00040 } 00041 00042 /** 00043 * The hook is called to process the entire message (including headers) 00044 * as an octet stream. 00045 * 00046 * @return <code>false</code> if the message is to be retained in 00047 * the store, <code>true</code> to delete it. 00048 */ 00049 public boolean passMessage(InputStream is) throws IOException { 00050 return false; 00051 } 00052 }