001: /******************************************************************************
002: * JBoss, a division of Red Hat *
003: * Copyright 2006, Red Hat Middleware, LLC, and individual *
004: * contributors as indicated by the @authors tag. See the *
005: * copyright.txt in the distribution for a full listing of *
006: * individual contributors. *
007: * *
008: * This is free software; you can redistribute it and/or modify it *
009: * under the terms of the GNU Lesser General Public License as *
010: * published by the Free Software Foundation; either version 2.1 of *
011: * the License, or (at your option) any later version. *
012: * *
013: * This software is distributed in the hope that it will be useful, *
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
016: * Lesser General Public License for more details. *
017: * *
018: * You should have received a copy of the GNU Lesser General Public *
019: * License along with this software; if not, write to the Free *
020: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
021: * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
022: ******************************************************************************/package org.jboss.portal.server;
023:
024: import org.jboss.portal.common.invocation.InvocationContext;
025: import org.jboss.portal.common.util.ParameterMap;
026: import org.jboss.portal.server.request.URLContext;
027: import org.jboss.portal.server.request.URLFormat;
028:
029: import javax.servlet.http.HttpServletRequest;
030: import javax.servlet.http.HttpServletResponse;
031:
032: /**
033: * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
034: * @version $Revision: 8784 $
035: */
036: public interface ServerInvocationContext extends InvocationContext {
037: /**
038: * Return the request that made the connection to the server.
039: *
040: * @return the http request.
041: */
042: HttpServletRequest getClientRequest();
043:
044: /**
045: * Return the response that will be used by the server.
046: *
047: * @return the http response
048: */
049: HttpServletResponse getClientResponse();
050:
051: /**
052: * Return the parameter map decoded form the query string.
053: *
054: * @returns the query parameter map
055: */
056: ParameterMap getQueryParameterMap();
057:
058: /**
059: * Return the parameter map for the body if the request was a POST with the content type x-www-formurlencoded
060: * otherwise return null.
061: *
062: * @return the body parameter map
063: */
064: ParameterMap getBodyParameterMap();
065:
066: /**
067: * Return the normalized media type of the request or null if none has been provided by the client.
068: *
069: * @return the media type
070: */
071: String getMediaType();
072:
073: /**
074: * Return the url context of this request.
075: *
076: * @return the url context
077: */
078: URLContext getURLContext();
079:
080: /**
081: * Return the value of the portal request path for this request.
082: *
083: * @return the portal request path
084: */
085: String getPortalRequestPath();
086:
087: /**
088: * Return the value of the portal context path for this request.
089: *
090: * @return the portal context path
091: */
092: String getPortalContextPath();
093:
094: /**
095: * Return the portal host value for this request.
096: *
097: * @return the portal host
098: */
099: String getPortalHost();
100:
101: /**
102: * Renders an URL.
103: *
104: * @param url the url structure
105: * @param context the url context
106: * @param format the url format
107: * @return the encoded url
108: */
109: String renderURL(ServerURL url, URLContext context, URLFormat format);
110: }
|