CPPSERV


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

HttpServletResponse.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 
00054 #ifndef HTTP_SERVLET_RESPONSE_H
00055 #define HTTP_SERVLET_RESPONSE_H
00056 
00057 #include <string>
00058 #include <servlet/ServletResponse.h>
00059 #include <servlet/Cookie.h>
00060 
00061 namespace servlet {
00062 
00081     class HttpServletResponse: virtual public ServletResponse {
00082     public:
00086         HttpServletResponse();
00087         virtual ~HttpServletResponse() { }
00088         
00096         virtual void  addCookie(const Cookie& cookie)=0;
00097     
00107         virtual bool  containsHeader(const std::string& name) const =0;
00108     
00126         virtual std::string  encodeURL(const std::string& url)=0;
00127     
00150         virtual std::string  encodeRedirectURL(const std::string& url)=0;
00151     
00173         virtual void  sendError(int sc, const std::string& msg)=0;
00174     
00188         virtual void  sendError(int sc)=0;
00189     
00209         virtual void  sendRedirect(const std::string& location)=0;
00210     
00226         virtual void  setDateHeader(const std::string& name, long date)=0;
00227     
00240         virtual void  addDateHeader(const std::string& name, long date)=0;
00241     
00258         virtual void  setHeader(const std::string& name, const std::string& value)=0;
00259     
00272         virtual void  addHeader(const std::string& name, const std::string& value)=0;
00273     
00287         virtual void  setIntHeader(const std::string& name, int value)=0;
00288     
00299         virtual void  addIntHeader(const std::string& name, int value)=0;
00300     
00301     
00302     
00317         virtual void  setStatus(int sc)=0;
00318     
00319     
00323         static const int SC_CONTINUE = 100;
00324     
00325     
00330         static const int SC_SWITCHING_PROTOCOLS = 101;
00331     
00335         static const int SC_OK = 200;
00336     
00341         static const int SC_CREATED = 201;
00342     
00347         static const int SC_ACCEPTED = 202;
00348     
00353         static const int SC_NON_AUTHORITATIVE_INFORMATION = 203;
00354     
00359         static const int SC_NO_CONTENT = 204;
00360     
00365         static const int SC_RESET_CONTENT = 205;
00366     
00371         static const int SC_PARTIAL_CONTENT = 206;
00372     
00378         static const int SC_MULTIPLE_CHOICES = 300;
00379     
00385         static const int SC_MOVED_PERMANENTLY = 301;
00386     
00395         static const int SC_MOVED_TEMPORARILY = 302;
00396     
00404         static const int SC_FOUND = 302;
00405     
00410         static const int SC_SEE_OTHER = 303;
00411     
00416         static const int SC_NOT_MODIFIED = 304;
00417     
00423         static const int SC_USE_PROXY = 305;
00424     
00431         static const int SC_TEMPORARY_REDIRECT = 307;
00432     
00437         static const int SC_BAD_REQUEST = 400;
00438     
00443         static const int SC_UNAUTHORIZED = 401;
00444     
00448         static const int SC_PAYMENT_REQUIRED = 402;
00449     
00454         static const int SC_FORBIDDEN = 403;
00455     
00460         static const int SC_NOT_FOUND = 404;
00461     
00467         static const int SC_METHOD_NOT_ALLOWED = 405;
00468     
00475         static const int SC_NOT_ACCEPTABLE = 406;
00476     
00481         static const int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
00482     
00487         static const int SC_REQUEST_TIMEOUT = 408;
00488     
00494         static const int SC_CONFLICT = 409;
00495     
00501         static const int SC_GONE = 410;
00502     
00507         static const int SC_LENGTH_REQUIRED = 411;
00508     
00514         static const int SC_PRECONDITION_FAILED = 412;
00515     
00521         static const int SC_REQUEST_ENTITY_TOO_LARGE = 413;
00522     
00528         int SC_REQUEST_URI_TOO_LONG;
00529     
00535         static const int SC_UNSUPPORTED_MEDIA_TYPE = 415;
00536     
00541         static const int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
00542     
00547         static const int SC_EXPECTATION_FAILED = 417;
00548     
00553         static const int SC_INTERNAL_SERVER_ERROR = 500;
00554     
00559         static const int SC_NOT_IMPLEMENTED = 501;
00560     
00566         static const int SC_BAD_GATEWAY = 502;
00567     
00572         static const int SC_SERVICE_UNAVAILABLE = 503;
00573     
00579         static const int SC_GATEWAY_TIMEOUT = 504;
00580     
00586         static const int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
00587     };
00588 }//namespace
00589 #endif/*HTTP_SERVLET_RESPONSE_H*/

SourceForge.net Logo