1 martin 1.75 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.76 //
|
3 martin 1.75 // 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.76 //
|
10 martin 1.75 // 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.76 //
|
17 martin 1.75 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.76 //
|
20 martin 1.75 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.76 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.75 // 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.76 //
|
28 martin 1.75 //////////////////////////////////////////////////////////////////////////
|
29 mday 1.40 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32
33 #include <Pegasus/Common/Constants.h>
|
34 kumpf 1.62 #include <Pegasus/Common/MessageQueue.h>
35 #include "CIMOMHandleRep.h"
36 #include "InternalCIMOMHandleRep.h"
37 #include "ClientCIMOMHandleRep.h"
|
38 mday 1.40
|
39 kumpf 1.62 #include "CIMOMHandle.h"
|
40 joyce.j 1.66
|
41 chuck 1.46
|
42 mday 1.40 PEGASUS_NAMESPACE_BEGIN
43
|
44 kumpf 1.72 CIMOMHandle::CIMOMHandle()
|
45 mday 1.40 {
|
46 venkat.puvvada 1.74 // The existence of a RequestDispatcher determines which Rep to use
47 MessageQueue* dispatcher =
48 MessageQueue::lookup(PEGASUS_QUEUENAME_OPREQDISPATCHER);
49 if (dispatcher != 0)
|
50 chuck 1.45 {
|
51 venkat.puvvada 1.74 // RequestDispatcher exists. We can use InternalCIMOMHandleRep
|
52 kumpf 1.62 _rep = new InternalCIMOMHandleRep();
|
53 chuck 1.45 }
54 else
55 {
|
56 venkat.puvvada 1.74 // No RequestDispatcher exists. We must use ClientCIMOMHandleRep
|
57 kumpf 1.62 _rep = new ClientCIMOMHandleRep();
58 }
59 }
|
60 mday 1.40
|
61 kumpf 1.62 CIMOMHandle::CIMOMHandle(const CIMOMHandle & handle)
|
62 mday 1.40 {
|
63 kumpf 1.68 Inc(this->_rep = handle._rep);
|
64 mday 1.40 }
65
|
66 kumpf 1.72 CIMOMHandle::~CIMOMHandle()
|
67 mday 1.40 {
|
68 kumpf 1.62 Dec(_rep);
|
69 mday 1.40 }
70
71 CIMOMHandle & CIMOMHandle::operator =(const CIMOMHandle & handle)
72 {
|
73 kumpf 1.62 if (this != &handle)
74 {
75 Dec(_rep);
76 Inc(_rep = handle._rep);
77 }
78 return *this;
|
79 mday 1.40 }
80
81
82 CIMClass CIMOMHandle::getClass(
|
83 kumpf 1.62 const OperationContext& context,
|
84 mday 1.40 const CIMNamespaceName& nameSpace,
85 const CIMName& className,
86 Boolean localOnly,
87 Boolean includeQualifiers,
88 Boolean includeClassOrigin,
89 const CIMPropertyList& propertyList)
90 {
|
91 kumpf 1.62 return _rep->getClass(
92 context,
|
93 mday 1.40 nameSpace,
94 className,
95 localOnly,
96 includeQualifiers,
97 includeClassOrigin,
|
98 kumpf 1.62 propertyList);
|
99 mday 1.40 }
100
101 Array<CIMClass> CIMOMHandle::enumerateClasses(
|
102 kumpf 1.62 const OperationContext& context,
|
103 mday 1.40 const CIMNamespaceName& nameSpace,
104 const CIMName& className,
105 Boolean deepInheritance,
106 Boolean localOnly,
107 Boolean includeQualifiers,
108 Boolean includeClassOrigin)
109 {
|
110 kumpf 1.62 return _rep->enumerateClasses(
111 context,
|
112 mday 1.40 nameSpace,
113 className,
114 deepInheritance,
115 localOnly,
116 includeQualifiers,
|
117 kumpf 1.62 includeClassOrigin);
|
118 mday 1.40 }
119
120 Array<CIMName> CIMOMHandle::enumerateClassNames(
|
121 kumpf 1.62 const OperationContext& context,
122 const CIMNamespaceName& nameSpace,
|
123 mday 1.40 const CIMName& className,
124 Boolean deepInheritance)
125 {
|
126 kumpf 1.62 return _rep->enumerateClassNames(
127 context,
|
128 mday 1.40 nameSpace,
129 className,
|
130 kumpf 1.62 deepInheritance);
|
131 mday 1.40 }
132
133 void CIMOMHandle::createClass(
|
134 kumpf 1.62 const OperationContext& context,
|
135 mday 1.40 const CIMNamespaceName& nameSpace,
136 const CIMClass& newClass)
137 {
|
138 kumpf 1.62 _rep->createClass(
139 context,
140 nameSpace,
141 newClass);
|
142 mday 1.40 }
143
144 void CIMOMHandle::modifyClass(
|
145 kumpf 1.62 const OperationContext& context,
146 const CIMNamespaceName& nameSpace,
|
147 mday 1.40 const CIMClass& modifiedClass)
148 {
|
149 kumpf 1.62 _rep->modifyClass(
150 context,
151 nameSpace,
152 modifiedClass);
|
153 mday 1.40 }
154
155 void CIMOMHandle::deleteClass(
|
156 kumpf 1.62 const OperationContext& context,
157 const CIMNamespaceName& nameSpace,
|
158 mday 1.40 const CIMName& className)
159 {
|
160 kumpf 1.62 _rep->deleteClass(
161 context,
162 nameSpace,
163 className);
|
164 mday 1.40 }
165
166 CIMInstance CIMOMHandle::getInstance(
|
167 kumpf 1.62 const OperationContext& context,
168 const CIMNamespaceName& nameSpace,
169 const CIMObjectPath& instanceName,
170 Boolean localOnly,
171 Boolean includeQualifiers,
172 Boolean includeClassOrigin,
173 const CIMPropertyList& propertyList)
|
174 mday 1.40 {
|
175 kumpf 1.62 return _rep->getInstance(
176 context,
177 nameSpace,
178 instanceName,
179 includeQualifiers,
180 includeClassOrigin,
|
181 thilo.boehm 1.79 propertyList).getInstance();
|
182 mday 1.40 }
183
184 Array<CIMInstance> CIMOMHandle::enumerateInstances(
|
185 kumpf 1.62 const OperationContext& context,
186 const CIMNamespaceName& nameSpace,
187 const CIMName& className,
188 Boolean deepInheritance,
189 Boolean localOnly,
190 Boolean includeQualifiers,
191 Boolean includeClassOrigin,
192 const CIMPropertyList& propertyList)
|
193 mday 1.40 {
|
194 kumpf 1.62 return _rep->enumerateInstances(
195 context,
196 nameSpace,
197 className,
198 deepInheritance,
199 includeQualifiers,
200 includeClassOrigin,
|
201 thilo.boehm 1.79 propertyList).getInstances();
|
202 mday 1.40 }
203
204 Array<CIMObjectPath> CIMOMHandle::enumerateInstanceNames(
|
205 kumpf 1.62 const OperationContext& context,
206 const CIMNamespaceName& nameSpace,
207 const CIMName& className)
|
208 mday 1.40 {
|
209 kumpf 1.62 return _rep->enumerateInstanceNames(
210 context,
211 nameSpace,
|
212 thilo.boehm 1.79 className).getInstanceNames();
|
213 mday 1.40 }
214
215 CIMObjectPath CIMOMHandle::createInstance(
|
216 kumpf 1.62 const OperationContext& context,
217 const CIMNamespaceName& nameSpace,
218 const CIMInstance& newInstance)
|
219 mday 1.40 {
|
220 kumpf 1.62 return _rep->createInstance(
221 context,
222 nameSpace,
223 newInstance);
|
224 mday 1.40 }
225
226 void CIMOMHandle::modifyInstance(
|
227 kumpf 1.62 const OperationContext& context,
228 const CIMNamespaceName& nameSpace,
229 const CIMInstance& modifiedInstance,
230 Boolean includeQualifiers,
231 const CIMPropertyList& propertyList)
|
232 mday 1.40 {
|
233 kumpf 1.62 _rep->modifyInstance(
234 context,
235 nameSpace,
236 modifiedInstance,
237 includeQualifiers,
238 propertyList);
|
239 mday 1.40 }
240
241 void CIMOMHandle::deleteInstance(
|
242 kumpf 1.62 const OperationContext& context,
243 const CIMNamespaceName& nameSpace,
244 const CIMObjectPath& instanceName)
|
245 mday 1.40 {
|
246 kumpf 1.62 _rep->deleteInstance(
247 context,
248 nameSpace,
249 instanceName);
|
250 mday 1.40 }
251
252 Array<CIMObject> CIMOMHandle::execQuery(
|
253 kumpf 1.62 const OperationContext& context,
254 const CIMNamespaceName& nameSpace,
255 const String& queryLanguage,
256 const String& query)
|
257 mday 1.40 {
|
258 kumpf 1.62 return _rep->execQuery(
259 context,
260 nameSpace,
261 queryLanguage,
|
262 thilo.boehm 1.79 query).getObjects();
|
263 mday 1.40 }
264
265 Array<CIMObject> CIMOMHandle::associators(
|
266 kumpf 1.62 const OperationContext& context,
267 const CIMNamespaceName& nameSpace,
|
268 mday 1.40 const CIMObjectPath& objectName,
269 const CIMName& assocClass,
270 const CIMName& resultClass,
271 const String& role,
272 const String& resultRole,
273 Boolean includeQualifiers,
274 Boolean includeClassOrigin,
275 const CIMPropertyList& propertyList)
276 {
|
277 kumpf 1.62 return _rep->associators(
278 context,
|
279 mday 1.40 nameSpace,
280 objectName,
281 assocClass,
282 resultClass,
283 role,
284 resultRole,
285 includeQualifiers,
286 includeClassOrigin,
|
287 thilo.boehm 1.79 propertyList).getObjects();
|
288 mday 1.40 }
289
290 Array<CIMObjectPath> CIMOMHandle::associatorNames(
|
291 kumpf 1.62 const OperationContext& context,
292 const CIMNamespaceName& nameSpace,
|
293 mday 1.40 const CIMObjectPath& objectName,
294 const CIMName& assocClass,
295 const CIMName& resultClass,
296 const String& role,
297 const String& resultRole)
298 {
|
299 kumpf 1.62 return _rep->associatorNames(
300 context,
301 nameSpace,
302 objectName,
303 assocClass,
304 resultClass,
305 role,
|
306 thilo.boehm 1.79 resultRole).getInstanceNames();
|
307 mday 1.40 }
308
309 Array<CIMObject> CIMOMHandle::references(
|
310 kumpf 1.62 const OperationContext& context,
311 const CIMNamespaceName& nameSpace,
312 const CIMObjectPath& objectName,
313 const CIMName& resultClass,
314 const String& role,
315 Boolean includeQualifiers,
316 Boolean includeClassOrigin,
317 const CIMPropertyList& propertyList)
|
318 mday 1.40 {
|
319 kumpf 1.62 return _rep->references(
320 context,
321 nameSpace,
322 objectName,
323 resultClass,
324 role,
325 includeQualifiers,
326 includeClassOrigin,
|
327 thilo.boehm 1.79 propertyList).getObjects();
|
328 mday 1.40 }
329
330 Array<CIMObjectPath> CIMOMHandle::referenceNames(
|
331 kumpf 1.62 const OperationContext& context,
332 const CIMNamespaceName& nameSpace,
333 const CIMObjectPath& objectName,
334 const CIMName& resultClass,
335 const String& role)
|
336 mday 1.40 {
|
337 kumpf 1.62 return _rep->referenceNames(
338 context,
339 nameSpace,
340 objectName,
341 resultClass,
|
342 thilo.boehm 1.79 role).getInstanceNames();
|
343 mday 1.40 }
344
345 CIMValue CIMOMHandle::getProperty(
|
346 kumpf 1.62 const OperationContext& context,
347 const CIMNamespaceName& nameSpace,
|
348 mday 1.40 const CIMObjectPath& instanceName,
349 const CIMName& propertyName)
350 {
|
351 kumpf 1.62 return _rep->getProperty(
352 context,
|
353 mday 1.40 nameSpace,
354 instanceName,
|
355 kumpf 1.62 propertyName);
|
356 mday 1.40 }
357
358 void CIMOMHandle::setProperty(
|
359 kumpf 1.62 const OperationContext& context,
360 const CIMNamespaceName& nameSpace,
361 const CIMObjectPath& instanceName,
362 const CIMName& propertyName,
363 const CIMValue& newValue)
|
364 mday 1.40 {
|
365 kumpf 1.62 _rep->setProperty(
366 context,
367 nameSpace,
368 instanceName,
369 propertyName,
370 newValue);
|
371 mday 1.40 }
372
373 CIMValue CIMOMHandle::invokeMethod(
|
374 kumpf 1.62 const OperationContext& context,
375 const CIMNamespaceName& nameSpace,
|
376 mday 1.40 const CIMObjectPath& instanceName,
377 const CIMName& methodName,
378 const Array<CIMParamValue>& inParameters,
379 Array<CIMParamValue>& outParameters)
380 {
|
381 kumpf 1.62 return _rep->invokeMethod(
382 context,
383 nameSpace,
384 instanceName,
385 methodName,
386 inParameters,
387 outParameters);
|
388 mday 1.40 }
389
390
|
391 kumpf 1.49 void CIMOMHandle::disallowProviderUnload()
392 {
|
393 kumpf 1.62 _rep->disallowProviderUnload();
|
394 kumpf 1.49 }
395
396 void CIMOMHandle::allowProviderUnload()
397 {
|
398 kumpf 1.62 _rep->allowProviderUnload();
|
399 mday 1.40 }
400
|
401 kumpf 1.72 Boolean CIMOMHandle::unload_ok()
|
402 mday 1.40 {
|
403 kumpf 1.62 return _rep->unload_ok();
|
404 mday 1.40 }
|
405 chuck 1.61
406 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
|
407 kumpf 1.72 OperationContext CIMOMHandle::getResponseContext()
|
408 chuck 1.61 {
|
409 kumpf 1.62 return _rep->getResponseContext();
|
410 chuck 1.61 }
411 #endif
|
412 mday 1.40
413 PEGASUS_NAMESPACE_END
|