Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

xmltooling::HTTPResponse Class Reference

Interface to HTTP response. More...

#include <xmltooling/io/HTTPResponse.h>

Inheritance diagram for xmltooling::HTTPResponse:

xmltooling::GenericResponse List of all members.

Public Types

enum  status_t {
  XMLTOOLING_HTTP_STATUS_OK = 200, XMLTOOLING_HTTP_STATUS_MOVED = 302, XMLTOOLING_HTTP_STATUS_UNAUTHORIZED = 401, XMLTOOLING_HTTP_STATUS_FORBIDDEN = 403,
  XMLTOOLING_HTTP_STATUS_NOTFOUND = 404, XMLTOOLING_HTTP_STATUS_ERROR = 500
}
 Some common HTTP status codes.

Public Member Functions

void setContentType (const char *type)
 Sets or clears the MIME type of the response.
virtual void setResponseHeader (const char *name, const char *value)=0
 Sets or clears a response header.
virtual void setCookie (const char *name, const char *value)
 Sets a client cookie.
virtual long sendRedirect (const char *url)=0
 Redirect the client to the specified URL and complete the response.
long sendError (std::istream &inputStream)
 Sends an "error" response to the client along with a transport-specific error indication.
long sendResponse (std::istream &inputStream)
 Sends a completed response to the client along with a transport-specific "OK" indication.
virtual long sendResponse (std::istream &inputStream)=0
 Sends a completed response to the client along with a transport-specific "OK" indication.
virtual long sendResponse (std::istream &inputStream, long status)=0
 Sends a completed response to the client.

Detailed Description

Interface to HTTP response.

To supply information to the surrounding web server environment, a shim must be supplied in the form of this interface to adapt the library to different proprietary server APIs.

This interface need not be threadsafe.


Member Function Documentation

long xmltooling::HTTPResponse::sendError (  std::istream &  inputStream  )  [inline, virtual]
 

Sends an "error" response to the client along with a transport-specific error indication.

Parameters:
inputStream reference to source of response data
Returns:
a result code to return from the calling MessageEncoder

Implements xmltooling::GenericResponse.

virtual long xmltooling::HTTPResponse::sendRedirect (  const char *  url  )  [pure virtual]
 

Redirect the client to the specified URL and complete the response.

Any headers previously set will be sent ahead of the redirect.

Parameters:
url location to redirect client
Returns:
a result code to return from the calling MessageEncoder

virtual long xmltooling::GenericResponse::sendResponse (  std::istream &  inputStream,
long  status
) 
 

Sends a completed response to the client.

Parameters:
inputStream reference to source of response data
status transport-specific status to return
Returns:
a result code to return from the calling MessageEncoder

virtual long xmltooling::GenericResponse::sendResponse (  std::istream &  inputStream  ) 
 

Sends a completed response to the client along with a transport-specific "OK" indication.

Used for "normal" responses.

Parameters:
inputStream reference to source of response data
Returns:
a result code to return from the calling MessageEncoder

long xmltooling::HTTPResponse::sendResponse (  std::istream &  inputStream  )  [inline, virtual]
 

Sends a completed response to the client along with a transport-specific "OK" indication.

Used for "normal" responses.

Parameters:
inputStream reference to source of response data
Returns:
a result code to return from the calling MessageEncoder

Implements xmltooling::GenericResponse.

void xmltooling::HTTPResponse::setContentType (  const char *  type  )  [inline, virtual]
 

Sets or clears the MIME type of the response.

Parameters:
type the MIME type, or NULL to clear

Implements xmltooling::GenericResponse.

virtual void xmltooling::HTTPResponse::setCookie (  const char *  name,
const char *  value
)  [inline, virtual]
 

Sets a client cookie.

Parameters:
name cookie name
value value to set, or NULL to clear

virtual void xmltooling::HTTPResponse::setResponseHeader (  const char *  name,
const char *  value
)  [pure virtual]
 

Sets or clears a response header.

Parameters:
name header name
value value to set, or NULL to clear


The documentation for this class was generated from the following file:
Generated on Wed Jun 17 16:50:44 2009 for xmltooling by  doxygen 1.3.9.1