1 karl 1.63 //%2004////////////////////////////////////////////////////////////////////////
|
2 mday 1.40 //
|
3 karl 1.63 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.53 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.63 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 mday 1.40 //
10 // Permission is hereby granted, free of charge, to any person obtaining a copy
11 // of this software and associated documentation files (the "Software"), to
12 // deal in the Software without restriction, including without limitation the
13 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14 // sell copies of the Software, and to permit persons to whom the Software is
15 // furnished to do so, subject to the following conditions:
|
16 karl 1.53 //
|
17 mday 1.40 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
18 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
19 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
20 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 //
26 //==============================================================================
27 //
|
28 kumpf 1.62 // Author: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
29 mday 1.40 //
|
30 kumpf 1.62 // Modified By:
|
31 mday 1.40 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34
35 #include <Pegasus/Common/Constants.h>
|
36 kumpf 1.62 #include <Pegasus/Common/MessageQueue.h>
37 #include "CIMOMHandleRep.h"
38 #include "InternalCIMOMHandleRep.h"
39 #include "ClientCIMOMHandleRep.h"
|
40 mday 1.40
|
41 kumpf 1.62 #include "CIMOMHandle.h"
|
42 chuck 1.46
|
43 mday 1.40 PEGASUS_NAMESPACE_BEGIN
44
|
45 kumpf 1.62 CIMOMHandle::CIMOMHandle(void)
|
46 mday 1.40 {
|
47 kumpf 1.62 // The existence of a BinaryMessageHandler determines which Rep to use
48 MessageQueue* bmh = MessageQueue::lookup(PEGASUS_QUEUENAME_BINARY_HANDLER);
49 if (bmh != 0)
|
50 chuck 1.45 {
|
51 kumpf 1.62 // A BinaryMessageHandler exists. We can use InternalCIMOMHandleRep
52 _rep = new InternalCIMOMHandleRep();
|
53 chuck 1.45 }
54 else
55 {
|
56 kumpf 1.62 // No BinaryMessageHandler exists. We must use ClientCIMOMHandleRep
57 _rep = new ClientCIMOMHandleRep();
58 }
59 }
|
60 mday 1.40
|
61 chuck 1.57 #ifdef PEGASUS_OS_OS400
|
62 kumpf 1.62 CIMOMHandle::CIMOMHandle(Uint32 os400UserStateKey)
63 {
64 // The existence of a BinaryMessageHandler determines which Rep to use
65 MessageQueue* bmh = MessageQueue::lookup(PEGASUS_QUEUENAME_BINARY_HANDLER);
66 if (bmh != 0)
|
67 mday 1.40 {
|
68 kumpf 1.62 // A BinaryMessageHandler exists. We can use InternalCIMOMHandleRep
69 _rep = new InternalCIMOMHandleRep(os400UserStateKey);
|
70 mday 1.40 }
|
71 kumpf 1.62 else
|
72 mday 1.40 {
|
73 kumpf 1.62 // No BinaryMessageHandler exists. We must use ClientCIMOMHandleRep
74 _rep = new ClientCIMOMHandleRep();
|
75 mday 1.40 }
|
76 chuck 1.57 }
77
78 void CIMOMHandle::setOS400ProfileHandle(const char * profileHandle)
79 {
|
80 kumpf 1.62 _rep->setOS400ProfileHandle(profileHandle);
|
81 chuck 1.56 }
82 #endif
83
|
84 kumpf 1.62 CIMOMHandle::CIMOMHandle(const CIMOMHandle & handle)
|
85 mday 1.40 {
|
86 kumpf 1.62 if (this != &handle)
87 {
88 Inc(this->_rep = handle._rep);
89 }
|
90 mday 1.40 }
91
92 CIMOMHandle::~CIMOMHandle(void)
93 {
|
94 kumpf 1.62 Dec(_rep);
|
95 mday 1.40 }
96
97 CIMOMHandle & CIMOMHandle::operator =(const CIMOMHandle & handle)
98 {
|
99 kumpf 1.62 if (this != &handle)
100 {
101 Dec(_rep);
102 Inc(_rep = handle._rep);
103 }
104 return *this;
|
105 mday 1.40 }
106
107
108 CIMClass CIMOMHandle::getClass(
|
109 kumpf 1.62 const OperationContext& context,
|
110 mday 1.40 const CIMNamespaceName& nameSpace,
111 const CIMName& className,
112 Boolean localOnly,
113 Boolean includeQualifiers,
114 Boolean includeClassOrigin,
115 const CIMPropertyList& propertyList)
116 {
|
117 kumpf 1.62 return _rep->getClass(
118 context,
|
119 mday 1.40 nameSpace,
120 className,
121 localOnly,
122 includeQualifiers,
123 includeClassOrigin,
|
124 kumpf 1.62 propertyList);
|
125 mday 1.40 }
126
127 Array<CIMClass> CIMOMHandle::enumerateClasses(
|
128 kumpf 1.62 const OperationContext& context,
|
129 mday 1.40 const CIMNamespaceName& nameSpace,
130 const CIMName& className,
131 Boolean deepInheritance,
132 Boolean localOnly,
133 Boolean includeQualifiers,
134 Boolean includeClassOrigin)
135 {
|
136 kumpf 1.62 return _rep->enumerateClasses(
137 context,
|
138 mday 1.40 nameSpace,
139 className,
140 deepInheritance,
141 localOnly,
142 includeQualifiers,
|
143 kumpf 1.62 includeClassOrigin);
|
144 mday 1.40 }
145
146 Array<CIMName> CIMOMHandle::enumerateClassNames(
|
147 kumpf 1.62 const OperationContext& context,
148 const CIMNamespaceName& nameSpace,
|
149 mday 1.40 const CIMName& className,
150 Boolean deepInheritance)
151 {
|
152 kumpf 1.62 return _rep->enumerateClassNames(
153 context,
|
154 mday 1.40 nameSpace,
155 className,
|
156 kumpf 1.62 deepInheritance);
|
157 mday 1.40 }
158
159 void CIMOMHandle::createClass(
|
160 kumpf 1.62 const OperationContext& context,
|
161 mday 1.40 const CIMNamespaceName& nameSpace,
162 const CIMClass& newClass)
163 {
|
164 kumpf 1.62 _rep->createClass(
165 context,
166 nameSpace,
167 newClass);
|
168 mday 1.40 }
169
170 void CIMOMHandle::modifyClass(
|
171 kumpf 1.62 const OperationContext& context,
172 const CIMNamespaceName& nameSpace,
|
173 mday 1.40 const CIMClass& modifiedClass)
174 {
|
175 kumpf 1.62 _rep->modifyClass(
176 context,
177 nameSpace,
178 modifiedClass);
|
179 mday 1.40 }
180
181 void CIMOMHandle::deleteClass(
|
182 kumpf 1.62 const OperationContext& context,
183 const CIMNamespaceName& nameSpace,
|
184 mday 1.40 const CIMName& className)
185 {
|
186 kumpf 1.62 _rep->deleteClass(
187 context,
188 nameSpace,
189 className);
|
190 mday 1.40 }
191
192 CIMInstance CIMOMHandle::getInstance(
|
193 kumpf 1.62 const OperationContext& context,
194 const CIMNamespaceName& nameSpace,
195 const CIMObjectPath& instanceName,
196 Boolean localOnly,
197 Boolean includeQualifiers,
198 Boolean includeClassOrigin,
199 const CIMPropertyList& propertyList)
|
200 mday 1.40 {
|
201 kumpf 1.62 return _rep->getInstance(
202 context,
203 nameSpace,
204 instanceName,
205 localOnly,
206 includeQualifiers,
207 includeClassOrigin,
208 propertyList);
|
209 mday 1.40 }
210
211 Array<CIMInstance> CIMOMHandle::enumerateInstances(
|
212 kumpf 1.62 const OperationContext& context,
213 const CIMNamespaceName& nameSpace,
214 const CIMName& className,
215 Boolean deepInheritance,
216 Boolean localOnly,
217 Boolean includeQualifiers,
218 Boolean includeClassOrigin,
219 const CIMPropertyList& propertyList)
|
220 mday 1.40 {
|
221 kumpf 1.62 return _rep->enumerateInstances(
222 context,
223 nameSpace,
224 className,
225 deepInheritance,
226 localOnly,
227 includeQualifiers,
228 includeClassOrigin,
229 propertyList);
|
230 mday 1.40 }
231
232 Array<CIMObjectPath> CIMOMHandle::enumerateInstanceNames(
|
233 kumpf 1.62 const OperationContext& context,
234 const CIMNamespaceName& nameSpace,
235 const CIMName& className)
|
236 mday 1.40 {
|
237 kumpf 1.62 return _rep->enumerateInstanceNames(
238 context,
239 nameSpace,
240 className);
|
241 mday 1.40 }
242
243 CIMObjectPath CIMOMHandle::createInstance(
|
244 kumpf 1.62 const OperationContext& context,
245 const CIMNamespaceName& nameSpace,
246 const CIMInstance& newInstance)
|
247 mday 1.40 {
|
248 kumpf 1.62 return _rep->createInstance(
249 context,
250 nameSpace,
251 newInstance);
|
252 mday 1.40 }
253
254 void CIMOMHandle::modifyInstance(
|
255 kumpf 1.62 const OperationContext& context,
256 const CIMNamespaceName& nameSpace,
257 const CIMInstance& modifiedInstance,
258 Boolean includeQualifiers,
259 const CIMPropertyList& propertyList)
|
260 mday 1.40 {
|
261 kumpf 1.62 _rep->modifyInstance(
262 context,
263 nameSpace,
264 modifiedInstance,
265 includeQualifiers,
266 propertyList);
|
267 mday 1.40 }
268
269 void CIMOMHandle::deleteInstance(
|
270 kumpf 1.62 const OperationContext& context,
271 const CIMNamespaceName& nameSpace,
272 const CIMObjectPath& instanceName)
|
273 mday 1.40 {
|
274 kumpf 1.62 _rep->deleteInstance(
275 context,
276 nameSpace,
277 instanceName);
|
278 mday 1.40 }
279
280 Array<CIMObject> CIMOMHandle::execQuery(
|
281 kumpf 1.62 const OperationContext& context,
282 const CIMNamespaceName& nameSpace,
283 const String& queryLanguage,
284 const String& query)
|
285 mday 1.40 {
|
286 kumpf 1.62 return _rep->execQuery(
287 context,
288 nameSpace,
289 queryLanguage,
290 query);
|
291 mday 1.40 }
292
293 Array<CIMObject> CIMOMHandle::associators(
|
294 kumpf 1.62 const OperationContext& context,
295 const CIMNamespaceName& nameSpace,
|
296 mday 1.40 const CIMObjectPath& objectName,
297 const CIMName& assocClass,
298 const CIMName& resultClass,
299 const String& role,
300 const String& resultRole,
301 Boolean includeQualifiers,
302 Boolean includeClassOrigin,
303 const CIMPropertyList& propertyList)
304 {
|
305 kumpf 1.62 return _rep->associators(
306 context,
|
307 mday 1.40 nameSpace,
308 objectName,
309 assocClass,
310 resultClass,
311 role,
312 resultRole,
313 includeQualifiers,
314 includeClassOrigin,
|
315 kumpf 1.62 propertyList);
|
316 mday 1.40 }
317
318 Array<CIMObjectPath> CIMOMHandle::associatorNames(
|
319 kumpf 1.62 const OperationContext& context,
320 const CIMNamespaceName& nameSpace,
|
321 mday 1.40 const CIMObjectPath& objectName,
322 const CIMName& assocClass,
323 const CIMName& resultClass,
324 const String& role,
325 const String& resultRole)
326 {
|
327 kumpf 1.62 return _rep->associatorNames(
328 context,
329 nameSpace,
330 objectName,
331 assocClass,
332 resultClass,
333 role,
334 resultRole);
|
335 mday 1.40 }
336
337 Array<CIMObject> CIMOMHandle::references(
|
338 kumpf 1.62 const OperationContext& context,
339 const CIMNamespaceName& nameSpace,
340 const CIMObjectPath& objectName,
341 const CIMName& resultClass,
342 const String& role,
343 Boolean includeQualifiers,
344 Boolean includeClassOrigin,
345 const CIMPropertyList& propertyList)
|
346 mday 1.40 {
|
347 kumpf 1.62 return _rep->references(
348 context,
349 nameSpace,
350 objectName,
351 resultClass,
352 role,
353 includeQualifiers,
354 includeClassOrigin,
355 propertyList);
|
356 mday 1.40 }
357
358 Array<CIMObjectPath> CIMOMHandle::referenceNames(
|
359 kumpf 1.62 const OperationContext& context,
360 const CIMNamespaceName& nameSpace,
361 const CIMObjectPath& objectName,
362 const CIMName& resultClass,
363 const String& role)
|
364 mday 1.40 {
|
365 kumpf 1.62 return _rep->referenceNames(
366 context,
367 nameSpace,
368 objectName,
369 resultClass,
370 role);
|
371 mday 1.40 }
372
373 CIMValue CIMOMHandle::getProperty(
|
374 kumpf 1.62 const OperationContext& context,
375 const CIMNamespaceName& nameSpace,
|
376 mday 1.40 const CIMObjectPath& instanceName,
377 const CIMName& propertyName)
378 {
|
379 kumpf 1.62 return _rep->getProperty(
380 context,
|
381 mday 1.40 nameSpace,
382 instanceName,
|
383 kumpf 1.62 propertyName);
|
384 mday 1.40 }
385
386 void CIMOMHandle::setProperty(
|
387 kumpf 1.62 const OperationContext& context,
388 const CIMNamespaceName& nameSpace,
389 const CIMObjectPath& instanceName,
390 const CIMName& propertyName,
391 const CIMValue& newValue)
|
392 mday 1.40 {
|
393 kumpf 1.62 _rep->setProperty(
394 context,
395 nameSpace,
396 instanceName,
397 propertyName,
398 newValue);
|
399 mday 1.40 }
400
401 CIMValue CIMOMHandle::invokeMethod(
|
402 kumpf 1.62 const OperationContext& context,
403 const CIMNamespaceName& nameSpace,
|
404 mday 1.40 const CIMObjectPath& instanceName,
405 const CIMName& methodName,
406 const Array<CIMParamValue>& inParameters,
407 Array<CIMParamValue>& outParameters)
408 {
|
409 kumpf 1.62 return _rep->invokeMethod(
410 context,
411 nameSpace,
412 instanceName,
413 methodName,
414 inParameters,
415 outParameters);
|
416 mday 1.40 }
417
418
|
419 kumpf 1.51 void CIMOMHandle::get_idle_timer(void *tv)
|
420 mday 1.40 {
|
421 kumpf 1.62 _rep->get_idle_timer(reinterpret_cast<struct timeval*>(tv));
|
422 mday 1.40 }
423
424 void CIMOMHandle::update_idle_timer(void)
425 {
|
426 kumpf 1.62 _rep->update_idle_timer();
|
427 mday 1.40 }
428
429 Boolean CIMOMHandle::pending_operation(void)
430 {
|
431 kumpf 1.62 return _rep->pending_operation();
|
432 kumpf 1.49 }
433
434 void CIMOMHandle::disallowProviderUnload()
435 {
|
436 kumpf 1.62 _rep->disallowProviderUnload();
|
437 kumpf 1.49 }
438
439 void CIMOMHandle::allowProviderUnload()
440 {
|
441 kumpf 1.62 _rep->allowProviderUnload();
|
442 mday 1.40 }
443
444 Boolean CIMOMHandle::unload_ok(void)
445 {
|
446 kumpf 1.62 return _rep->unload_ok();
|
447 mday 1.40 }
|
448 chuck 1.61
449 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
450 OperationContext CIMOMHandle::getResponseContext(void)
451 {
|
452 kumpf 1.62 return _rep->getResponseContext();
|
453 chuck 1.61 }
454 #endif
|
455 mday 1.40
456 PEGASUS_NAMESPACE_END
|