2 * Copyright 2001-2006 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file saml/binding/GenericResponse.h
20 * Interface to generic protocol responses that transport SAML messages.
23 #ifndef __saml_genres_h__
24 #define __saml_genres_h__
26 #include <saml/base.h>
32 * Interface to caller-supplied shim for accessing generic transport
35 * <p>This interface need not be threadsafe.
37 class SAML_API GenericResponse {
38 MAKE_NONCOPYABLE(GenericResponse);
42 virtual ~GenericResponse() {}
45 * Sets or clears the MIME type of the response.
47 * @param type the MIME type, or NULL to clear
49 virtual void setContentType(const char* type=NULL)=0;
52 * Sends a completed response to the client along with a
53 * transport-specific "OK" indication. Used for "normal" responses.
55 * @param inputStream reference to source of response data
56 * @return a result code to return from the calling MessageEncoder
58 virtual long sendResponse(std::istream& inputStream)=0;
61 * Sends an "error" response to the client along with a
62 * transport-specific error indication.
64 * @param inputStream reference to source of response data
65 * @return a result code to return from the calling MessageEncoder
67 virtual long sendError(std::istream& inputStream)=0;
70 * Sends a completed response to the client.
72 * @param inputStream reference to source of response data
73 * @param status transport-specific status to return
74 * @return a result code to return from the calling MessageEncoder
76 virtual long sendResponse(std::istream& inputStream, long status)=0;
80 #endif /* __saml_genres_h__ */