1 martin 1.24 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.25 //
|
3 martin 1.24 // 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.25 //
|
10 martin 1.24 // 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.25 //
|
17 martin 1.24 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.25 //
|
20 martin 1.24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.24 // 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.25 //
|
28 martin 1.24 //////////////////////////////////////////////////////////////////////////
|
29 kumpf 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
|
32 marek 1.18 #include <Pegasus/Common/Constants.h>
|
33 kumpf 1.1 #include <Pegasus/Common/Thread.h>
34 #include <Pegasus/Common/Tracer.h>
|
35 thilo.boehm 1.28 #include <Pegasus/ProviderManager2/AutoPThreadSecurity.h>
|
36 kumpf 1.1
37 #include "ClientCIMOMHandleRep.h"
38
39 PEGASUS_NAMESPACE_BEGIN
40
41 static void deleteContentLanguage(void* data)
42 {
|
43 kumpf 1.9 ContentLanguageList* cl = static_cast<ContentLanguageList*>(data);
44 delete cl;
|
45 kumpf 1.1 }
46
47 /**
48 This class is used to prevent concurrent access to a non-reentrant
49 CIMClient object.
50 */
51 class ClientCIMOMHandleAccessController
52 {
53 public:
54 ClientCIMOMHandleAccessController(Mutex& lock)
55 : _lock(lock)
56 {
57 try
58 {
|
59 kumpf 1.21 // assume default client timeout
60 if (!_lock.timed_lock(PEGASUS_DEFAULT_CLIENT_TIMEOUT_MILLISECONDS))
61 {
62 throw CIMException(CIM_ERR_ACCESS_DENIED, MessageLoaderParms(
63 "Provider.CIMOMHandle.CIMOMHANDLE_TIMEOUT",
64 "Timeout waiting for CIMOMHandle"));
65 }
|
66 kumpf 1.1 }
67 catch (Exception& e)
68 {
|
69 thilo.boehm 1.22 PEG_TRACE((TRC_CIMOM_HANDLE, Tracer::LEVEL2,
70 "Unexpected Exception: %s",
71 (const char*)e.getMessage().getCString()));
|
72 kumpf 1.1 throw;
73 }
74 catch (...)
75 {
|
76 marek 1.14 PEG_TRACE_CSTRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
|
77 kumpf 1.1 "Unexpected exception");
78 throw;
79 }
80 }
81
82 ~ClientCIMOMHandleAccessController()
83 {
84 // Must not throw an exception from a destructor
85 try
86 {
87 _lock.unlock();
88 }
89 catch (Exception& e)
90 {
|
91 thilo.boehm 1.22 PEG_TRACE((TRC_CIMOM_HANDLE, Tracer::LEVEL2,
92 "Ignoring Exception: %s",
93 (const char*)e.getMessage().getCString()));
|
94 kumpf 1.1 }
95 catch (...)
96 {
|
97 marek 1.14 PEG_TRACE_CSTRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
|
98 kumpf 1.1 "Ignoring unknown exception");
99 }
100 }
101
102 private:
103 // Unimplemented constructors and assignment operator
104 ClientCIMOMHandleAccessController();
105 ClientCIMOMHandleAccessController(const ClientCIMOMHandleAccessController&);
106 ClientCIMOMHandleAccessController& operator=(
107 const ClientCIMOMHandleAccessController&);
108
109 Mutex& _lock;
110 };
111
112
113 /**
114 The ClientCIMOMHandleSetup class encapsulates the logic to set up the
115 CIMClient object state based on a specified OperationContext. The
116 original CIMClient state is restored by the destructor. Only one
117 ClientCIMOMHandleSetup object may operate on a given CIMClient object
118 at a time. Use of the ClientCIMOMHandleAccessController class is
119 kumpf 1.1 recommend to control access to CIMClient objects.
120 */
121 class ClientCIMOMHandleSetup
122 {
123 public:
124 ClientCIMOMHandleSetup(
|
125 thilo.boehm 1.28 CIMClientRep*& client,
|
126 kumpf 1.1 const OperationContext& context)
127 {
128 //
129 // Initialize the CIMClient object if necessary
130 //
131 if (client == 0)
132 {
|
133 marek 1.20 PEG_TRACE_CSTRING(TRC_CIMOM_HANDLE, Tracer::LEVEL3,
|
134 kumpf 1.1 "Creating CIMClient connection");
|
135 thilo.boehm 1.28 client = new CIMClientRep();
|
136 dmitry.mikulin 1.19
137 //
138 // If connection fails, we need to make sure that subsequent
|
139 kumpf 1.26 // calls will try to connect again.
|
140 dmitry.mikulin 1.19 //
141 try
142 {
|
143 marek 1.29 client->connectLocalBinary();
|
144 dmitry.mikulin 1.19 }
145 catch(...)
146 {
147 delete client;
148 client = 0;
149 throw;
150 }
|
151 kumpf 1.1 }
152 _client = client;
153
154 //
155 // If the caller specified a timeout value in the OperationContext,
156 // set it in the CIMClient object.
157 //
158 _origTimeout = client->getTimeout();
|
159 kumpf 1.13 if (context.contains(TimeoutContainer::NAME))
|
160 kumpf 1.1 {
161 TimeoutContainer t_cntr = (TimeoutContainer)
162 context.get(TimeoutContainer::NAME);
163 client->setTimeout(t_cntr.getTimeOut());
164 }
165
166 //
167 // If the caller specified an Accept-Language in the
168 // OperationContext, set it in the CIMClient object.
169 //
170 _origAcceptLanguages = client->getRequestAcceptLanguages();
|
171 kumpf 1.13 if (context.contains(AcceptLanguageListContainer::NAME))
|
172 kumpf 1.1 {
173 AcceptLanguageListContainer al_cntr = (AcceptLanguageListContainer)
174 context.get(AcceptLanguageListContainer::NAME);
175 _client->setRequestAcceptLanguages(al_cntr.getLanguages());
176 }
|
177 a.dunfey 1.10 else
|
178 kumpf 1.1 {
179 // No AcceptLanguageListContainer in OperationContext; try
|
180 kumpf 1.7 // getting the AcceptLanguageList from the current thread
181 AcceptLanguageList* al = Thread::getLanguages();
|
182 kumpf 1.1 if (al != NULL)
183 {
184 _client->setRequestAcceptLanguages(*al);
185 }
186 }
187
188 //
189 // If the caller specified a Content-Language in the
190 // OperationContext, set it in the CIMClient object.
191 //
192 _origContentLanguages = client->getRequestContentLanguages();
|
193 kumpf 1.13 if (context.contains(ContentLanguageListContainer::NAME))
|
194 kumpf 1.1 {
195 ContentLanguageListContainer cl_cntr =
196 (ContentLanguageListContainer)context.get(
197 ContentLanguageListContainer::NAME);
198 _client->setRequestContentLanguages(cl_cntr.getLanguages());
199 }
200 }
201
202 ~ClientCIMOMHandleSetup()
203 {
204 // Must not throw an exception from a destructor
205 try
206 {
207 //
208 // If the response has a Content-Language then save it into
209 // thread-specific storage
210 //
211 if (_client->getResponseContentLanguages().size() > 0)
212 {
213 Thread* curThrd = Thread::getCurrent();
214 if (curThrd != NULL)
215 kumpf 1.1 {
216 // deletes the old tsd and creates a new one
|
217 mike 1.23 curThrd->put_tsd(TSD_CIMOM_HANDLE_CONTENT_LANGUAGES,
|
218 kumpf 1.1 deleteContentLanguage,
|
219 kumpf 1.7 sizeof(ContentLanguageList*),
220 new ContentLanguageList(
|
221 kumpf 1.1 _client->getResponseContentLanguages()));
222 }
223 }
224
225 //
226 // Reset CIMClient timeout value and languages to original values
227 //
228 _client->setTimeout(_origTimeout);
229 _client->setRequestAcceptLanguages(_origAcceptLanguages);
230 _client->setRequestContentLanguages(_origContentLanguages);
231 }
232 catch (Exception& e)
233 {
|
234 thilo.boehm 1.22 PEG_TRACE((TRC_CIMOM_HANDLE, Tracer::LEVEL1,
235 "Ignoring Exception: %s",
236 (const char*)e.getMessage().getCString()));
|
237 kumpf 1.1 }
238 catch (...)
239 {
|
240 marek 1.20 PEG_TRACE_CSTRING(TRC_CIMOM_HANDLE, Tracer::LEVEL1,
|
241 kumpf 1.1 "Ignoring unknown exception");
242 }
243 }
244
245 private:
246 // Unimplemented constructors and assignment operator
247 ClientCIMOMHandleSetup();
248 ClientCIMOMHandleSetup(const ClientCIMOMHandleSetup&);
249 ClientCIMOMHandleSetup& operator=(const ClientCIMOMHandleSetup&);
250
|
251 thilo.boehm 1.28 CIMClientRep* _client;
|
252 kumpf 1.1 Uint32 _origTimeout;
|
253 kumpf 1.7 AcceptLanguageList _origAcceptLanguages;
254 ContentLanguageList _origContentLanguages;
|
255 kumpf 1.1 };
256
257
258 //
259 // ClientCIMOMHandleRep
260 //
261
262 ClientCIMOMHandleRep::ClientCIMOMHandleRep()
263 : _client(0)
264 {
265 }
266
267 ClientCIMOMHandleRep::~ClientCIMOMHandleRep()
268 {
269 if (_client != 0)
270 {
|
271 kumpf 1.2 // Must not throw an exception from a destructor
272 try
273 {
274 _client->disconnect();
275 }
276 catch (...)
277 {
278 // Ignore disconnect exceptions
279 }
280
|
281 kumpf 1.1 delete _client;
282 }
283 }
284
285
286 //
287 // CIM Operations
288 //
289
290 CIMClass ClientCIMOMHandleRep::getClass(
291 const OperationContext & context,
292 const CIMNamespaceName& nameSpace,
293 const CIMName& className,
294 Boolean localOnly,
295 Boolean includeQualifiers,
296 Boolean includeClassOrigin,
297 const CIMPropertyList& propertyList)
298 {
299 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::getClass");
300
|
301 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
302 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
303 ClientCIMOMHandleSetup setup(_client, context);
304
305 PEG_METHOD_EXIT();
306 return _client->getClass(
307 nameSpace,
308 className,
309 localOnly,
310 includeQualifiers,
311 includeClassOrigin,
312 propertyList);
313 }
314
315 Array<CIMClass> ClientCIMOMHandleRep::enumerateClasses(
316 const OperationContext & context,
317 const CIMNamespaceName& nameSpace,
318 const CIMName& className,
319 Boolean deepInheritance,
320 Boolean localOnly,
321 Boolean includeQualifiers,
322 Boolean includeClassOrigin)
323 kumpf 1.1 {
324 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
325 "ClientCIMOMHandleRep::enumerateClasses");
326
|
327 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
328 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
329 ClientCIMOMHandleSetup setup(_client, context);
330
331 PEG_METHOD_EXIT();
332 return _client->enumerateClasses(
333 nameSpace,
334 className,
335 deepInheritance,
336 localOnly,
337 includeQualifiers,
338 includeClassOrigin);
339 }
340
341 Array<CIMName> ClientCIMOMHandleRep::enumerateClassNames(
342 const OperationContext & context,
343 const CIMNamespaceName &nameSpace,
344 const CIMName& className,
345 Boolean deepInheritance)
346 {
347 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
348 "ClientCIMOMHandleRep::enumerateClassNames");
349 kumpf 1.1
|
350 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
351 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
352 ClientCIMOMHandleSetup setup(_client, context);
353
354 PEG_METHOD_EXIT();
355 return _client->enumerateClassNames(
356 nameSpace,
357 className,
358 deepInheritance);
359 }
360
361 void ClientCIMOMHandleRep::createClass(
362 const OperationContext & context,
363 const CIMNamespaceName& nameSpace,
364 const CIMClass& newClass)
365 {
366 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::createClass");
367
|
368 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
369 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
370 ClientCIMOMHandleSetup setup(_client, context);
371
372 _client->createClass(
373 nameSpace,
374 newClass);
375
376 PEG_METHOD_EXIT();
377 }
378
379 void ClientCIMOMHandleRep::modifyClass(
380 const OperationContext & context,
381 const CIMNamespaceName &nameSpace,
382 const CIMClass& modifiedClass)
383 {
384 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::modifyClass");
385
|
386 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
387 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
388 ClientCIMOMHandleSetup setup(_client, context);
389
390 _client->modifyClass(
391 nameSpace,
392 modifiedClass);
393
394 PEG_METHOD_EXIT();
395 }
396
397 void ClientCIMOMHandleRep::deleteClass(
398 const OperationContext & context,
399 const CIMNamespaceName &nameSpace,
400 const CIMName& className)
401 {
402
403 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::deleteClass");
404
|
405 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
406 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
407 ClientCIMOMHandleSetup setup(_client, context);
408
409 _client->deleteClass(
410 nameSpace,
411 className);
412
413 PEG_METHOD_EXIT();
414 }
415
|
416 thilo.boehm 1.28 CIMResponseData ClientCIMOMHandleRep::getInstance(
|
417 kumpf 1.1 const OperationContext & context,
418 const CIMNamespaceName &nameSpace,
419 const CIMObjectPath& instanceName,
420 Boolean includeQualifiers,
421 Boolean includeClassOrigin,
422 const CIMPropertyList& propertyList)
423 {
424 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::getInstance");
425
|
426 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
427 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
428 ClientCIMOMHandleSetup setup(_client, context);
429
430 PEG_METHOD_EXIT();
431 return _client->getInstance(
432 nameSpace,
433 instanceName,
|
434 kumpf 1.27 false, // localOnly
|
435 kumpf 1.1 includeQualifiers,
436 includeClassOrigin,
437 propertyList);
438 }
439
|
440 thilo.boehm 1.28 CIMResponseData ClientCIMOMHandleRep::enumerateInstances(
|
441 kumpf 1.1 const OperationContext & context,
442 const CIMNamespaceName &nameSpace,
443 const CIMName& className,
444 Boolean deepInheritance,
445 Boolean includeQualifiers,
446 Boolean includeClassOrigin,
447 const CIMPropertyList& propertyList)
448 {
449 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
450 "ClientCIMOMHandleRep::enumerateInstances");
451
|
452 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
453 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
454 ClientCIMOMHandleSetup setup(_client, context);
455
456 PEG_METHOD_EXIT();
457 return _client->enumerateInstances(
458 nameSpace,
459 className,
460 deepInheritance,
|
461 kumpf 1.27 false, // localOnly
|
462 kumpf 1.1 includeQualifiers,
463 includeClassOrigin,
464 propertyList);
465 }
466
|
467 thilo.boehm 1.28 CIMResponseData ClientCIMOMHandleRep::enumerateInstanceNames(
|
468 kumpf 1.1 const OperationContext & context,
469 const CIMNamespaceName &nameSpace,
470 const CIMName& className)
471 {
472 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
473 "ClientCIMOMHandleRep::enumerateInstanceNames");
474
|
475 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
476 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
477 ClientCIMOMHandleSetup setup(_client, context);
478
479 PEG_METHOD_EXIT();
480 return _client->enumerateInstanceNames(
481 nameSpace,
482 className);
483 }
484
485 CIMObjectPath ClientCIMOMHandleRep::createInstance(
486 const OperationContext & context,
487 const CIMNamespaceName &nameSpace,
488 const CIMInstance& newInstance)
489 {
490 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
491 "ClientCIMOMHandleRep::createInstance");
492
|
493 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
494 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
495 ClientCIMOMHandleSetup setup(_client, context);
496
497 PEG_METHOD_EXIT();
498 return _client->createInstance(
499 nameSpace,
500 newInstance);
501 }
502
503 void ClientCIMOMHandleRep::modifyInstance(
504 const OperationContext & context,
505 const CIMNamespaceName &nameSpace,
506 const CIMInstance& modifiedInstance,
507 Boolean includeQualifiers,
508 const CIMPropertyList& propertyList)
509 {
510 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
511 "ClientCIMOMHandleRep::modifyInstance");
512
|
513 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
514 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
515 ClientCIMOMHandleSetup setup(_client, context);
516
517 _client->modifyInstance(
518 nameSpace,
519 modifiedInstance,
520 includeQualifiers,
521 propertyList);
522
523 PEG_METHOD_EXIT();
524 }
525
526 void ClientCIMOMHandleRep::deleteInstance(
527 const OperationContext & context,
528 const CIMNamespaceName &nameSpace,
529 const CIMObjectPath& instanceName)
530 {
531 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
532 "ClientCIMOMHandleRep::deleteInstance");
533
|
534 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
535 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
536 ClientCIMOMHandleSetup setup(_client, context);
537
538 _client->deleteInstance(
539 nameSpace,
540 instanceName);
541
542 PEG_METHOD_EXIT();
543 }
544
|
545 thilo.boehm 1.28 CIMResponseData ClientCIMOMHandleRep::execQuery(
|
546 kumpf 1.1 const OperationContext & context,
547 const CIMNamespaceName &nameSpace,
548 const String& queryLanguage,
549 const String& query)
550 {
551 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::execQuery");
552
|
553 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
554 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
555 ClientCIMOMHandleSetup setup(_client, context);
556
557 PEG_METHOD_EXIT();
558 return _client->execQuery(
559 nameSpace,
560 queryLanguage,
561 query);
562 }
563
|
564 thilo.boehm 1.28 CIMResponseData ClientCIMOMHandleRep::associators(
|
565 kumpf 1.1 const OperationContext & context,
566 const CIMNamespaceName &nameSpace,
567 const CIMObjectPath& objectName,
568 const CIMName& assocClass,
569 const CIMName& resultClass,
570 const String& role,
571 const String& resultRole,
572 Boolean includeQualifiers,
573 Boolean includeClassOrigin,
574 const CIMPropertyList& propertyList)
575 {
576 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::associators");
577
|
578 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
579 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
580 ClientCIMOMHandleSetup setup(_client, context);
581
582 PEG_METHOD_EXIT();
583 return _client->associators(
584 nameSpace,
585 objectName,
586 assocClass,
587 resultClass,
588 role,
589 resultRole,
590 includeQualifiers,
591 includeClassOrigin,
592 propertyList);
593 }
594
|
595 thilo.boehm 1.28 CIMResponseData ClientCIMOMHandleRep::associatorNames(
|
596 kumpf 1.1 const OperationContext & context,
597 const CIMNamespaceName &nameSpace,
598 const CIMObjectPath& objectName,
599 const CIMName& assocClass,
600 const CIMName& resultClass,
601 const String& role,
602 const String& resultRole)
603 {
604 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
605 "ClientCIMOMHandleRep::associatorNames");
606
|
607 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
608 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
609 ClientCIMOMHandleSetup setup(_client, context);
610
611 PEG_METHOD_EXIT();
612 return _client->associatorNames(
613 nameSpace,
614 objectName,
615 assocClass,
616 resultClass,
617 role,
618 resultRole);
619 }
620
|
621 thilo.boehm 1.28 CIMResponseData ClientCIMOMHandleRep::references(
|
622 kumpf 1.1 const OperationContext & context,
623 const CIMNamespaceName &nameSpace,
624 const CIMObjectPath& objectName,
625 const CIMName& resultClass,
626 const String& role,
627 Boolean includeQualifiers,
628 Boolean includeClassOrigin,
629 const CIMPropertyList& propertyList)
630 {
631 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::references");
632
|
633 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
634 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
635 ClientCIMOMHandleSetup setup(_client, context);
636
637 PEG_METHOD_EXIT();
638 return _client->references(
639 nameSpace,
640 objectName,
641 resultClass,
642 role,
643 includeQualifiers,
644 includeClassOrigin,
645 propertyList);
646 }
647
|
648 thilo.boehm 1.28 CIMResponseData ClientCIMOMHandleRep::referenceNames(
|
649 kumpf 1.1 const OperationContext & context,
650 const CIMNamespaceName &nameSpace,
651 const CIMObjectPath& objectName,
652 const CIMName& resultClass,
653 const String& role)
654 {
655 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
656 "ClientCIMOMHandleRep::referenceNames");
657
|
658 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
659 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
660 ClientCIMOMHandleSetup setup(_client, context);
661
662 PEG_METHOD_EXIT();
663 return _client->referenceNames(
664 nameSpace,
665 objectName,
666 resultClass,
667 role);
668 }
669
670 CIMValue ClientCIMOMHandleRep::getProperty(
671 const OperationContext & context,
672 const CIMNamespaceName &nameSpace,
673 const CIMObjectPath& instanceName,
674 const CIMName& propertyName)
675 {
676 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::getProperty");
677
|
678 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
679 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
680 ClientCIMOMHandleSetup setup(_client, context);
681
682 PEG_METHOD_EXIT();
683 return _client->getProperty(
684 nameSpace,
685 instanceName,
686 propertyName);
687 }
688
689 void ClientCIMOMHandleRep::setProperty(
690 const OperationContext & context,
691 const CIMNamespaceName &nameSpace,
692 const CIMObjectPath& instanceName,
693 const CIMName& propertyName,
694 const CIMValue& newValue)
695 {
696 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::setProperty");
697
|
698 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
699 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
700 ClientCIMOMHandleSetup setup(_client, context);
701
702 _client->setProperty(
703 nameSpace,
704 instanceName,
705 propertyName,
706 newValue);
707
708 PEG_METHOD_EXIT();
709 }
710
711 CIMValue ClientCIMOMHandleRep::invokeMethod(
712 const OperationContext & context,
713 const CIMNamespaceName &nameSpace,
714 const CIMObjectPath& instanceName,
715 const CIMName& methodName,
716 const Array<CIMParamValue>& inParameters,
717 Array<CIMParamValue>& outParameters)
718 {
719 PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "ClientCIMOMHandleRep::invokeMethod");
720 kumpf 1.1
|
721 thilo.boehm 1.28 AutoPThreadSecurity revPthreadSec(context, true);
|
722 kumpf 1.1 ClientCIMOMHandleAccessController access(_clientMutex);
723 ClientCIMOMHandleSetup setup(_client, context);
724
725 PEG_METHOD_EXIT();
726 return _client->invokeMethod(
727 nameSpace,
728 instanceName,
729 methodName,
730 inParameters,
731 outParameters);
732 }
733
734
735 //
736 // Other public methods
737 //
738
739 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
740 OperationContext ClientCIMOMHandleRep::getResponseContext()
741 {
742 OperationContext ctx;
743 kumpf 1.1
744 Thread* curThrd = Thread::getCurrent();
745 if (curThrd == NULL)
746 {
|
747 kumpf 1.7 ctx.insert(ContentLanguageListContainer(ContentLanguageList()));
|
748 kumpf 1.1 }
749 else
750 {
|
751 kumpf 1.7 ContentLanguageList* contentLangs = (ContentLanguageList*)
|
752 mike 1.23 curThrd->reference_tsd(TSD_CIMOM_HANDLE_CONTENT_LANGUAGES);
|
753 kumpf 1.1 curThrd->dereference_tsd();
|
754 kumpf 1.26
|
755 kumpf 1.1 if (contentLangs == NULL)
756 {
|
757 kumpf 1.7 ctx.insert(ContentLanguageListContainer(ContentLanguageList()));
|
758 kumpf 1.1 }
759 else
760 {
761 ctx.insert(ContentLanguageListContainer(*contentLangs));
762 // delete the old tsd to free the memory
|
763 mike 1.23 curThrd->delete_tsd(TSD_CIMOM_HANDLE_CONTENT_LANGUAGES);
|
764 kumpf 1.1 }
765 }
766
767 return ctx;
768 }
769 #endif
770
771 PEGASUS_NAMESPACE_END
|