1/*2 * Copyright 2000-2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.services.webpage;
1819// javax.servlet20import javax.servlet.http.HttpServletRequest;
21import javax.servlet.http.HttpServletResponse;
22import javax.servlet.ServletConfig;
23import javax.servlet.http.HttpServlet;
24import javax.servlet.ServletException;
2526// java.io27import java.io.IOException;
2829// java.util30import java.util.Collection;
313233/***34 * The WebPage Service service interface definition.35 * All implementations of an WebPage Service must implement this interface.36 *37 * Interface defines methods to control the WebPage service, 38 * to manage 0..n sessions amongst 0..n sites.39 *40 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>41 * @version $Id: WebPageService.java,v 1.2 2004/02/23 03:46:26 jford Exp $42 */4344interfaceWebPageService45 {
4647/*** The name of this service */48publicfinalstatic String SERVICE_NAME = "WebPageService";
4950/***51 * The primary method invoked when the a proxied GET is executed.52 *53 * @param servlet the Servlet. 54 * @param req Servlet request.55 * @param res Servlet response.56 * @exception IOException a servlet exception.57 * @exception ServletException a servlet exception.58 */5960publicvoid get(HttpServlet servlet,
61 HttpServletRequest request,
62 HttpServletResponse response)
63 throws ServletException, IOException;
646566/***67 * The primary method invoked when the a proxied POST is executed.68 *69 * @param servlet the Servlet. 70 * @param req Servlet request.71 * @param res Servlet response.72 * @exception IOException a servlet exception.73 * @exception ServletException a servlet exception.74 */75publicvoid post(HttpServlet servlet,
76 HttpServletRequest request,
77 HttpServletResponse response)
78 throws ServletException, IOException;
7980/***81 * One time initialization of the WebPage service82 *83 * @param config the servlet configuration. 84 * @exception IOException a servlet exception.85 * @exception ServletException a servlet exception.86 */87publicboolean init(ServletConfig config)
88 throws ServletException, IOException;
8990/***91 * One time de-initialization of the proxy service92 *93 */94publicvoid destroy();
959697/***98 * Returns true if the service was initialized successfully.99 *100 * @return true if the service was initialized successfully.101 */102publicboolean isInit();
103104/***105 * Returns a snapshot of all the active and inactive sessions.106 *107 * @return the collection of sessions.108 */109public Collection getSessions();
110111/***112 * Returns a Session, give a string id key identifying that session.113 *114 * @param id The ID of the session.115 * @return The corresponding sessions.116 */117publicSessionMap getSession(String id);
118119/***120 * Returns a snapshot collection of all the sites managed by this Proxy service.121 *122 * @return the collection of managed sites.123 */124public Collection getSites();
125126127/***128 * Returns the error string from failed initialized.129 *130 * @return the error string from last error.131 */132public String getErrorString();
133 }
134