File: XKMSResultType.hpp

package info (click to toggle)
xml-security-c 1.5.1-3%2Bsqueeze3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,424 kB
  • ctags: 5,832
  • sloc: cpp: 45,357; sh: 8,270; makefile: 689
file content (220 lines) | stat: -rw-r--r-- 7,759 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*
 * Copyright 2004-2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * XSEC
 *
 * XKMSResultType := Interface for base schema of XKMS Request messages
 *
 * $Id: XKMSResultType.hpp 351364 2005-06-04 11:30:26Z blautenb $
 *
 */

#ifndef XKMSRESULTTYPE_INCLUDE
#define XKMSRESULTTYPE_INCLUDE

// XSEC Includes

#include <xsec/framework/XSECDefs.hpp>
#include <xsec/xkms/XKMSMessageAbstractType.hpp>

/**
 * @ingroup xkms
 */

/**
 * @brief Interface definition for the ResultType
 *
 * The \<ResultType\> is the base type on which Result messages
 * are built.  (The \<Result\> element is a direct implementation)
 *
 * The schema definition for ResultType is as follows :
 *
 * \verbatim
   <!-- ResultType -->
   <element name="Result" type="xkms:ResultType"/>
   <complexType name="ResultType">
      <complexContent>
         <extension base="xkms:MessageAbstractType">
            <sequence>
               <element ref="xkms:RequestSignatureValue" minOccurs="0"/>
            </sequence>
            <attribute name="ResultMajor" type="QName" use="required"/>
            <attribute name="ResultMinor" type="QName" use="optional"/>
            <attribute name="RequestId" type="NCName" use="optional"/>
         </extension>
      </complexContent>
   </complexType>
   <!-- /ResultType -->
\endverbatim
 */


class XKMSResultType : public XKMSMessageAbstractType {

public:

	/**
	 * \brief Definition of Major Result codes
	 */

	enum ResultMajor {
		NoneMajor=0,		/** No code - error! */
		Success,   			/** Final - The operation succeeded. */
		VersionMismatch, 	/** Final - The service does not support the protocol version specified in the request.*/
		Sender,				/** Final - An error occurred that was due to the message sent by the sender. */
		Receiver, 			/** Final - An error occurred at the receiver. */
		Represent, 			/** Not Final - The service has not acted on the request. In order for the request to be acted upon the request MUST be represented with the specified nonce in accordance with the two phase protocol */
		Pending				/** The request has been accepted for processing and the service will return the result asynchronously */
	};

	enum ResultMinor {
		NoneMinor=0,		/** No code - no code was returned */
		NoMatch,   	   	    /** No match was found for the search prototype provided.
							    Success 	The result code Success.NoMatch indicates that the service is authoritative for the search prototype specified and that the service positively asserts that no matches exist.
								Receiver 	The result code Receiver.NoMatch indicates that the service is not authoritative for the search prototype provided.*/
		TooManyResponses, 	/** The request resulted in the number of responses that exceeded either  the ResponseLimit value specified in the request or some other limit determined by the service. The service MAY either return a subset of the possible responses or none at all.
								Success 	The service has returned one or more responses that represent a subset of the possible responses.
								Receiver 	The service has returned no responses. */
		Incomplete, 		/** Success 	Only part of the information requested could be provided. */
		Failure, 	  		/** The service attempted to perform the request but the operation failed for unspecified reasons.
								Sender 	The reason for failure is attributed to the sender (e.g. the request failed schema validation).
								Receiver 	The reason for failure is attributed to the receiver (e.g. a database lookup failed).*/
		Refused, 	  		/** The operation was refused. The service did not attempt to perform the request.
								Sender 	The sender failed to provide sufficient information to authenticate or authorize the request (e.g. payment not supplied)
								Receiver 	The receiver is currently refusing certain requests for unspecified reasons. */
		NoAuthentication, 	/** Sender 	The operation was refused because the necessary authentication information was incorrect or missing.*/
		MessageNotSupported,/** Sender 	The receiver does not implement the specified operation. */
		UnknownResponseId, 	/** Sender 	The ResponseId for which pending status was requested is unknown to the service.*/
		RepresentRequired, 	/** Sender 	The responder requires that the sender offer the represent protocol option in order to process the request.*/
		NotSynchronous 		/** Receiver 	The receiver does not support synchronous processing of this type of request */
	};

	/** @name Constructors and Destructors */
	//@{

protected:

	XKMSResultType() {};

public:

	virtual ~XKMSResultType() {};

	/** @name Getter Interface Methods */
	//@{

	/**
	 * \brief Get the ResultMajor code for the message
	 *
	 * All result messages contain a Major Result code defining the overall
	 * status of the request performed by the client
	 *
	 * @returns The ResultMajor code
	 */

	virtual ResultMajor getResultMajor(void) const = 0;

	/**
	 * \brief Get the ResultMinor code for the message
	 *
	 * Messages may contain a minor result code that better defines the result
	 * returned in the ResultMajor code
	 *
	 * @returns The ResultMinor code
	 */

	virtual ResultMinor getResultMinor(void) const = 0;

	/**
	 * \brief Obtain the RequestId attribute
	 *
	 * The RequestId attribute matches the Id of the request message to which
	 * this response is related.
	 *
	 * @returns the RequestId string
	 */

	virtual const XMLCh * getRequestId(void) const = 0;

	/**
	 * \brief Obtain the value of the RequestSignatureValue element
	 *
	 * A request can have a ResponseMechanism of RequestSignatureValue.  When this
	 * is set, the service can place the text within the SignatureValue element into
	 * the Result.  This call allows a consumer of the result to find the value
	 *
	 * @returns The original signature that was on the request message
	 */

	virtual const XMLCh * getRequestSignatureValue(void) const = 0;

	//@}

	/** @name Setter interface methods */
	//@{

	/**
	 * \brief Set a new value for the ResultMajor of this response
	 *
	 * @param rmaj New value for ResultMajor for this messag
	 */

	virtual void setResultMajor(ResultMajor rmaj) = 0;

	/**
	 * \brief Set a new value for the ResultMinor of this response
	 *
	 * @param rmin New value for ResultMajor for this message
	 */

	virtual void setResultMinor(ResultMinor rmin) = 0;

	/**
	 * \brief Set the Request Id for the Message
	 *
	 * Allows a calling application to set a new request Id for the
	 * message
	 * 
	 * @param id The Id to set as the RequestId
	 */

	virtual void setRequestId(const XMLCh * id) = 0;

	/**
	 * \brief Set the value of the RequestSignatureValue element
	 *
	 * A request can have a ResponseMechanism of RequestSignatureValue.  When this
	 * is set, the service can place the text within the SignatureValue element into
	 * the Result.  This call allows a service to set this value in a response
	 *
	 * @param value The base64 encoded signature value of the original request
	 */

	virtual void setRequestSignatureValue(const XMLCh * value) = 0;

	//@}


private:

	// Unimplemented
	XKMSResultType(const XKMSResultType &);
	XKMSResultType & operator = (const XKMSResultType &);

};

#endif /* XKMSRESULTTYPE_INCLUDE */