1 martin 1.4 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.5 //
|
3 martin 1.4 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.5 //
|
10 martin 1.4 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.5 //
|
17 martin 1.4 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.5 //
|
20 martin 1.4 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.5 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.4 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.5 //
|
28 martin 1.4 //////////////////////////////////////////////////////////////////////////
|
29 kumpf 1.2 //
30 //%////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_WsmRequestDecoder_h
33 #define Pegasus_WsmRequestDecoder_h
34
35 #include <Pegasus/Common/Config.h>
|
36 sahana.prabhakar 1.6 #include <Pegasus/Common/MessageQueue.h>
|
37 kumpf 1.2 #include <Pegasus/Common/HTTPMessage.h>
38 #include <Pegasus/Common/AcceptLanguageList.h>
39 #include <Pegasus/Common/ContentLanguageList.h>
40 #include <Pegasus/WsmServer/WsmRequest.h>
41
42 PEGASUS_NAMESPACE_BEGIN
43
44 class WsmReader;
45 class WsmProcessor;
46
47 /** This class decodes WS-Man operation requests and passes them down-stream.
48 */
|
49 sahana.prabhakar 1.6 class WsmRequestDecoder : public MessageQueue
|
50 kumpf 1.2 {
51 public:
52
53 WsmRequestDecoder(WsmProcessor* wsmProcessor);
54
55 ~WsmRequestDecoder();
56
57 void sendResponse(
58 Uint32 queueId,
59 Buffer& message,
60 Boolean httpCloseConnect = false);
61
62 void sendHttpError(
63 Uint32 queueId,
64 const String& status,
65 const String& cimError = String::EMPTY,
66 const String& messageBody = String::EMPTY,
67 Boolean httpCloseConnect = false);
68
69 virtual void handleEnqueue(Message *);
70
71 kumpf 1.2 virtual void handleEnqueue();
72
73 void handleHTTPMessage(HTTPMessage* httpMessage);
74
75 void handleWsmMessage(
76 Uint32 queueId,
77 HttpMethod httpMethod,
78 char* content,
79 Uint32 contentLength,
80 String& soapAction,
81 const String& authType,
82 const String& userName,
83 const String& ipAddress,
84 const AcceptLanguageList& httpAcceptLanguages,
85 const ContentLanguageList& httpContentLanguages,
|
86 mike 1.7 Boolean httpCloseConnect,
87 Boolean omitXMLProcessingInstruction);
|
88 kumpf 1.2
89 // Sets the flag to indicate whether or not the CIMServer is shutting down.
90 void setServerTerminating(Boolean flag) { _serverTerminating = flag; }
91
|
92 mike 1.7 WsmRequest* _decodeWSInvoke(
93 WsmReader& wsmReader,
94 const String& messageId,
95 const WsmEndpointReference& epr,
96 const String& className,
97 const String& methodName);
98
|
99 rohini.deshpande 1.8 void getFilterOrHandlerEPR(
100 WsmEndpointReference& instanceEPR,
101 const String address,
102 const String instanceName,
103 const String className);
104
|
105 kumpf 1.2 private:
106
107 void _checkRequiredHeader(
108 const char* headerName,
109 Boolean headerSpecified);
110
|
111 kumpf 1.3 void _checkNoSelectorsEPR(const WsmEndpointReference& epr);
112
113 WxfGetRequest* _decodeWSTransferGet(
114 WsmReader& wsmReader,
115 const String& messageId,
116 const WsmEndpointReference& epr);
117
118 WxfPutRequest* _decodeWSTransferPut(
|
119 kumpf 1.2 WsmReader& wsmReader,
120 const String& messageId,
121 const WsmEndpointReference& epr);
122
|
123 kumpf 1.3 WxfCreateRequest* _decodeWSTransferCreate(
|
124 kumpf 1.2 WsmReader& wsmReader,
125 const String& messageId,
126 const WsmEndpointReference& epr);
127
|
128 kumpf 1.3 WxfDeleteRequest* _decodeWSTransferDelete(
|
129 kumpf 1.2 WsmReader& wsmReader,
130 const String& messageId,
131 const WsmEndpointReference& epr);
132
|
133 kumpf 1.3 WsenEnumerateRequest* _decodeWSEnumerationEnumerate(
134 WsmReader& wsmReader,
135 const String& messageId,
136 const WsmEndpointReference& epr,
137 Boolean requestItemCount);
138
139 WsenPullRequest* _decodeWSEnumerationPull(
140 WsmReader& wsmReader,
141 const String& messageId,
142 const WsmEndpointReference& epr,
143 Boolean requestItemCount);
144
145 WsenReleaseRequest* _decodeWSEnumerationRelease(
|
146 kumpf 1.2 WsmReader& wsmReader,
147 const String& messageId,
148 const WsmEndpointReference& epr);
149
|
150 rohini.deshpande 1.8 WsmRequest* _decodeWSSubscriptionRequest(
151 WsmReader& wsmReader,
152 const String& messageId,
153 WsmEndpointReference& epr,
154 AutoPtr<WsmRequest> &createHandlerRequest,
155 AutoPtr<WsmRequest> &createSubRequest,
156 Boolean &createFilter);
157
158 WsmRequest* _decodeWSUnsubscribeRequest(
159 WsmReader& wsmReader,
160 const String& messageId,
161 WsmEndpointReference& epr,
162 const String& identifier,
163 Boolean & deleteFilter,
164 AutoPtr<WsmRequest> &deleteFilterRequest,
165 AutoPtr<WsmRequest> &deleteHandlerRequest);
166
|
167 mike 1.7 bool _isIdentifyRequest(WsmReader& wsmReader);
168
169 void _sendIdentifyResponse(Uint32 queueId);
170
|
171 rohini.deshpande 1.8 void _copyRequestProperties(
172 WsmRequest *request,
173 const WsmRequest *originalRequest);
|
174 kumpf 1.2 // The queue to which to forward the decoded WsmRequests.
175 WsmProcessor* _wsmProcessor;
176
177 // Flag to indicate whether or not the CIMServer is shutting down.
178 Boolean _serverTerminating;
179 };
180
181 PEGASUS_NAMESPACE_END
182
183 #endif /* Pegasus_WsmRequestDecoder_h */
|