- * Interface to caller-supplied shim for issuing an HTTP response.
- *
- * <p>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.
- *
- * <p>This interface need not be threadsafe.
- */
- class SAML_API HTTPResponse {
- MAKE_NONCOPYABLE(HTTPResponse);
- protected:
- HTTPResponse() {}
- public:
- virtual ~HTTPResponse() {}
-
- /**
- * Sets or clears a response header.
- *
- * @param name header name
- * @param value value to set, or NULL to clear
- */
- virtual void setHeader(const char* name, const char* value)=0;
-
- /**
- * Sets a client cookie.
- *
- * @param name cookie name
- * @param value value to set, or NULL to clear
- */
- virtual void setCookie(const char* name, const char* value)=0;
-
- /**
- * Redirect the client to the specified URL and complete the response.
- * Any headers previously set will be sent ahead of the redirect.
- *
- * @param url location to redirect client
- * @return a result code to return from the calling MessageEncoder
- */
- virtual long sendRedirect(const char* url)=0;
-
- /**
- * Sends a completed response to the client. Any headers previously set
- * will be sent ahead of the data.
- *
- * @param inputStream reference to source of response data
- * @param status HTTP status code to return
- * @param contentType Content-Type header to return
- * @return a result code to return from the calling MessageEncoder
- */
- virtual long sendResponse(std::istream& inputStream, int status = 200, const char* contentType = "text/html")=0;
- };
-
- /**