Update of /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv901/src/java/org/archive/wayback Modified Files: ResourceStore.java ResourceIndex.java ReplayUI.java QueryUI.java RequestParser.java Log Message: lots of javadoc comments Index: QueryUI.java =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/QueryUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QueryUI.java 18 Oct 2005 02:30:49 -0000 1.1 --- QueryUI.java 19 Oct 2005 01:22:37 -0000 1.2 *************** *** 1,2 **** --- 1,25 ---- + /* QueryUI + * + * Created on Oct 18, 2005 + * + * Copyright (C) 2005 Internet Archive. + * + * This file is part of the Wayback Machine (archive-access.sourceforge.net). + * + * Wayback Machine is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback Machine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback Machine; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + package org.archive.wayback; *************** *** 12,22 **** --- 35,91 ---- import org.archive.wayback.core.WaybackLogic; + /** + * Uses ResourceStore, ResourceIndex via WaybackLogic, to transform a WMRequest + * into first a set of ResourceResults, then into an format suitable for + * end-users. + * + * @author brad + * @version $Date$, $Revision$ + */ public interface QueryUI { + /** + * Initialize this QueryUI. Pass in the specific configurations via + * Properties. + * + * @param p + * Generic properties bag for configurations + * @throws IOException + */ public void init(final Properties p) throws IOException; + /** + * Process a Wayback Machine Query request. + * + * @param wayback + * WaybackLogic object + * @param wmRequest + * pre-parsed WMRequest object + * @param request + * HttpServletRequest + * @param response + * HttpServletResponse + * @throws IOException + * @throws ServletException + */ public void handle(final WaybackLogic wayback, final WMRequest wmRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException; + /** + * Show results for a wayback request containing results for a single Url. + * + * @param wayback + * WaybackLogic object + * @param request + * HttpServletRequest + * @param response + * HttpServletResponse + * @param wmRequest + * pre-parsed WMRequest object + * @param results + * returns from ResourceIndex + * @throws IOException + * @throws ServletException + */ public void showQueryResults(WaybackLogic wayback, HttpServletRequest request, HttpServletResponse response, *************** *** 24,27 **** --- 93,112 ---- throws IOException, ServletException; + /** + * Show results for a wayback request containing results for multiple Urls. + * + * @param wayback + * WaybackLogic object + * @param request + * HttpServletRequest + * @param response + * HttpServletResponse + * @param wmRequest + * pre-parsed WMRequest object + * @param results + * returns from ResourceIndex + * @throws IOException + * @throws ServletException + */ public void showPathQueryResults(WaybackLogic wayback, HttpServletRequest request, HttpServletResponse response, *************** *** 29,36 **** --- 114,145 ---- throws IOException, ServletException; + /** + * Show error page for no results for a wayback request. + * + * @param wmRequest + * pre-parsed WMRequest object + * @param request + * HttpServletRequest + * @param response + * HttpServletResponse + * @throws IOException + * @throws ServletException + */ public void showNoMatches(final WMRequest wmRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException; + /** + * Show error page for inability to communicate with ResourceIndex. + * + * @param wmRequest + * pre-parsed WMRequest object + * @param request + * HttpServletRequest + * @param response + * HttpServletResponse + * @throws IOException + * @throws ServletException + */ public void showIndexNotAvailable(final WMRequest wmRequest, final HttpServletRequest request, final HttpServletResponse response) Index: ResourceStore.java =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/ResourceStore.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ResourceStore.java 18 Oct 2005 02:30:49 -0000 1.1 --- ResourceStore.java 19 Oct 2005 01:22:37 -0000 1.2 *************** *** 1,2 **** --- 1,25 ---- + /* ResourceStore + * + * Created on 2005/10/18 14:00:00 + * + * Copyright (C) 2005 Internet Archive. + * + * This file is part of the Wayback Machine (crawler.archive.org). + * + * Wayback Machine is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback Machine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback Machine; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + package org.archive.wayback; *************** *** 7,13 **** --- 30,57 ---- import org.archive.wayback.core.Resource; + /** + * Transforms an ARCLocation into a Resource. + * + * @author Brad Tofel + * @version $Date$, $Revision$ + */ public interface ResourceStore { + /** + * Transform an ARCLocation into a Resource + * + * @param location + * @return Resource object retrieved from ARCLocation + * @throws IOException + */ public Resource retrieveResource(ARCLocation location) throws IOException; + /** + * Initialize this ResourceStore. Pass in the specific configurations via + * Properties. + * + * @param p + * Generic properties bag for configurations + * @throws Exception + */ public void init(Properties p) throws Exception; } Index: RequestParser.java =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/RequestParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RequestParser.java 18 Oct 2005 02:30:49 -0000 1.1 --- RequestParser.java 19 Oct 2005 01:22:37 -0000 1.2 *************** *** 1,2 **** --- 1,25 ---- + /* RequestParser + * + * Created on 2005/10/18 14:00:00 + * + * Copyright (C) 2005 Internet Archive. + * + * This file is part of the Wayback Machine (crawler.archive.org). + * + * Wayback Machine is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback Machine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback Machine; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + package org.archive.wayback; *************** *** 5,9 **** --- 28,46 ---- import org.archive.wayback.core.WMRequest; + /** + * Parser of user requests from URL, query argument, Cookies, sessionID, etc + * into a WMRequest object. + * + * @author Brad Tofel + * @version $Date$, $Revision$ + */ public interface RequestParser { + /** + * Attempt to extract a valid WMRequest object from the HttpServletRequest + * + * @param request + * @return null or the parsed WMRequest object representing the users + * request. + */ public WMRequest parseRequest(final HttpServletRequest request); } Index: ResourceIndex.java =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/ResourceIndex.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ResourceIndex.java 18 Oct 2005 02:30:49 -0000 1.1 --- ResourceIndex.java 19 Oct 2005 01:22:37 -0000 1.2 *************** *** 1,2 **** --- 1,25 ---- + /* ResourceIndex + * + * Created on 2005/10/18 14:00:00 + * + * Copyright (C) 2005 Internet Archive. + * + * This file is part of the Wayback Machine (crawler.archive.org). + * + * Wayback Machine is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback Machine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback Machine; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + package org.archive.wayback; *************** *** 8,15 **** --- 31,62 ---- import org.archive.wayback.exception.WaybackException; + /** + * Transforms a WMRequest into a ResourceResults. + * + * @author Brad Tofel + * @version $Date$, $Revision$ + */ public interface ResourceIndex { + /** + * Transform a WMRequest into a ResourceResults. + * + * @param request + * @return ResourceResults containing ResourceResult objects matching the + * WMRequest + * + * @throws IOException + * @throws WaybackException + */ public ResourceResults query(final WMRequest request) throws IOException, WaybackException; + /** + * Initialize this ResourceIndex. Pass in the specific configurations via + * Properties. + * + * @param p + * Generic properties bag for configurations + * @throws Exception + */ public void init(Properties p) throws Exception; } Index: ReplayUI.java =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/ReplayUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReplayUI.java 18 Oct 2005 02:30:49 -0000 1.1 --- ReplayUI.java 19 Oct 2005 01:22:37 -0000 1.2 *************** *** 1,2 **** --- 1,25 ---- + /* ReplayUI + * + * Created on 2005/10/18 14:00:00 + * + * Copyright (C) 2005 Internet Archive. + * + * This file is part of the Wayback Machine (crawler.archive.org). + * + * Wayback Machine is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback Machine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback Machine; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + package org.archive.wayback; *************** *** 14,28 **** --- 37,96 ---- import org.archive.wayback.core.WaybackLogic; + /** + * Uses ResourceIndex, ResourceStore via WaybackLogic to transform a WMRequest + * into a user-viewable response, either the resource requested, a redirect to a + * better request, or an error message as to why the request failed. + * + * @author Brad Tofel + * @version $Date$, $Revision$ + */ public interface ReplayUI { + /** + * Initialize this ReplayUI. Pass in the specific configurations via + * Properties. + * + * @param p + * Generic properties bag for configurations + * @throws IOException + */ public void init(final Properties p) throws IOException; + /** + * @param request + * @param result + * @return user-viewable String URL that will replay the ResourceResult + */ public String makeReplayURI(final HttpServletRequest request, final ResourceResult result); + /** + * Process a Wayback Replay request, returning the resource requested, a + * redirect to a better/correct URL for the resource, or an error message. + * + * @param wayback + * @param wmRequest + * @param request + * @param response + * @throws IOException + * @throws ServletException + */ public void handle(final WaybackLogic wayback, final WMRequest wmRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException; + /** + * Return a Resource to the user, performing whatever markup or alteration + * is required. + * + * @param wmRequest + * @param result + * @param resource + * @param request + * @param response + * @param results + * @throws IOException + * @throws ServletException + */ public void replayResource(final WMRequest wmRequest, final ResourceResult result, final Resource resource, *************** *** 31,38 **** --- 99,127 ---- throws IOException, ServletException; + /** + * Return an error page to the User indicating that the Resource they + * requested is not stored in the archive. + * + * @param wmRequest + * @param request + * @param response + * @throws IOException + * @throws ServletException + */ public void showNotInArchive(final WMRequest wmRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException; + /** + * Return an error page to the User indicating that the Resource they + * requested is stored in the archive, but is not presently available. + * + * @param wmRequest + * @param request + * @param response + * @param message + * @throws IOException + * @throws ServletException + */ public void showResourceNotAvailable(final WMRequest wmRequest, final HttpServletRequest request, *************** *** 40,43 **** --- 129,143 ---- throws IOException, ServletException; + /** + * Return an error page to the User indicating that the ResourceIndex is + * presently not available. + * + * @param wmRequest + * @param request + * @param response + * @param message + * @throws IOException + * @throws ServletException + */ public void showIndexNotAvailable(final WMRequest wmRequest, final HttpServletRequest request, |