CPPSERV


Home Projects Jobs Clientele Contact
CPPSERV Documentation Download TODO Mailing lists Bug tracker News RSS Feed Browse source

HttpServletRequest.h

Go to the documentation of this file.
00001 /*
00002  * ====================================================================
00003  *
00004  * The Apache Software License, Version 1.1
00005  *
00006  * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
00007  * reserved.
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted provided that the following conditions
00011  * are met:
00012  *
00013  * 1. Redistributions of source code must retain the above copyright
00014  *    notice, this list of conditions and the following disclaimer.
00015  *
00016  * 2. Redistributions in binary form must reproduce the above copyright
00017  *    notice, this list of conditions and the following disclaimer in
00018  *    the documentation and/or other materials provided with the
00019  *    distribution.
00020  *
00021  * 3. The end-user documentation included with the redistribution, if
00022  *    any, must include the following acknowlegement:
00023  *       "This product includes software developed by the
00024  *        Apache Software Foundation (http://www.apache.org/)."
00025  *    Alternately, this acknowlegement may appear in the software itself,
00026  *    if and wherever such third-party acknowlegements normally appear.
00027  *
00028  * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
00029  *    Foundation" must not be used to endorse or promote products derived
00030  *    from this software without prior written permission. For written
00031  *    permission, please contact apache@apache.org.
00032  *
00033  * 5. Products derived from this software may not be called "Apache"
00034  *    nor may "Apache" appear in their names without prior written
00035  *    permission of the Apache Group.
00036  *
00037  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00038  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00039  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00040  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00041  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00042  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00043  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00044  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00045  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00046  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00047  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00048  * SUCH DAMAGE.
00049  * ====================================================================
00050  *
00051  */
00052 
00053 #ifndef HTTP_SERVLET_REQUEST_H
00054 #define HTTP_SERVLET_REQUEST_H
00055 
00056 #include <memory>
00057 #include <string>
00058 #include <vector>
00059 #include "ServletRequest.h"
00060 #include "Cookie.h"
00061 #include "HttpSession.h"
00062 
00063 namespace servlet {
00064 
00065 class UploadedFile;
00066 
00083     class HttpServletRequest: virtual public ServletRequest {
00084     public:
00085     typedef std::map<std::string,Cookie*> cookielist_t;
00089         HttpServletRequest();
00090         virtual ~HttpServletRequest()
00091             {   }
00095         const std::string BASIC_AUTH;
00099         const std::string FORM_AUTH;
00103         const std::string CLIENT_CERT_AUTH;
00107         const std::string DIGEST_AUTH;
00108     
00128         virtual std::string  getAuthType() const =0;
00129     
00130     
00131     
00132     
00145         virtual std::auto_ptr< cookielist_t > getCookies() const =0;
00146     
00147     
00148     
00149     
00184         virtual long  getDateHeader(const std::string& name) const =0;
00185     
00186     
00187     
00188     
00209         virtual std::string  getHeader(const std::string& name) const =0;
00210     
00211     
00212     
00213     
00241         virtual std::auto_ptr< std::vector<std::string> > getHeaders(const std::string& name) const =0;
00242     
00243     
00244     
00245     
00246     
00267         virtual std::auto_ptr< std::vector<std::string> > getHeaderNames() const =0;
00268     
00269     
00270     
00271     
00294         virtual int  getIntHeader(const std::string& name) const =0;
00295     
00296     
00297     
00298     
00311         virtual std::string  getMethod() const =0;
00312     
00313     
00314     
00315     
00339         virtual std::string  getPathInfo() const =0;
00340     
00341     
00342     
00343     
00365         virtual std::string  getPathTranslated() const =0;
00366     
00367     
00368     
00369     
00385         virtual std::string  getContextPath() const =0;
00386     
00387     
00388     
00389     
00403         virtual std::string  getQueryString() const =0;
00404     
00405     
00406     
00407     
00422         virtual std::string  getRemoteUser() const =0;
00423     
00424     
00425     
00426     
00443         virtual bool isUserInRole(const std::string& role) const =0;
00444     
00445     
00446     
00447     /* NOTE: I don't understand this
00448     //    **
00449          *
00450          * Returns a <code>java.security.Principal</code> object containing
00451          * the name of the current authenticated user. If the user has not been
00452          * authenticated, the method returns <code>null</code>.
00453          *
00454          * @return          a <code>java.security.Principal</code> containing
00455          *                  the name of the user making this request;
00456          *                  <code>null</code> if the user has not been
00457          *                  authenticated
00458          *
00459          /
00460             virtual const Principal& getUserPrincipal()=0;
00461     */
00462     
00463     
00464     
00465     
00482         virtual std::string  getRequestedSessionId() const =0;
00483     
00484     
00485     
00486     
00515         virtual std::string  getRequestURI() const =0;
00516     
00535         virtual std::string  getRequestURL() const =0;
00536     
00537     
00559         virtual std::string  getServletPath() const =0;
00560     
00561     
00562     
00563     
00599         virtual HttpSession* getSession(bool create = true) =0;
00600     
00615         virtual bool  isRequestedSessionIdValid() const =0;
00616     
00617     
00618     
00619     
00632         virtual bool  isRequestedSessionIdFromCookie() const =0;
00633     
00634     
00635     
00636     
00650         virtual bool  isRequestedSessionIdFromURL() const =0;
00651 
00657     virtual UploadedFile* getUploadedFile(const std::string&) = 0;
00658     };
00659 
00660 }//namespace
00661 #endif/*HTTP_SERVLET_REQUEST_H*/

SourceForge.net Logo