/*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
 * 
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
 * language governing rights and limitations under the License.
 * 
 * The Original Code is the Venice Web Communities System.
 * 
 * The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
 * for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
 * Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 * 
 * Contributor(s): 
 */
package com.silverwrist.dynamo.servlet;

import java.io.IOException;
import com.silverwrist.dynamo.except.RenderingException;

/**
 * A service interface implemented by
 * {@link com.silverwrist.dynamo.servlet.ServletSelfRenderControl ServletSelfRenderControl} allowing the current
 * request to be "chained" or "forwarded" to a different URI or servlet.  This interface is used only by
 * {@link com.silverwrist.dynamo.util.Forwarder Forwarder} and its subclasses.
 *
 * @author Eric J. Bowersox &lt;erbo@silcom.com&gt;
 * @version X
 */
public interface ChainForward
{
  /**
   * Sets a parameter to be passed with the forwarded request.  Note that, if the parameter name specified
   * is a name reserved for use by Dynamo, it will be ignored.
   *
   * @param name Name of the parameter to be passed.
   * @param value Value of the parameter to be passed.
   */
  public void setChainParameter(String name, Object value);

  /**
   * Forwards the current request to a resource identified by a specified URI path.
   *
   * @param path The path to forward the request to.
   * @exception java.io.IOException If an I/O error occurs while forwarding the request.
   * @exception com.silverwrist.dynamo.except.RenderingException If we are unable to forward the request.
   */
  public void chainToPath(String path) throws IOException, RenderingException;

  /**
   * Forwards the current request to a servlet identified by name.
   *
   * @param servlet_name The name of the servlet to forward the request to.
   * @exception java.io.IOException If an I/O error occurs while forwarding the request.
   * @exception com.silverwrist.dynamo.except.RenderingException If we are unable to forward the request.
   */
  public void chainToNamedServlet(String servlet_name) throws IOException, RenderingException;

} // end interface ChainForward
