/* this belongs to the WebRaveler package */ package webraveler.ravel; import java.util.*; import webraveler.http.HTTPRequest; import webraveler.http.HTTPResponse; /** * A template for a Raveler plugin * * @author The Web Raveler Development Squad * @version 1.0 */ public abstract class RavelerPlugin { /* variables */ public Hashtable attributes; public Hashtable vurls; public String name; public Vector mimeTypes; public Raveler ravel; /* constructors */ public RavelerPlugin () { name = "Plugin"; mimeTypes = new Vector(); } /* methods */ /** * Start executing the plugin - to be overwriten by plugin writer * * @param response an HTTPResponse with the response to be modified/cached/etc * @return an HTTPResponse object, the result of running the plugin on the input message */ public HTTPResponse execute(HTTPResponse response, Hashtable configuration) throws RavelerWarningException, RavelerErrorException, PluginCallbackException { return response; } /** * Start executing the plugin - to be overwriten by plugin writer * * @param request an HTTPRequest with the request to be modified/cached/etc * @return an HTTPRequest object, the result of running the plugin on the input message */ public HTTPRequest execute(HTTPRequest request, Hashtable configuration) throws RavelerWarningException, RavelerErrorException, PluginCallbackException { return request; } /** * Set the default status for this plugin in the attributes hash table. * */ public void setDefaultStatus() { attributes.put("status","disabled"); } //setDefaultAttributes() /** * Set the default configuration for this plugin in the attributes hash table. * */ public abstract void setDefaultAttributes(); /** * Dso the setup stuff with Raveler - banner setup, etc. * Put the plugin on Raveler's "plugin vector" * * @return a boolean success value */ public abstract boolean initialize(); /** * Terminate the Plugin - Hasta la vista, BABY! */ public abstract void terminate(); } // RavelerPlugin