1 //%LICENSE////////////////////////////////////////////////////////////////
3 // 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
10 // 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:
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // 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.
28 //////////////////////////////////////////////////////////////////////////
30 //%////////////////////////////////////////////////////////////////////////////
32 #ifndef Pegasus_WsmRequestDecoder_h
33 #define Pegasus_WsmRequestDecoder_h
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/MessageQueue.h>
37 #include <Pegasus/Common/HTTPMessage.h>
38 #include <Pegasus/Common/AcceptLanguageList.h>
39 #include <Pegasus/Common/ContentLanguageList.h>
40 #include <Pegasus/WsmServer/WsmRequest.h>
42 PEGASUS_NAMESPACE_BEGIN
47 /** This class decodes WS-Man operation requests and passes them down-stream.
49 class WsmRequestDecoder : public MessageQueue
53 WsmRequestDecoder(WsmProcessor* wsmProcessor);
60 Boolean httpCloseConnect = false);
65 const String& cimError = String::EMPTY,
66 const String& messageBody = String::EMPTY,
67 Boolean httpCloseConnect = false);
69 virtual void handleEnqueue(Message *);
71 virtual void handleEnqueue();
73 void handleHTTPMessage(HTTPMessage* httpMessage);
75 void handleWsmMessage(
77 HttpMethod httpMethod,
81 const String& authType,
82 const String& userName,
83 const String& ipAddress,
84 const AcceptLanguageList& httpAcceptLanguages,
85 const ContentLanguageList& httpContentLanguages,
86 Boolean httpCloseConnect);
88 // Sets the flag to indicate whether or not the CIMServer is shutting down.
89 void setServerTerminating(Boolean flag) { _serverTerminating = flag; }
93 void _checkRequiredHeader(
94 const char* headerName,
95 Boolean headerSpecified);
97 void _checkNoSelectorsEPR(const WsmEndpointReference& epr);
99 WxfGetRequest* _decodeWSTransferGet(
100 WsmReader& wsmReader,
101 const String& messageId,
102 const WsmEndpointReference& epr);
104 WxfPutRequest* _decodeWSTransferPut(
105 WsmReader& wsmReader,
106 const String& messageId,
107 const WsmEndpointReference& epr);
109 WxfCreateRequest* _decodeWSTransferCreate(
110 WsmReader& wsmReader,
111 const String& messageId,
112 const WsmEndpointReference& epr);
114 WxfDeleteRequest* _decodeWSTransferDelete(
115 WsmReader& wsmReader,
116 const String& messageId,
117 const WsmEndpointReference& epr);
119 WsenEnumerateRequest* _decodeWSEnumerationEnumerate(
120 WsmReader& wsmReader,
121 const String& messageId,
122 const WsmEndpointReference& epr,
123 Boolean requestItemCount);
125 WsenPullRequest* _decodeWSEnumerationPull(
126 WsmReader& wsmReader,
127 const String& messageId,
128 const WsmEndpointReference& epr,
129 Boolean requestItemCount);
131 WsenReleaseRequest* _decodeWSEnumerationRelease(
132 WsmReader& wsmReader,
133 const String& messageId,
134 const WsmEndpointReference& epr);
136 // The queue to which to forward the decoded WsmRequests.
137 WsmProcessor* _wsmProcessor;
139 // Flag to indicate whether or not the CIMServer is shutting down.
140 Boolean _serverTerminating;
143 PEGASUS_NAMESPACE_END
145 #endif /* Pegasus_WsmRequestDecoder_h */