1 /* 2 * Redirection is part of the Cofax content management system library. 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * 18 * Please see http://www.cofax.org for contact information and other related informaion. 19 * 20 * $Header: /cvsroot/cofax/cofax/src/org/cofax/Redirection.java,v 1.7.2.1 2006/12/11 16:28:44 fxrobin Exp $ 21 */ 22 23 package org.cofax; 24 25 /** 26 * Cofax's top level redirection class. Cofax compatible handlers for data store 27 * implement this API. One example of such a handler is 28 * <code>SqlRedirection</code>. 29 * 30 * <p> 31 * <code>Redirection</code> classes are listed in the configuration and loaded 32 * dynamically. 33 * </p> 34 * 35 * @author Rajiv Pant 36 * @author Hung Dao 37 * @author Derek Dinh 38 * @author Karl Martino 39 * 40 */ 41 42 public abstract class Redirection { 43 44 /** 45 * To be ran once before using the redirection class. Initializes any 46 * internal fields. 47 */ 48 public abstract void init(DataStore db); 49 50 /** 51 * Get's a redirection URL and returns it to the servlet. 52 */ 53 public abstract String getRedirection(String pathInfo); 54 55 /** 56 * Outputs this object's configuration 57 */ 58 public String toString() { 59 return "Instance Of: " + getClass().getName(); 60 61 } 62 63 } 64