/*
 * 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) 2002-03 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 * 
 * Contributor(s): 
 */
package com.silverwrist.dynamo.iface;

import java.util.List;

/**
 * A service interface which rewrites URLs for output.  The URL types are defined in the <CODE>dynamo.xml</CODE>
 * configuration file, which specifies a replacement template for the URL data, and also whether to "encode" the URL
 * with the session ID information (assuming cookies are not supported).
 *
 * @author Eric J. Bowersox &lt;erbo@silcom.com&gt;
 * @version X
 */
public interface URLRewriter
{
  /**
   * Rewrite the specified URL for inclusion in an HTML page.
   *
   * @param type The URL type to use when rewriting the URL.
   * @param url The input URL data.
   * @return The formatted URL.
   */
  public String rewriteURL(String type, String url);

  /**
   * Rewrite the specified URL for use in a redirection.
   *
   * @param type The URL type to use when rewriting the URL.
   * @param url The input URL data.
   * @return The formatted URL.
   */
  public String rewriteRedirectURL(String type, String url);

  /**
   * Gets the list of allowed "type" values for URL rewriting.
   *
   * @return A list of strings, each of which is an allowed URL rewrite "type."
   */
  public List getRewriteTypes();

} // end interface URLRewriter
