1 karl 1.82 //%2006////////////////////////////////////////////////////////////////////////
|
2 marek 1.63 //
3 // 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 // IBM Corp.; EMC Corporation, The Open Group.
7 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.82 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 marek 1.63 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 karl 1.82 //
|
21 marek 1.63 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #include "CMPI_Version.h"
35
36 #include "CMPIProviderManager.h"
37
38 #include "CMPI_Object.h"
39 #include "CMPI_Instance.h"
40 #include "CMPI_ObjectPath.h"
41 #include "CMPI_Result.h"
42 marek 1.63 #include "CMPI_SelectExp.h"
43
44 #include <Pegasus/Common/CIMMessage.h>
45 #include <Pegasus/Common/OperationContext.h>
|
46 a.dunfey 1.85 #include <Pegasus/Common/OperationContextInternal.h>
|
47 marek 1.63 #include <Pegasus/Common/Tracer.h>
48 #include <Pegasus/Common/StatisticalData.h>
49 #include <Pegasus/Common/Logger.h>
|
50 kumpf 1.79 #include <Pegasus/Common/LanguageParser.h>
|
51 marek 1.63 #include <Pegasus/Common/MessageLoader.h> //l10n
52 #include <Pegasus/Common/Constants.h>
|
53 thilo.boehm 1.89 #include <Pegasus/Common/FileSystem.h>
|
54 marek 1.63
55 #include <Pegasus/Config/ConfigManager.h>
56
57 #include <Pegasus/Provider/CIMOMHandleQueryContext.h>
|
58 a.dunfey 1.85 #include <Pegasus/ProviderManager2/CIMOMHandleContext.h>
|
59 marek 1.63 #include <Pegasus/ProviderManager2/ProviderName.h>
|
60 kumpf 1.93 #include <Pegasus/ProviderManager2/AutoPThreadSecurity.h>
|
61 marek 1.63 #include <Pegasus/ProviderManager2/CMPI/CMPIProviderModule.h>
62 #include <Pegasus/ProviderManager2/CMPI/CMPIProvider.h>
63
|
64 kumpf 1.93 PEGASUS_USING_STD;
|
65 marek 1.63
66 PEGASUS_NAMESPACE_BEGIN
67
|
68 dave.sudlik 1.96
|
69 marek 1.95 ReadWriteSem CMPIProviderManager::rwSemProvTab;
70 ReadWriteSem CMPIProviderManager::rwSemSelxTab;
|
71 marek 1.63 CMPIProviderManager::IndProvTab CMPIProviderManager::provTab;
72 CMPIProviderManager::IndSelectTab CMPIProviderManager::selxTab;
|
73 marek 1.95
|
74 venkat.puvvada 1.108 class CMPIPropertyList
75 {
76 char **props;
77 int pCount;
78 public:
79 CMPIPropertyList(CIMPropertyList &propertyList) : props(0), pCount(0)
80 {
|
81 ms.aruran 1.115 PEG_METHOD_ENTER(
82 TRC_PROVIDERMANAGER,
83 "CMPIPropertyList::CMPIPropertyList()");
|
84 venkat.puvvada 1.108 if (!propertyList.isNull())
85 {
86 Array<CIMName> p=propertyList.getPropertyNameArray();
87 pCount=p.size();
88 props = new char*[1+pCount];
89 for (int i=0; i<pCount; i++)
90 {
91 props[i]=strdup(p[i].getString().getCString());
92 }
93 props[pCount]=NULL;
94 }
95 else props=NULL;
|
96 ms.aruran 1.115 PEG_METHOD_EXIT();
|
97 venkat.puvvada 1.108 }
98 ~CMPIPropertyList()
99 {
|
100 ms.aruran 1.115 PEG_METHOD_ENTER(
101 TRC_PROVIDERMANAGER,
102 "CMPIPropertyList::~CMPIPropertyList()");
|
103 venkat.puvvada 1.108 if (props)
104 {
105 for (int i=0; i<pCount; i++)
106 free(props[i]);
107 delete [] props;
108 }
|
109 ms.aruran 1.115 PEG_METHOD_EXIT();
|
110 venkat.puvvada 1.108 }
111 char **getList()
112 {
113 return props;
114 }
|
115 marek 1.63 };
116
|
117 marek 1.127 CMPIProviderManager::CMPIProviderManager()
|
118 marek 1.63 {
|
119 ms.aruran 1.115 PEG_METHOD_ENTER(
120 TRC_PROVIDERMANAGER,
121 "CMPIProviderManager::CMPIProviderManager()");
122
|
123 venkat.puvvada 1.108 _subscriptionInitComplete = false;
|
124 ms.aruran 1.115 PEG_TRACE_CSTRING (
125 TRC_PROVIDERMANAGER,
126 Tracer::LEVEL2,
127 "-- CMPI Provider Manager activated");
128 PEG_METHOD_EXIT();
|
129 marek 1.63 }
130
|
131 venkat.puvvada 1.108 CMPIProviderManager::~CMPIProviderManager()
|
132 marek 1.63 {
|
133 ms.aruran 1.115 PEG_METHOD_ENTER(
134 TRC_PROVIDERMANAGER,
135 "CMPIProviderManager::~CMPIProviderManager()");
|
136 venkat.puvvada 1.108 /* Clean up the hash-tables */
|
137 marek 1.63 indProvRecord *prec=NULL;
|
138 marek 1.95 {
139 WriteLock writeLock(rwSemProvTab);
|
140 venkat.puvvada 1.108 for (IndProvTab::Iterator i = provTab.start(); i; i++)
141 {
142 provTab.lookup(i.key(),prec);
143 if (prec->handler)
144 delete prec->handler;
145 delete prec;
146 //Remove is not neccessary, since the hashtable destructor takes
147 //care of this already. But instead removing entries while
148 //iterating the hashtable sometimes causes a segmentation fault!!!
149 //provTab.remove(i.key());
150 prec=NULL;
151 }
|
152 marek 1.95 }
153
|
154 venkat.puvvada 1.108 indSelectRecord *selx=NULL;
|
155 marek 1.95 {
156 WriteLock writeLock(rwSemSelxTab);
|
157 venkat.puvvada 1.108 for (IndSelectTab::Iterator i = selxTab.start(); i; i++)
158 {
159 selxTab.lookup(i.key(), selx);
160 if (selx->eSelx)
161 delete selx->eSelx;
162 if (selx->qContext)
163 delete selx->qContext;
164 delete selx;
165 //Same as above!
166 //selxTab.remove(i.key());
167 selx=NULL;
168 }
|
169 marek 1.95 }
|
170 ms.aruran 1.115 PEG_METHOD_EXIT();
|
171 marek 1.63 }
172
173 Message * CMPIProviderManager::processMessage(Message * request)
174 {
|
175 ms.aruran 1.115 PEG_METHOD_ENTER(
176 TRC_PROVIDERMANAGER,
|
177 marek 1.63 "CMPIProviderManager::processMessage()");
178
179 Message * response = 0;
180
181 // pass the request message to a handler method based on message type
|
182 venkat.puvvada 1.108 switch (request->getType())
|
183 marek 1.63 {
|
184 venkat.puvvada 1.108 case CIM_GET_INSTANCE_REQUEST_MESSAGE:
185 response = handleGetInstanceRequest(request);
|
186 marek 1.63
|
187 venkat.puvvada 1.108 break;
188 case CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE:
189 response = handleEnumerateInstancesRequest(request);
190
191 break;
192 case CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE:
193 response = handleEnumerateInstanceNamesRequest(request);
194
195 break;
196 case CIM_CREATE_INSTANCE_REQUEST_MESSAGE:
197 response = handleCreateInstanceRequest(request);
198
199 break;
200 case CIM_MODIFY_INSTANCE_REQUEST_MESSAGE:
201 response = handleModifyInstanceRequest(request);
202
203 break;
204 case CIM_DELETE_INSTANCE_REQUEST_MESSAGE:
205 response = handleDeleteInstanceRequest(request);
206
207 break;
208 venkat.puvvada 1.108 case CIM_EXEC_QUERY_REQUEST_MESSAGE:
209 response = handleExecQueryRequest(request);
210
211 break;
212 case CIM_ASSOCIATORS_REQUEST_MESSAGE:
213 response = handleAssociatorsRequest(request);
214
215 break;
216 case CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE:
217 response = handleAssociatorNamesRequest(request);
218
219 break;
220 case CIM_REFERENCES_REQUEST_MESSAGE:
221 response = handleReferencesRequest(request);
222
223 break;
224 case CIM_REFERENCE_NAMES_REQUEST_MESSAGE:
225 response = handleReferenceNamesRequest(request);
226
227 break;
228 case CIM_INVOKE_METHOD_REQUEST_MESSAGE:
229 venkat.puvvada 1.108 response = handleInvokeMethodRequest(request);
230
231 break;
232 case CIM_CREATE_SUBSCRIPTION_REQUEST_MESSAGE:
233 response = handleCreateSubscriptionRequest(request);
|
234 marek 1.63
|
235 venkat.puvvada 1.108 break;
|
236 marek 1.63 /* case CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE:
237 response = handleModifySubscriptionRequest(request);
238
239 break;
|
240 venkat.puvvada 1.108 */
241 case CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE:
242 response = handleDeleteSubscriptionRequest(request);
|
243 marek 1.63
|
244 venkat.puvvada 1.108 break;
|
245 marek 1.63 /* case CIM_EXPORT_INDICATION_REQUEST_MESSAGE:
246 response = handleExportIndicationRequest(request);
247 break;
248 */
|
249 venkat.puvvada 1.108 case CIM_DISABLE_MODULE_REQUEST_MESSAGE:
250 response = handleDisableModuleRequest(request);
|
251 marek 1.63
|
252 venkat.puvvada 1.108 break;
253 case CIM_ENABLE_MODULE_REQUEST_MESSAGE:
254 response = handleEnableModuleRequest(request);
255
256 break;
257 case CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE:
258 response = handleStopAllProvidersRequest(request);
259
260 break;
261 case CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE:
262 response = handleSubscriptionInitCompleteRequest (request);
263
264 break;
265 case CIM_GET_PROPERTY_REQUEST_MESSAGE:
266 response = handleGetPropertyRequest(request);
267
268 break;
269 case CIM_SET_PROPERTY_REQUEST_MESSAGE:
270 response = handleSetPropertyRequest(request);
271
272 break;
273 venkat.puvvada 1.108 default:
274 response = handleUnsupportedRequest(request);
|
275 marek 1.63
|
276 venkat.puvvada 1.108 break;
|
277 marek 1.63 }
278
279 PEG_METHOD_EXIT();
280
281 return(response);
282 }
283
284 Boolean CMPIProviderManager::hasActiveProviders()
285 {
|
286 venkat.puvvada 1.108 return providerManager.hasActiveProviders();
|
287 marek 1.63 }
288
289 void CMPIProviderManager::unloadIdleProviders()
290 {
|
291 venkat.puvvada 1.108 providerManager.unloadIdleProviders();
|
292 marek 1.63 }
293
294
295 #define CHARS(cstring) (char*)(strlen(cstring)?(const char*)cstring:NULL)
296
297
|
298 kumpf 1.92 #define HandlerIntroBase(type,type1,message,request,response,handler) \
|
299 marek 1.63 CIM##type##RequestMessage * request = \
|
300 venkat.puvvada 1.108 dynamic_cast<CIM##type##RequestMessage *>(const_cast<Message *> \
301 (message)); \
|
302 marek 1.63 PEGASUS_ASSERT(request != 0); \
303 CIM##type##ResponseMessage * response = \
|
304 kumpf 1.92 dynamic_cast<CIM##type##ResponseMessage*>(request->buildResponse()); \
|
305 marek 1.63 PEGASUS_ASSERT(response != 0); \
|
306 kumpf 1.84 type1##ResponseHandler handler(request, response, _responseChunkCallback);
|
307 marek 1.63
308 #define HandlerIntroInd(type,message,request,response,handler) \
|
309 kumpf 1.92 HandlerIntroBase(type,Operation,message,request,response,handler)
|
310 marek 1.63
311 #define HandlerIntroInit(type,message,request,response,handler) \
|
312 kumpf 1.92 HandlerIntroBase(type,Operation,message,request,response,handler)
|
313 marek 1.63
|
314 kumpf 1.92 #define HandlerIntro(type,message,request,response,handler) \
315 HandlerIntroBase(type,type,message,request,response,handler)
|
316 marek 1.63
317 #define HandlerCatch(handler) \
|
318 konrad.r 1.64 catch(const CIMException & e) \
|
319 marek 1.131 { PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL1, \
|
320 marek 1.63 "Exception: " + e.getMessage()); \
|
321 dave.sudlik 1.103 handler.setCIMException(e); \
|
322 marek 1.63 } \
|
323 konrad.r 1.64 catch(const Exception & e) \
|
324 marek 1.131 { PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL1, \
|
325 marek 1.63 "Exception: " + e.getMessage()); \
|
326 venkat.puvvada 1.108 handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), \
327 e.getMessage()); \
|
328 marek 1.63 } \
329 catch(...) \
|
330 marek 1.131 { PEG_TRACE_CSTRING(TRC_PROVIDERMANAGER, Tracer::LEVEL1, \
|
331 marek 1.63 "Exception: Unknown"); \
332 handler.setStatus(CIM_ERR_FAILED, "Unknown error."); \
333 }
334
|
335 marek 1.124 void CMPIProviderManager::_setupCMPIContexts(
336 CMPI_ContextOnStack * eCtx,
337 OperationContext * context,
338 ProviderIdContainer * pidc,
339 const String &nameSpace,
340 Boolean remote,
341 Boolean includeQualifiers,
342 Boolean includeClassOrigin,
343 Boolean setFlags)
344 {
345 if (setFlags)
346 {
347 // set CMPI invocation flags
|
348 kumpf 1.125 CMPIValue value;
349 value.uint32 = 0;
350 if (includeQualifiers) value.uint32 |= CMPI_FLAG_IncludeQualifiers;
351 if (includeClassOrigin) value.uint32 |= CMPI_FLAG_IncludeClassOrigin;
|
352 marek 1.124 eCtx->ft->addEntry(
353 eCtx,
354 CMPIInvocationFlags,
|
355 kumpf 1.125 &value,
|
356 marek 1.124 CMPI_uint32);
357 }
358
359 // add identity context
360 const IdentityContainer container =
361 context->get(IdentityContainer::NAME);
362 eCtx->ft->addEntry(
363 eCtx,
364 CMPIPrincipal,
365 (CMPIValue*)(const char*)container.getUserName().getCString(),
366 CMPI_chars);
367
368 // add AcceptLanguages to CMPI context
369 const AcceptLanguageListContainer accept_language=
370 context->get(AcceptLanguageListContainer::NAME);
371 const AcceptLanguageList acceptLangs = accept_language.getLanguages();
372
373 eCtx->ft->addEntry(
374 eCtx,
375 CMPIAcceptLanguage,
376 (CMPIValue*)(const char*)
377 marek 1.124 LanguageParser::buildAcceptLanguageHeader(acceptLangs).getCString(),
378 CMPI_chars);
379
380 // add initial namespace to context
381 eCtx->ft->addEntry(
382 eCtx,
383 CMPIInitNameSpace,
384 (CMPIValue*)(const char*)nameSpace.getCString(),
385 CMPI_chars);
386
387 // add remote info to context
388 if (remote)
389 {
390 CString info=pidc->getRemoteInfo().getCString();
391 eCtx->ft->addEntry(
392 eCtx,
393 "CMPIRRemoteInfo",(CMPIValue*)(const char*)info,
394 CMPI_chars);
395 }
396 }
397
|
398 venkat.puvvada 1.108 Message * CMPIProviderManager::handleGetInstanceRequest(
399 const Message * message)
|
400 marek 1.63 {
|
401 ms.aruran 1.115 PEG_METHOD_ENTER(
402 TRC_PROVIDERMANAGER,
403 "CMPIProviderManager::handleGetInstanceRequest()");
|
404 marek 1.63
|
405 kumpf 1.92 HandlerIntro(GetInstance,message,request,response,handler);
|
406 marek 1.63
|
407 venkat.puvvada 1.108 try
408 {
|
409 marek 1.129 PEG_TRACE((
410 TRC_PROVIDERMANAGER,
411 Tracer::LEVEL3,
412 "CMPIProviderManager::handleGetInstanceRequest - Host name:"
413 " %s Name space: %s Class name: %s",
414 (const char*) System::getHostName().getCString(),
415 (const char*) request->nameSpace.getString().getCString(),
416 (const char*)
417 request->instanceName.getClassName().getString().getCString()));
418
|
419 marek 1.63 // make target object path
420 CIMObjectPath objectPath(
421 System::getHostName(),
422 request->nameSpace,
423 request->instanceName.getClassName(),
424 request->instanceName.getKeyBindings());
425
426 Boolean remote=false;
|
427 venkat.puvvada 1.132 OpProviderHolder ph;
|
428 marek 1.63
429 // resolve provider name
|
430 venkat.puvvada 1.108 ProviderIdContainer pidc =
431 request->operationContext.get(ProviderIdContainer::NAME);
432
|
433 marek 1.63 ProviderName name = _resolveProviderName(pidc);
434
|
435 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
436 {
437 ph = providerManager.getRemoteProvider(
438 name.getLocation(), name.getLogicalName());
|
439 a.dunfey 1.85 }
|
440 venkat.puvvada 1.108 else
441 {
|
442 a.dunfey 1.85 // get cached or load new provider module
|
443 venkat.puvvada 1.108 ph = providerManager.getProvider(
444 name.getPhysicalName(), name.getLogicalName());
|
445 marek 1.63 }
446
447 // convert arguments
448 OperationContext context;
449
450 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
451 venkat.puvvada 1.108 context.insert(
452 request->operationContext.get(AcceptLanguageListContainer::NAME));
453 context.insert(
454 request->operationContext.get(ContentLanguageListContainer::NAME));
|
455 marek 1.63 // forward request
456 CMPIProvider & pr=ph.GetProvider();
457
|
458 a.dunfey 1.85 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
|
459 venkat.puvvada 1.121 AutoPtr<NormalizerContext> tmpNormalizerContext(
|
460 venkat.puvvada 1.132 new CIMOMHandleContext(*pr.getCIMOMHandle()));
|
461 venkat.puvvada 1.121 request->operationContext.insert(
462 NormalizerContextContainer(tmpNormalizerContext));
463 #endif
|
464 a.dunfey 1.85
|
465 ms.aruran 1.115 PEG_TRACE_STRING(
466 TRC_PROVIDERMANAGER,
467 Tracer::LEVEL4,
|
468 marek 1.63 "Calling provider.getInstance: " + pr.getName());
469
470 CMPIStatus rc={CMPI_RC_OK,NULL};
471 CMPI_ContextOnStack eCtx(context);
472 CMPI_ObjectPathOnStack eRef(objectPath);
|
473 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
474 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
475 marek 1.63
476 CMPIPropertyList props(request->propertyList);
|
477 marek 1.124
478 _setupCMPIContexts(
|
479 venkat.puvvada 1.108 &eCtx,
|
480 marek 1.124 &context,
481 &pidc,
482 request->nameSpace.getString(),
483 remote,
484 request->includeQualifiers,
485 request->includeClassOrigin,
486 true);
|
487 marek 1.63
488 CMPIProvider::pm_service_op_lock op_lock(&pr);
489
|
490 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
491 marek 1.63
|
492 kumpf 1.92 {
493 StatProviderTimeMeasurement providerTime(response);
|
494 marek 1.63
|
495 venkat.puvvada 1.132 rc = pr.getInstMI()->ft->getInstance(
496 pr.getInstMI(),
|
497 venkat.puvvada 1.108 &eCtx,
498 &eRes,
499 &eRef,
|
500 kumpf 1.92 (const char **)props.getList());
501 }
|
502 marek 1.63
|
503 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
504 // Do this before checking rc from provider to throw exception in case
505 // rc.msg is also localized.
506 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
507 venkat.puvvada 1.108 CMPIData cldata =
508 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
509 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
510 {
511 response->operationContext.set(
512 ContentLanguageListContainer(
|
513 venkat.puvvada 1.108 ContentLanguageList(
514 LanguageParser::parseContentLanguageHeader(
515 CMGetCharPtr(cldata.value.string)))));
|
516 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
517 dave.sudlik 1.99 }
518
|
519 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
520 dave.sudlik 1.102 {
|
521 venkat.puvvada 1.108 CIMException cimException(
522 (CIMStatusCode)rc.rc,
523 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
524
525 if (eRes.resError)
526 {
527 for (CMPI_Error* currErr=eRes.resError;
|
528 dave.sudlik 1.102 currErr!=NULL;
529 currErr=currErr->nextError)
|
530 venkat.puvvada 1.108 {
531 cimException.addError(
532 ((CIMError*)currErr->hdl)->getInstance());
533 }
534 }
535 throw cimException;
|
536 dave.sudlik 1.102 }
|
537 marek 1.63 }
538 HandlerCatch(handler);
539
540 PEG_METHOD_EXIT();
541
542 return(response);
543 }
544
|
545 venkat.puvvada 1.108 Message * CMPIProviderManager::handleEnumerateInstancesRequest(
546 const Message * message)
|
547 marek 1.63 {
|
548 ms.aruran 1.115 PEG_METHOD_ENTER(
549 TRC_PROVIDERMANAGER,
550 "CMPIProviderManager::handleEnumerateInstanceRequest()");
|
551 marek 1.63
|
552 kumpf 1.92 HandlerIntro(EnumerateInstances,message,request,response,handler);
|
553 venkat.puvvada 1.108 try
554 {
|
555 marek 1.129 PEG_TRACE((
556 TRC_PROVIDERMANAGER,
557 Tracer::LEVEL3,
|
558 venkat.puvvada 1.108 "CMPIProviderManager::handleEnumerateInstancesRequest - Host name:"
|
559 marek 1.129 " %s Name space: %s Class name: %s",
560 (const char*) System::getHostName().getCString(),
561 (const char*) request->nameSpace.getString().getCString(),
562 (const char*) request->className.getString().getCString()));
|
563 marek 1.63
564 // make target object path
565 CIMObjectPath objectPath(
566 System::getHostName(),
567 request->nameSpace,
568 request->className);
569
570 Boolean remote=false;
|
571 venkat.puvvada 1.132 OpProviderHolder ph;
|
572 marek 1.63
573 // resolve provider name
|
574 venkat.puvvada 1.108 ProviderIdContainer pidc =
575 request->operationContext.get(ProviderIdContainer::NAME);
|
576 marek 1.63 ProviderName name = _resolveProviderName(pidc);
577
|
578 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
579 {
580 ph = providerManager.getRemoteProvider(
581 name.getLocation(), name.getLogicalName());
582 }
583 else
584 {
585 // get cached or load new provider module
586 ph = providerManager.getProvider(
587 name.getPhysicalName(), name.getLogicalName());
|
588 marek 1.63 }
589
590 // convert arguments
591 OperationContext context;
592
593 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
594 venkat.puvvada 1.108 context.insert(
595 request->operationContext.get(AcceptLanguageListContainer::NAME));
596 context.insert(
597 request->operationContext.get(ContentLanguageListContainer::NAME));
|
598 marek 1.63
599 CIMPropertyList propertyList(request->propertyList);
600
601 // forward request
602 CMPIProvider & pr=ph.GetProvider();
603
|
604 a.dunfey 1.85 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
|
605 venkat.puvvada 1.121 AutoPtr<NormalizerContext> tmpNormalizerContext(
|
606 venkat.puvvada 1.132 new CIMOMHandleContext(*pr.getCIMOMHandle()));
|
607 venkat.puvvada 1.121 request->operationContext.insert(
608 NormalizerContextContainer(tmpNormalizerContext));
609 #endif
|
610 a.dunfey 1.85
|
611 ms.aruran 1.115 PEG_TRACE_STRING(
612 TRC_PROVIDERMANAGER,
613 Tracer::LEVEL4,
|
614 marek 1.63 "Calling provider.enumerateInstances: " + pr.getName());
615
616 CMPIStatus rc={CMPI_RC_OK,NULL};
617 CMPI_ContextOnStack eCtx(context);
618 CMPI_ObjectPathOnStack eRef(objectPath);
|
619 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
620 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
621 marek 1.63
622 CMPIPropertyList props(propertyList);
623
|
624 marek 1.124 _setupCMPIContexts(
|
625 venkat.puvvada 1.108 &eCtx,
|
626 marek 1.124 &context,
627 &pidc,
628 request->nameSpace.getString(),
629 remote,
630 request->includeQualifiers,
631 request->includeClassOrigin,
632 true);
|
633 marek 1.63
634 CMPIProvider::pm_service_op_lock op_lock(&pr);
635
|
636 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
637 marek 1.63
|
638 kumpf 1.92 {
639 StatProviderTimeMeasurement providerTime(response);
|
640 marek 1.63
|
641 venkat.puvvada 1.132 rc = pr.getInstMI()->ft->enumerateInstances(
642 pr.getInstMI(),
|
643 venkat.puvvada 1.108 &eCtx,
644 &eRes,
645 &eRef,
|
646 kumpf 1.92 (const char **)props.getList());
647 }
|
648 marek 1.63
|
649 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
650 // Do this before checking rc from provider to throw exception in case
651 // rc.msg is also localized.
652 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
653 venkat.puvvada 1.108 CMPIData cldata =
654 eCtx.ft->getEntry(&eCtx, CMPIContentLanguage, &tmprc);
|
655 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
656 {
657 response->operationContext.set(
658 ContentLanguageListContainer(
|
659 venkat.puvvada 1.108 ContentLanguageList(
660 LanguageParser::parseContentLanguageHeader(
661 CMGetCharPtr(cldata.value.string)))));
|
662 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
663 dave.sudlik 1.99 }
664
|
665 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
666 dave.sudlik 1.102 {
|
667 venkat.puvvada 1.108 CIMException cimException(
668 (CIMStatusCode)rc.rc,
669 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
670
671 if (eRes.resError)
672 {
673 for (CMPI_Error* currErr=eRes.resError;
|
674 dave.sudlik 1.102 currErr!=NULL;
675 currErr=currErr->nextError)
|
676 venkat.puvvada 1.108 {
677 cimException.addError(
678 ((CIMError*)currErr->hdl)->getInstance());
679 }
680 }
681 throw cimException;
|
682 dave.sudlik 1.102 }
683
|
684 marek 1.63 }
685 HandlerCatch(handler);
686
687 PEG_METHOD_EXIT();
688
689 return(response);
690 }
691
|
692 venkat.puvvada 1.108 Message * CMPIProviderManager::handleEnumerateInstanceNamesRequest(
693 const Message * message)
|
694 marek 1.63 {
|
695 ms.aruran 1.115 PEG_METHOD_ENTER(
696 TRC_PROVIDERMANAGER,
697 "CMPIProviderManager::handleEnumerateInstanceNamesRequest()");
|
698 marek 1.63
|
699 kumpf 1.92 HandlerIntro(EnumerateInstanceNames,message,request,response,handler);
|
700 venkat.puvvada 1.108 try
701 {
|
702 marek 1.129 PEG_TRACE((
703 TRC_PROVIDERMANAGER,
704 Tracer::LEVEL3,
705 "CMPIProviderManager::handleEnumerateInstanceNamesRequest"
706 " - Host name: %s Name space: %s Class name: %s",
707 (const char*) System::getHostName().getCString(),
708 (const char*) request->nameSpace.getString().getCString(),
709 (const char*) request->className.getString().getCString()));
|
710 marek 1.63
|
711 venkat.puvvada 1.108 // make target object path
|
712 marek 1.63 CIMObjectPath objectPath(
713 System::getHostName(),
714 request->nameSpace,
715 request->className);
716
717 Boolean remote=false;
|
718 venkat.puvvada 1.132 OpProviderHolder ph;
|
719 marek 1.63
720 // resolve provider name
|
721 venkat.puvvada 1.108 ProviderIdContainer pidc =
722 request->operationContext.get(ProviderIdContainer::NAME);
|
723 marek 1.63 ProviderName name = _resolveProviderName(pidc);
724
|
725 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
726 {
727 ph = providerManager.getRemoteProvider(
728 name.getLocation(), name.getLogicalName());
|
729 marek 1.63 }
|
730 venkat.puvvada 1.108 else
731 {
732 // get cached or load new provider module
733 ph = providerManager.getProvider(
734 name.getPhysicalName(), name.getLogicalName());
|
735 marek 1.63 }
736
737 // convert arguments
738 OperationContext context;
739
740 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
741 venkat.puvvada 1.108 context.insert(
742 request->operationContext.get(AcceptLanguageListContainer::NAME));
743 context.insert(
744 request->operationContext.get(ContentLanguageListContainer::NAME));
|
745 marek 1.63 CMPIProvider & pr=ph.GetProvider();
746
|
747 ms.aruran 1.115 PEG_TRACE_STRING(
748 TRC_PROVIDERMANAGER,
749 Tracer::LEVEL4,
|
750 marek 1.63 "Calling provider.enumerateInstanceNames: " + pr.getName());
751
752 CMPIStatus rc={CMPI_RC_OK,NULL};
753 CMPI_ContextOnStack eCtx(context);
754 CMPI_ObjectPathOnStack eRef(objectPath);
|
755 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
756 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
757 marek 1.63
|
758 marek 1.124 _setupCMPIContexts(
|
759 venkat.puvvada 1.108 &eCtx,
|
760 marek 1.124 &context,
761 &pidc,
762 request->nameSpace.getString(),
763 remote,
764 false,
765 false,
766 true);
|
767 marek 1.63
768 CMPIProvider::pm_service_op_lock op_lock(&pr);
769
|
770 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
771 venkat.puvvada 1.108
|
772 kumpf 1.92 {
773 StatProviderTimeMeasurement providerTime(response);
|
774 marek 1.63
|
775 venkat.puvvada 1.132 rc = pr.getInstMI()->ft->enumerateInstanceNames(
776 pr.getInstMI(),
777 &eCtx,
778 &eRes,
779 &eRef);
|
780 kumpf 1.92 }
|
781 marek 1.63
|
782 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
783 // Do this before checking rc from provider to throw exception in case
784 // rc.msg is also localized.
785 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
786 venkat.puvvada 1.108 CMPIData cldata =
787 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
788 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
789 {
790 response->operationContext.set(
791 ContentLanguageListContainer(
|
792 venkat.puvvada 1.108 ContentLanguageList(
793 LanguageParser::parseContentLanguageHeader(
794 CMGetCharPtr(cldata.value.string)))));
|
795 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
796 dave.sudlik 1.99 }
797
|
798 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
799 dave.sudlik 1.102 {
|
800 venkat.puvvada 1.108 CIMException cimException(
801 (CIMStatusCode)rc.rc,
802 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
803
804 if (eRes.resError)
805 {
806 for (CMPI_Error* currErr=eRes.resError;
|
807 dave.sudlik 1.102 currErr!=NULL;
808 currErr=currErr->nextError)
|
809 venkat.puvvada 1.108 {
810 cimException.addError(
811 ((CIMError*)currErr->hdl)->getInstance());
812 }
813 }
814 throw cimException;
|
815 dave.sudlik 1.102 }
|
816 marek 1.63 }
817 HandlerCatch(handler);
818
819 PEG_METHOD_EXIT();
820
821 return(response);
822 }
823
|
824 venkat.puvvada 1.108 Message * CMPIProviderManager::handleCreateInstanceRequest(
825 const Message * message)
|
826 marek 1.63 {
|
827 ms.aruran 1.115 PEG_METHOD_ENTER(
828 TRC_PROVIDERMANAGER,
829 "CMPIProviderManager::handleCreateInstanceRequest()");
|
830 marek 1.63
|
831 kumpf 1.92 HandlerIntro(CreateInstance,message,request,response,handler);
|
832 venkat.puvvada 1.108 try
833 {
|
834 marek 1.129 PEG_TRACE((
835 TRC_PROVIDERMANAGER,
836 Tracer::LEVEL3,
837 "CMPIProviderManager::handleCreateInstanceRequest"
838 " - Host name: %s Name space: %s Class name: %s",
839 (const char*) System::getHostName().getCString(),
840 (const char*) request->nameSpace.getString().getCString(),
841 (const char*)
842 request->newInstance.getPath().getClassName().getString().getCString()
843 ));
|
844 marek 1.63
845 // make target object path
846 CIMObjectPath objectPath(
847 System::getHostName(),
848 request->nameSpace,
849 request->newInstance.getPath().getClassName(),
850 request->newInstance.getPath().getKeyBindings());
|
851 venkat.puvvada 1.108 request->newInstance.setPath(objectPath);
|
852 marek 1.63
853 Boolean remote=false;
|
854 venkat.puvvada 1.132 OpProviderHolder ph;
|
855 marek 1.63
856 // resolve provider name
|
857 venkat.puvvada 1.108 ProviderIdContainer pidc =
858 request->operationContext.get(ProviderIdContainer::NAME);
|
859 marek 1.63 ProviderName name = _resolveProviderName(pidc);
860
|
861 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
862 {
863 ph = providerManager.getRemoteProvider(
864 name.getLocation(), name.getLogicalName());
865 }
866 else
867 {
868 // get cached or load new provider module
869 ph = providerManager.getProvider(
870 name.getPhysicalName(), name.getLogicalName());
|
871 marek 1.63 }
872
873 // convert arguments
874 OperationContext context;
875
876 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
877 venkat.puvvada 1.108 context.insert(
878 request->operationContext.get(AcceptLanguageListContainer::NAME));
879 context.insert(
880 request->operationContext.get(ContentLanguageListContainer::NAME));
|
881 marek 1.63 // forward request
882 CMPIProvider & pr=ph.GetProvider();
883
|
884 ms.aruran 1.115 PEG_TRACE_STRING(
885 TRC_PROVIDERMANAGER,
886 Tracer::LEVEL4,
|
887 marek 1.63 "Calling provider.createInstance: " +
888 ph.GetProvider().getName());
889
890 CMPIStatus rc={CMPI_RC_OK,NULL};
891 CMPI_ContextOnStack eCtx(context);
892 CMPI_ObjectPathOnStack eRef(objectPath);
|
893 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
|
894 marek 1.63 CMPI_InstanceOnStack eInst(request->newInstance);
|
895 venkat.puvvada 1.132 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
896 marek 1.63
|
897 marek 1.124 _setupCMPIContexts(
|
898 venkat.puvvada 1.108 &eCtx,
|
899 marek 1.124 &context,
900 &pidc,
901 request->nameSpace.getString(),
902 remote,
903 false,
904 false,
905 true);
|
906 marek 1.63
907 CMPIProvider::pm_service_op_lock op_lock(&pr);
908
|
909 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
910 marek 1.63
|
911 kumpf 1.92 {
912 StatProviderTimeMeasurement providerTime(response);
|
913 marek 1.63
|
914 venkat.puvvada 1.132 rc = pr.getInstMI()->ft->createInstance(
915 pr.getInstMI(),
916 &eCtx,
917 &eRes,
918 &eRef,
919 &eInst);
|
920 kumpf 1.92 }
|
921 marek 1.63
|
922 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
923 // Do this before checking rc from provider to throw exception in case
924 // rc.msg is also localized.
925 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
926 venkat.puvvada 1.108 CMPIData cldata =
927 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
928 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
929 {
930 response->operationContext.set(
931 ContentLanguageListContainer(
|
932 venkat.puvvada 1.108 ContentLanguageList(
933 LanguageParser::parseContentLanguageHeader(
934 CMGetCharPtr(cldata.value.string)))));
|
935 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
936 dave.sudlik 1.99 }
937
|
938 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
939 dave.sudlik 1.102 {
|
940 venkat.puvvada 1.108 CIMException cimException(
941 (CIMStatusCode)rc.rc,
942 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
943
944 if (eRes.resError)
945 {
946 for (CMPI_Error* currErr=eRes.resError;
|
947 dave.sudlik 1.102 currErr!=NULL;
948 currErr=currErr->nextError)
|
949 venkat.puvvada 1.108 {
950 cimException.addError(
951 ((CIMError*)currErr->hdl)->getInstance());
952 }
953 }
954 throw cimException;
|
955 dave.sudlik 1.102 }
|
956 marek 1.63 }
957 HandlerCatch(handler);
958
959 PEG_METHOD_EXIT();
960
961 return(response);
962 }
963
|
964 venkat.puvvada 1.108 Message * CMPIProviderManager::handleModifyInstanceRequest(
965 const Message * message)
|
966 marek 1.63 {
|
967 ms.aruran 1.115 PEG_METHOD_ENTER(
968 TRC_PROVIDERMANAGER,
969 "CMPIProviderManager::handleModifyInstanceRequest()");
|
970 marek 1.63
|
971 kumpf 1.92 HandlerIntro(ModifyInstance,message,request,response,handler);
|
972 venkat.puvvada 1.108 try
973 {
|
974 marek 1.129 PEG_TRACE((
975 TRC_PROVIDERMANAGER,
976 Tracer::LEVEL3,
977 "CMPIProviderManager::handleModifyInstanceRequest"
978 " - Host name: %s Name space: %s Class name: %s",
979 (const char*) System::getHostName().getCString(),
980 (const char*) request->nameSpace.getString().getCString(),
981 (const char*) request->modifiedInstance.\
982 getPath().getClassName().getString().getCString()));
|
983 marek 1.63
984 // make target object path
985 CIMObjectPath objectPath(
986 System::getHostName(),
987 request->nameSpace,
988 request->modifiedInstance.getPath ().getClassName(),
989 request->modifiedInstance.getPath ().getKeyBindings());
990
991 Boolean remote=false;
|
992 venkat.puvvada 1.132 OpProviderHolder ph;
|
993 marek 1.63
994 // resolve provider name
|
995 venkat.puvvada 1.108 ProviderIdContainer pidc =
996 request->operationContext.get(ProviderIdContainer::NAME);
|
997 marek 1.63 ProviderName name = _resolveProviderName(pidc);
998
|
999 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
1000 {
1001 ph = providerManager.getRemoteProvider(
1002 name.getLocation(), name.getLogicalName());
|
1003 marek 1.63 }
|
1004 venkat.puvvada 1.108 else
1005 {
1006 // get cached or load new provider module
1007 ph = providerManager.getProvider(
1008 name.getPhysicalName(), name.getLogicalName());
|
1009 marek 1.63 }
1010
1011 // convert arguments
1012 OperationContext context;
1013
1014 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
1015 venkat.puvvada 1.108 context.insert(
1016 request->operationContext.get(AcceptLanguageListContainer::NAME));
1017 context.insert(
1018 request->operationContext.get(ContentLanguageListContainer::NAME));
|
1019 marek 1.63 // forward request
1020 CMPIProvider & pr=ph.GetProvider();
1021
|
1022 ms.aruran 1.115 PEG_TRACE_STRING(
1023 TRC_PROVIDERMANAGER,
1024 Tracer::LEVEL4,
|
1025 marek 1.63 "Calling provider.modifyInstance: " + pr.getName());
1026
1027 CMPIStatus rc={CMPI_RC_OK,NULL};
1028 CMPI_ContextOnStack eCtx(context);
1029 CMPI_ObjectPathOnStack eRef(objectPath);
|
1030 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
|
1031 marek 1.63 CMPI_InstanceOnStack eInst(request->modifiedInstance);
|
1032 venkat.puvvada 1.132 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
1033 marek 1.63
1034 CMPIPropertyList props(request->propertyList);
1035
|
1036 marek 1.124 _setupCMPIContexts(
|
1037 venkat.puvvada 1.108 &eCtx,
|
1038 marek 1.124 &context,
1039 &pidc,
1040 request->nameSpace.getString(),
1041 remote,
1042 request->includeQualifiers,
1043 false,
1044 true);
|
1045 marek 1.63
1046 CMPIProvider::pm_service_op_lock op_lock(&pr);
1047
|
1048 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
1049 marek 1.63
|
1050 kumpf 1.92 {
1051 StatProviderTimeMeasurement providerTime(response);
|
1052 marek 1.63
|
1053 venkat.puvvada 1.132 rc = pr.getInstMI()->ft->modifyInstance(
1054 pr.getInstMI(),
1055 &eCtx,
1056 &eRes,
1057 &eRef,
1058 &eInst,
|
1059 kumpf 1.92 (const char **)props.getList());
1060 }
|
1061 marek 1.63
|
1062 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
1063 // Do this before checking rc from provider to throw exception in case
1064 // rc.msg is also localized.
1065 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
1066 venkat.puvvada 1.108 CMPIData cldata =
1067 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
1068 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
1069 {
1070 response->operationContext.set(
1071 ContentLanguageListContainer(
|
1072 venkat.puvvada 1.108 ContentLanguageList(
1073 LanguageParser::parseContentLanguageHeader(
1074 CMGetCharPtr(cldata.value.string)))));
|
1075 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
1076 dave.sudlik 1.99 }
1077
|
1078 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
1079 dave.sudlik 1.102 {
|
1080 venkat.puvvada 1.108 CIMException cimException(
1081 (CIMStatusCode)rc.rc,
1082 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1083
1084 if (eRes.resError)
1085 {
1086 for (CMPI_Error* currErr=eRes.resError;
|
1087 dave.sudlik 1.102 currErr!=NULL;
1088 currErr=currErr->nextError)
|
1089 venkat.puvvada 1.108 {
1090 cimException.addError(
1091 ((CIMError*)currErr->hdl)->getInstance());
1092 }
1093 }
1094 throw cimException;
|
1095 dave.sudlik 1.102 }
|
1096 marek 1.63 }
1097 HandlerCatch(handler);
1098
1099 PEG_METHOD_EXIT();
1100
1101 return(response);
1102 }
1103
|
1104 venkat.puvvada 1.108 Message * CMPIProviderManager::handleDeleteInstanceRequest(
1105 const Message * message)
|
1106 marek 1.63 {
|
1107 ms.aruran 1.115 PEG_METHOD_ENTER(
1108 TRC_PROVIDERMANAGER,
1109 "CMPIProviderManager::handleDeleteInstanceRequest()");
|
1110 marek 1.63
|
1111 kumpf 1.92 HandlerIntro(DeleteInstance,message,request,response,handler);
|
1112 venkat.puvvada 1.108 try
1113 {
|
1114 marek 1.129 PEG_TRACE((
1115 TRC_PROVIDERMANAGER,
1116 Tracer::LEVEL3,
1117 "CMPIProviderManager::handleDeleteInstanceRequest"
1118 " - Host name: %s Name space: %s Class name: %s",
1119 (const char*) System::getHostName().getCString(),
1120 (const char*) request->nameSpace.getString().getCString(),
1121 (const char*)
1122 request->instanceName.getClassName().getString().getCString()));
1123
|
1124 marek 1.63 // make target object path
1125 CIMObjectPath objectPath(
1126 System::getHostName(),
1127 request->nameSpace,
1128 request->instanceName.getClassName(),
1129 request->instanceName.getKeyBindings());
1130
1131 Boolean remote=false;
|
1132 venkat.puvvada 1.132 OpProviderHolder ph;
|
1133 marek 1.63
1134 // resolve provider name
|
1135 venkat.puvvada 1.108 ProviderIdContainer pidc =
1136 request->operationContext.get(ProviderIdContainer::NAME);
|
1137 marek 1.63 ProviderName name = _resolveProviderName(pidc);
1138
|
1139 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
1140 {
1141 ph = providerManager.getRemoteProvider(
1142 name.getLocation(), name.getLogicalName());
|
1143 marek 1.63 }
|
1144 venkat.puvvada 1.108 else
1145 {
1146 // get cached or load new provider module
1147 ph = providerManager.getProvider(
1148 name.getPhysicalName(), name.getLogicalName());
|
1149 marek 1.63 }
1150
1151 // convert arguments
1152 OperationContext context;
1153
1154 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
1155 venkat.puvvada 1.108 context.insert(
1156 request->operationContext.get(AcceptLanguageListContainer::NAME));
1157 context.insert(
1158 request->operationContext.get(ContentLanguageListContainer::NAME));
|
1159 marek 1.63 // forward request
1160 CMPIProvider & pr=ph.GetProvider();
1161
|
1162 ms.aruran 1.115 PEG_TRACE_STRING(
1163 TRC_PROVIDERMANAGER,
1164 Tracer::LEVEL4,
|
1165 marek 1.63 "Calling provider.deleteInstance: " + pr.getName());
1166
1167 CMPIStatus rc={CMPI_RC_OK,NULL};
1168 CMPI_ContextOnStack eCtx(context);
1169 CMPI_ObjectPathOnStack eRef(objectPath);
|
1170 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
1171 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
1172 marek 1.63
|
1173 marek 1.124 _setupCMPIContexts(
|
1174 venkat.puvvada 1.108 &eCtx,
|
1175 marek 1.124 &context,
1176 &pidc,
1177 request->nameSpace.getString(),
1178 remote,
1179 false,
1180 false,
1181 true);
|
1182 marek 1.63
1183 CMPIProvider::pm_service_op_lock op_lock(&pr);
1184
|
1185 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
1186 marek 1.63
|
1187 kumpf 1.92 {
1188 StatProviderTimeMeasurement providerTime(response);
|
1189 marek 1.63
|
1190 venkat.puvvada 1.132 rc = pr.getInstMI()->ft->deleteInstance(
1191 pr.getInstMI(),
1192 &eCtx,
1193 &eRes,
1194 &eRef);
|
1195 kumpf 1.92 }
|
1196 marek 1.63
|
1197 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
1198 // Do this before checking rc from provider to throw exception in case
1199 // rc.msg is also localized.
1200 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
1201 venkat.puvvada 1.108 CMPIData cldata =
1202 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
1203 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
1204 {
1205 response->operationContext.set(
1206 ContentLanguageListContainer(
|
1207 venkat.puvvada 1.108 ContentLanguageList(
1208 LanguageParser::parseContentLanguageHeader(
1209 CMGetCharPtr(cldata.value.string)))));
|
1210 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
1211 dave.sudlik 1.99 }
1212
|
1213 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
1214 dave.sudlik 1.102 {
|
1215 venkat.puvvada 1.108 CIMException cimException(
1216 (CIMStatusCode)rc.rc,
1217 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1218
1219 if (eRes.resError)
1220 {
1221 for (CMPI_Error* currErr=eRes.resError;
|
1222 dave.sudlik 1.102 currErr!=NULL;
1223 currErr=currErr->nextError)
|
1224 venkat.puvvada 1.108 {
1225 cimException.addError(
1226 ((CIMError*)currErr->hdl)->getInstance());
1227 }
1228 }
1229 throw cimException;
|
1230 dave.sudlik 1.102 }
|
1231 marek 1.63 }
1232 HandlerCatch(handler);
1233
1234 PEG_METHOD_EXIT();
1235
1236 return(response);
1237 }
1238
1239 Message * CMPIProviderManager::handleExecQueryRequest(const Message * message)
1240 {
|
1241 ms.aruran 1.115 PEG_METHOD_ENTER(
1242 TRC_PROVIDERMANAGER,
1243 "CMPIProviderManager::handleExecQueryRequest()");
|
1244 marek 1.63
|
1245 kumpf 1.92 HandlerIntro(ExecQuery,message,request,response,handler);
|
1246 marek 1.63
|
1247 venkat.puvvada 1.108 try
1248 {
|
1249 marek 1.129 PEG_TRACE((
1250 TRC_PROVIDERMANAGER,
1251 Tracer::LEVEL3,
1252 "CMPIProviderManager::ExecQueryRequest"
1253 " - Host name: %s Name space: %s Class name: %s",
1254 (const char*) System::getHostName().getCString(),
1255 (const char*) request->nameSpace.getString().getCString(),
1256 (const char*) request->className.getString().getCString()));
|
1257 marek 1.63
1258 // make target object path
1259 CIMObjectPath objectPath(
1260 System::getHostName(),
1261 request->nameSpace,
1262 request->className);
1263
1264 Boolean remote=false;
1265
|
1266 venkat.puvvada 1.132 OpProviderHolder ph;
|
1267 marek 1.63
1268 // resolve provider name
|
1269 venkat.puvvada 1.108 ProviderIdContainer pidc =
1270 request->operationContext.get(ProviderIdContainer::NAME);
|
1271 marek 1.63 ProviderName name = _resolveProviderName(pidc);
1272
|
1273 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
1274 {
1275 ph = providerManager.getRemoteProvider(
1276 name.getLocation(), name.getLogicalName());
|
1277 marek 1.63 }
|
1278 venkat.puvvada 1.108 else
1279 {
1280 // get cached or load new provider module
1281 ph = providerManager.getProvider(
1282 name.getPhysicalName(), name.getLogicalName());
|
1283 marek 1.63 }
1284
1285 // convert arguments
1286 OperationContext context;
1287
1288 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
1289 venkat.puvvada 1.108 context.insert(
1290 request->operationContext.get(AcceptLanguageListContainer::NAME));
1291 context.insert(
1292 request->operationContext.get(ContentLanguageListContainer::NAME));
|
1293 marek 1.63
1294 // forward request
1295 CMPIProvider & pr=ph.GetProvider();
1296
|
1297 ms.aruran 1.115 PEG_TRACE_STRING(
1298 TRC_PROVIDERMANAGER,
1299 Tracer::LEVEL4,
|
1300 marek 1.63 "Calling provider.execQuery: " + pr.getName());
1301
1302 const char **props=NULL;
1303
1304 CMPIStatus rc={CMPI_RC_OK,NULL};
1305 CMPI_ContextOnStack eCtx(context);
1306 CMPI_ObjectPathOnStack eRef(objectPath);
|
1307 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
1308 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
1309 marek 1.63
1310 const CString queryLan=request->queryLanguage.getCString();
1311 const CString query=request->query.getCString();
1312
|
1313 marek 1.124 _setupCMPIContexts(
|
1314 venkat.puvvada 1.108 &eCtx,
|
1315 marek 1.124 &context,
1316 &pidc,
1317 request->nameSpace.getString(),
1318 remote,
1319 false,
1320 false,
1321 true);
|
1322 marek 1.63
1323 CMPIProvider::pm_service_op_lock op_lock(&pr);
1324
|
1325 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
1326 marek 1.63
|
1327 kumpf 1.92 {
1328 StatProviderTimeMeasurement providerTime(response);
|
1329 marek 1.63
|
1330 venkat.puvvada 1.132 rc = pr.getInstMI()->ft->execQuery(
1331 pr.getInstMI(),
1332 &eCtx,
1333 &eRes,
1334 &eRef,
1335 CHARS(queryLan),
1336 CHARS(query));
|
1337 kumpf 1.92 }
|
1338 marek 1.63
|
1339 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
1340 // Do this before checking rc from provider to throw exception in case
1341 // rc.msg is also localized.
1342 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
1343 venkat.puvvada 1.108 CMPIData cldata =
1344 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
1345 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
1346 {
1347 response->operationContext.set(
1348 ContentLanguageListContainer(
|
1349 venkat.puvvada 1.108 ContentLanguageList(
1350 LanguageParser::parseContentLanguageHeader(
1351 CMGetCharPtr(cldata.value.string)))));
|
1352 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
1353 dave.sudlik 1.99 }
1354
|
1355 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
1356 dave.sudlik 1.102 {
|
1357 venkat.puvvada 1.108 CIMException cimException(
1358 (CIMStatusCode)rc.rc,
1359 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1360
1361 if (eRes.resError)
1362 {
1363 for (CMPI_Error* currErr=eRes.resError;
|
1364 dave.sudlik 1.102 currErr!=NULL;
1365 currErr=currErr->nextError)
|
1366 venkat.puvvada 1.108 {
1367 cimException.addError(
1368 ((CIMError*)currErr->hdl)->getInstance());
1369 }
1370 }
1371 throw cimException;
|
1372 dave.sudlik 1.102 }
1373
|
1374 marek 1.63 }
1375 HandlerCatch(handler);
1376
1377 PEG_METHOD_EXIT();
1378
1379 return(response);
1380 }
1381
1382 Message * CMPIProviderManager::handleAssociatorsRequest(const Message * message)
1383 {
|
1384 ms.aruran 1.115 PEG_METHOD_ENTER(
1385 TRC_PROVIDERMANAGER,
1386 "CMPIProviderManager::handleAssociatorsRequest()");
|
1387 marek 1.63
|
1388 kumpf 1.92 HandlerIntro(Associators,message,request,response,handler);
|
1389 venkat.puvvada 1.108 try
1390 {
|
1391 marek 1.129 PEG_TRACE((
1392 TRC_PROVIDERMANAGER,
1393 Tracer::LEVEL3,
1394 "CMPIProviderManager::handleAssociatorsRequest"
1395 " - Host name: %s Name space: %s Class name: %s",
1396 (const char*) System::getHostName().getCString(),
1397 (const char*) request->nameSpace.getString().getCString(),
1398 (const char*)
1399 request->objectName.getClassName().getString().getCString()));
|
1400 marek 1.63
1401 // make target object path
1402 CIMObjectPath objectPath(
1403 System::getHostName(),
1404 request->nameSpace,
1405 request->objectName.getClassName());
1406
1407 objectPath.setKeyBindings(request->objectName.getKeyBindings());
1408
1409 CIMObjectPath assocPath(
1410 System::getHostName(),
1411 request->nameSpace,
1412 request->assocClass.getString());
1413
1414 Boolean remote=false;
1415
|
1416 venkat.puvvada 1.132 OpProviderHolder ph;
|
1417 marek 1.63
1418 // resolve provider name
|
1419 venkat.puvvada 1.108 ProviderIdContainer pidc =
1420 request->operationContext.get(ProviderIdContainer::NAME);
|
1421 marek 1.63 ProviderName name = _resolveProviderName(pidc);
1422
|
1423 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
1424 {
1425 ph = providerManager.getRemoteProvider(
1426 name.getLocation(), name.getLogicalName());
|
1427 marek 1.63 }
|
1428 venkat.puvvada 1.108 else
1429 {
1430 // get cached or load new provider module
1431 ph = providerManager.getProvider(
1432 name.getPhysicalName(), name.getLogicalName());
|
1433 marek 1.63 }
1434
|
1435 venkat.puvvada 1.108 // convert arguments
|
1436 marek 1.63 OperationContext context;
1437
1438 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
1439 venkat.puvvada 1.108 context.insert(
1440 request->operationContext.get(AcceptLanguageListContainer::NAME));
1441 context.insert(
1442 request->operationContext.get(ContentLanguageListContainer::NAME));
|
1443 marek 1.63
1444 // forward request
1445 CMPIProvider & pr=ph.GetProvider();
1446
|
1447 a.dunfey 1.85 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
|
1448 venkat.puvvada 1.121 AutoPtr<NormalizerContext> tmpNormalizerContext(
|
1449 venkat.puvvada 1.132 new CIMOMHandleContext(*pr.getCIMOMHandle()));
|
1450 venkat.puvvada 1.121 request->operationContext.insert(
1451 NormalizerContextContainer(tmpNormalizerContext));
1452 #endif
|
1453 a.dunfey 1.85
|
1454 ms.aruran 1.115 PEG_TRACE_STRING(
1455 TRC_PROVIDERMANAGER,
1456 Tracer::LEVEL4,
|
1457 marek 1.63 "Calling provider.associators: " + pr.getName());
1458
|
1459 ms.aruran 1.115 PEG_TRACE_STRING(
1460 TRC_PROVIDERMANAGER,
1461 Tracer::LEVEL4,
1462 String("--- CMPIProviderManager::associators < role: >" ) +
1463 request->role +
1464 request->assocClass.getString());
|
1465 marek 1.63
1466 CMPIStatus rc={CMPI_RC_OK,NULL};
1467 CMPI_ContextOnStack eCtx(context);
1468 CMPI_ObjectPathOnStack eRef(objectPath);
|
1469 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
1470 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
1471 marek 1.63 const CString aClass=request->assocClass.getString().getCString();
1472 const CString rClass=request->resultClass.getString().getCString();
1473 const CString rRole=request->role.getCString();
1474 const CString resRole=request->resultRole.getCString();
1475
1476 CMPIPropertyList props(request->propertyList);
1477
|
1478 marek 1.124 _setupCMPIContexts(
|
1479 venkat.puvvada 1.108 &eCtx,
|
1480 marek 1.124 &context,
1481 &pidc,
1482 request->nameSpace.getString(),
1483 remote,
1484 request->includeQualifiers,
1485 request->includeClassOrigin,
1486 true);
|
1487 marek 1.63
1488 CMPIProvider::pm_service_op_lock op_lock(&pr);
1489
|
1490 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
1491 marek 1.63
|
1492 kumpf 1.92 {
1493 StatProviderTimeMeasurement providerTime(response);
|
1494 marek 1.63
|
1495 venkat.puvvada 1.132 rc = pr.getAssocMI()->ft->associators(
1496 pr.getAssocMI(),
1497 &eCtx,
1498 &eRes,
1499 &eRef,
1500 CHARS(aClass),
1501 CHARS(rClass),
1502 CHARS(rRole),
1503 CHARS(resRole),
|
1504 kumpf 1.92 (const char **)props.getList());
1505 }
|
1506 marek 1.63
|
1507 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
1508 // Do this before checking rc from provider to throw exception in case
1509 // rc.msg is also localized.
1510 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
1511 venkat.puvvada 1.108 CMPIData cldata = eCtx.ft->getEntry (
1512 &eCtx,
1513 CMPIContentLanguage,
1514 &tmprc);
|
1515 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
1516 {
1517 response->operationContext.set(
1518 ContentLanguageListContainer(
|
1519 venkat.puvvada 1.108 ContentLanguageList(
1520 LanguageParser::parseContentLanguageHeader(
1521 CMGetCharPtr(cldata.value.string)))));
|
1522 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
1523 dave.sudlik 1.99 }
1524
|
1525 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
1526 dave.sudlik 1.102 {
|
1527 venkat.puvvada 1.108 CIMException cimException(
1528 (CIMStatusCode)rc.rc,
1529 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1530
1531 if (eRes.resError)
1532 {
1533 for (CMPI_Error* currErr=eRes.resError;
|
1534 dave.sudlik 1.102 currErr!=NULL;
1535 currErr=currErr->nextError)
|
1536 venkat.puvvada 1.108 {
1537 cimException.addError(
1538 ((CIMError*)currErr->hdl)->getInstance());
1539 }
1540 }
1541 throw cimException;
|
1542 dave.sudlik 1.102 }
|
1543 marek 1.63 }
1544 HandlerCatch(handler);
1545
1546 PEG_METHOD_EXIT();
1547
1548 return(response);
1549 }
1550
|
1551 venkat.puvvada 1.108 Message * CMPIProviderManager::handleAssociatorNamesRequest(
1552 const Message * message)
|
1553 marek 1.63 {
|
1554 ms.aruran 1.115 PEG_METHOD_ENTER(
1555 TRC_PROVIDERMANAGER,
1556 "CMPIProviderManager::handleAssociatorNamesRequest()");
|
1557 marek 1.63
|
1558 kumpf 1.92 HandlerIntro(AssociatorNames,message,request,response,handler);
|
1559 venkat.puvvada 1.108 try
1560 {
|
1561 marek 1.129 PEG_TRACE((
1562 TRC_PROVIDERMANAGER,
1563 Tracer::LEVEL3,
1564 "CMPIProviderManager::handleAssociatorNamesRequest"
1565 " - Host name: %s Name space: %s Class name: %s",
1566 (const char*) System::getHostName().getCString(),
1567 (const char*) request->nameSpace.getString().getCString(),
1568 (const char*)
1569 request->objectName.getClassName().getString().getCString()));
|
1570 marek 1.63
1571 // make target object path
1572 CIMObjectPath objectPath(
1573 System::getHostName(),
1574 request->nameSpace,
1575 request->objectName.getClassName());
1576
1577 objectPath.setKeyBindings(request->objectName.getKeyBindings());
1578
1579 CIMObjectPath assocPath(
1580 System::getHostName(),
1581 request->nameSpace,
1582 request->assocClass.getString());
1583
1584 Boolean remote=false;
|
1585 venkat.puvvada 1.132 OpProviderHolder ph;
|
1586 marek 1.63
1587 // resolve provider name
|
1588 venkat.puvvada 1.108 ProviderIdContainer pidc =
1589 request->operationContext.get(ProviderIdContainer::NAME);
|
1590 marek 1.63 ProviderName name = _resolveProviderName(pidc);
1591
|
1592 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
1593 {
1594 ph = providerManager.getRemoteProvider(
1595 name.getLocation(), name.getLogicalName());
|
1596 marek 1.63 }
|
1597 venkat.puvvada 1.108 else
1598 {
1599 // get cached or load new provider module
1600 ph = providerManager.getProvider(
1601 name.getPhysicalName(), name.getLogicalName());
|
1602 marek 1.63 }
1603
1604 // convert arguments
1605 OperationContext context;
1606
1607 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
1608 venkat.puvvada 1.108 context.insert(
1609 request->operationContext.get(AcceptLanguageListContainer::NAME));
1610 context.insert(
1611 request->operationContext.get(ContentLanguageListContainer::NAME));
|
1612 marek 1.63
1613 // forward request
1614 CMPIProvider & pr=ph.GetProvider();
1615
|
1616 ms.aruran 1.115 PEG_TRACE_STRING(
1617 TRC_PROVIDERMANAGER,
1618 Tracer::LEVEL4,
|
1619 marek 1.63 "Calling provider.associatorNames: " + pr.getName());
1620
|
1621 ms.aruran 1.115 PEG_TRACE_STRING(
1622 TRC_PROVIDERMANAGER,
1623 Tracer::LEVEL4,
1624 String("--- CMPIProviderManager::associatorNames -- role: ") +
1625 request->role + "< aCls " + request->assocClass.getString());
|
1626 marek 1.63
1627 CMPIStatus rc={CMPI_RC_OK,NULL};
1628 CMPI_ContextOnStack eCtx(context);
1629 CMPI_ObjectPathOnStack eRef(objectPath);
|
1630 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
1631 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
1632 marek 1.63 const CString aClass=request->assocClass.getString().getCString();
1633 const CString rClass=request->resultClass.getString().getCString();
1634 const CString rRole=request->role.getCString();
1635 const CString resRole=request->resultRole.getCString();
1636
|
1637 marek 1.124 _setupCMPIContexts(
|
1638 venkat.puvvada 1.108 &eCtx,
|
1639 marek 1.124 &context,
1640 &pidc,
1641 request->nameSpace.getString(),
1642 remote,
1643 false,
1644 false,
1645 true);
|
1646 marek 1.63
1647 CMPIProvider::pm_service_op_lock op_lock(&pr);
1648
|
1649 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
1650 marek 1.63
|
1651 kumpf 1.92 {
1652 StatProviderTimeMeasurement providerTime(response);
|
1653 marek 1.63
|
1654 venkat.puvvada 1.132 rc = pr.getAssocMI()->ft->associatorNames(
1655 pr.getAssocMI(),
1656 &eCtx,
1657 &eRes,
1658 &eRef,
1659 CHARS(aClass),
1660 CHARS(rClass),
1661 CHARS(rRole),
1662 CHARS(resRole));
|
1663 kumpf 1.92 }
|
1664 marek 1.63
|
1665 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
1666 // Do this before checking rc from provider to throw exception in case
1667 // rc.msg is also localized.
1668 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
1669 venkat.puvvada 1.108 CMPIData cldata =
1670 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
1671 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
1672 {
1673 response->operationContext.set(
1674 ContentLanguageListContainer(
|
1675 venkat.puvvada 1.108 ContentLanguageList(
1676 LanguageParser::parseContentLanguageHeader(
1677 CMGetCharPtr(cldata.value.string)))));
|
1678 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
1679 dave.sudlik 1.99 }
1680
|
1681 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
1682 dave.sudlik 1.102 {
|
1683 venkat.puvvada 1.108 CIMException cimException(
1684 (CIMStatusCode)rc.rc,
1685 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1686
1687 if (eRes.resError)
1688 {
1689 for (CMPI_Error* currErr=eRes.resError;
|
1690 dave.sudlik 1.102 currErr!=NULL;
1691 currErr=currErr->nextError)
|
1692 venkat.puvvada 1.108 {
1693 cimException.addError(
1694 ((CIMError*)currErr->hdl)->getInstance());
1695 }
1696 }
1697 throw cimException;
|
1698 dave.sudlik 1.102 }
|
1699 marek 1.63 }
1700 HandlerCatch(handler);
1701
1702 PEG_METHOD_EXIT();
1703
1704 return(response);
1705 }
1706
1707 Message * CMPIProviderManager::handleReferencesRequest(const Message * message)
1708 {
|
1709 ms.aruran 1.115 PEG_METHOD_ENTER(
1710 TRC_PROVIDERMANAGER,
1711 "CMPIProviderManager::handleReferencesRequest()");
|
1712 marek 1.63
|
1713 kumpf 1.92 HandlerIntro(References,message,request,response,handler);
|
1714 venkat.puvvada 1.108 try
1715 {
|
1716 marek 1.129 PEG_TRACE((
1717 TRC_PROVIDERMANAGER,
1718 Tracer::LEVEL3,
1719 "CMPIProviderManager::handleReferencesRequest"
1720 " - Host name: %s Name space: %s Class name: %s",
1721 (const char*) System::getHostName().getCString(),
1722 (const char*) request->nameSpace.getString().getCString(),
1723 (const char*)
1724 request->objectName.getClassName().getString().getCString()));
|
1725 marek 1.63
1726 // make target object path
1727 CIMObjectPath objectPath(
1728 System::getHostName(),
1729 request->nameSpace,
1730 request->objectName.getClassName());
1731
1732 objectPath.setKeyBindings(request->objectName.getKeyBindings());
1733
1734 CIMObjectPath resultPath(
1735 System::getHostName(),
1736 request->nameSpace,
1737 request->resultClass.getString());
1738
1739 Boolean remote=false;
|
1740 venkat.puvvada 1.132 OpProviderHolder ph;
|
1741 marek 1.63
1742 // resolve provider name
|
1743 venkat.puvvada 1.108 ProviderIdContainer pidc =
1744 request->operationContext.get(ProviderIdContainer::NAME);
|
1745 marek 1.63 ProviderName name = _resolveProviderName(pidc);
1746
|
1747 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
1748 {
1749 ph = providerManager.getRemoteProvider(
1750 name.getLocation(), name.getLogicalName());
|
1751 marek 1.63 }
|
1752 venkat.puvvada 1.108 else
1753 {
1754 // get cached or load new provider module
1755 ph = providerManager.getProvider(
1756 name.getPhysicalName(), name.getLogicalName());
|
1757 marek 1.63 }
1758
1759 // convert arguments
1760 OperationContext context;
1761
1762 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
1763 venkat.puvvada 1.108 context.insert(
1764 request->operationContext.get(AcceptLanguageListContainer::NAME));
1765 context.insert(
1766 request->operationContext.get(ContentLanguageListContainer::NAME));
|
1767 marek 1.63 // forward request
1768 CMPIProvider & pr=ph.GetProvider();
1769
|
1770 a.dunfey 1.85 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
|
1771 venkat.puvvada 1.121 AutoPtr<NormalizerContext> tmpNormalizerContext(
|
1772 venkat.puvvada 1.132 new CIMOMHandleContext(*pr.getCIMOMHandle()));
|
1773 venkat.puvvada 1.121 request->operationContext.insert(
1774 NormalizerContextContainer(tmpNormalizerContext));
1775 #endif
|
1776 a.dunfey 1.85
|
1777 ms.aruran 1.115 PEG_TRACE_STRING(
1778 TRC_PROVIDERMANAGER,
1779 Tracer::LEVEL4,
|
1780 marek 1.63 "Calling provider.references: " + pr.getName());
1781
|
1782 ms.aruran 1.115 PEG_TRACE_STRING(
1783 TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1784 String("--- CMPIProviderManager::references -- role:") +
1785 request->role + "< aCls " + request->resultClass.getString());
|
1786 marek 1.63
1787 CMPIStatus rc={CMPI_RC_OK,NULL};
1788 CMPI_ContextOnStack eCtx(context);
1789 CMPI_ObjectPathOnStack eRef(objectPath);
|
1790 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
1791 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
1792 marek 1.63 const CString rClass=request->resultClass.getString().getCString();
1793 const CString rRole=request->role.getCString();
1794
1795 CMPIPropertyList props(request->propertyList);
1796
|
1797 marek 1.124 _setupCMPIContexts(
|
1798 venkat.puvvada 1.108 &eCtx,
|
1799 marek 1.124 &context,
1800 &pidc,
1801 request->nameSpace.getString(),
1802 remote,
1803 request->includeQualifiers,
1804 request->includeClassOrigin,
1805 true);
|
1806 marek 1.63
1807 CMPIProvider::pm_service_op_lock op_lock(&pr);
1808
|
1809 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
1810 marek 1.63
|
1811 kumpf 1.92 {
1812 StatProviderTimeMeasurement providerTime(response);
|
1813 marek 1.63
|
1814 venkat.puvvada 1.132 rc = pr.getAssocMI()->ft->references(
1815 pr.getAssocMI(),
1816 &eCtx,
1817 &eRes,
1818 &eRef,
1819 CHARS(rClass),
1820 CHARS(rRole),
1821 (const char **)props.getList());
|
1822 kumpf 1.92 }
|
1823 marek 1.63
|
1824 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
1825 // Do this before checking rc from provider to throw exception in case
1826 // rc.msg is also localized.
1827 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
1828 venkat.puvvada 1.108 CMPIData cldata =
1829 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
1830 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
1831 {
1832 response->operationContext.set(
1833 ContentLanguageListContainer(
|
1834 venkat.puvvada 1.108 ContentLanguageList(
1835 LanguageParser::parseContentLanguageHeader(
1836 CMGetCharPtr(cldata.value.string)))));
|
1837 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
1838 dave.sudlik 1.99 }
1839
|
1840 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
1841 dave.sudlik 1.102 {
|
1842 venkat.puvvada 1.108 CIMException cimException(
1843 (CIMStatusCode)rc.rc,
1844 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1845
1846 if (eRes.resError)
1847 {
1848 for (CMPI_Error* currErr=eRes.resError;
|
1849 dave.sudlik 1.102 currErr!=NULL;
1850 currErr=currErr->nextError)
|
1851 venkat.puvvada 1.108 {
1852 cimException.addError(
1853 ((CIMError*)currErr->hdl)->getInstance());
1854 }
1855 }
1856 throw cimException;
|
1857 dave.sudlik 1.102 }
|
1858 marek 1.63 }
1859 HandlerCatch(handler);
1860
1861 PEG_METHOD_EXIT();
1862
1863 return(response);
1864 }
1865
|
1866 venkat.puvvada 1.108 Message * CMPIProviderManager::handleReferenceNamesRequest(
1867 const Message * message)
|
1868 marek 1.63 {
|
1869 ms.aruran 1.115 PEG_METHOD_ENTER(
1870 TRC_PROVIDERMANAGER,
1871 "CMPIProviderManager::handleReferenceNamesRequest()");
|
1872 marek 1.63
|
1873 kumpf 1.92 HandlerIntro(ReferenceNames,message,request,response,handler);
|
1874 venkat.puvvada 1.108 try
1875 {
|
1876 marek 1.129 PEG_TRACE((
1877 TRC_PROVIDERMANAGER,
1878 Tracer::LEVEL3,
1879 "CMPIProviderManager::handleReferenceNamesRequest"
1880 " - Host name: %s Name space: %s Class name: %s",
1881 (const char*) System::getHostName().getCString(),
1882 (const char*) request->nameSpace.getString().getCString(),
1883 (const char*)
1884 request->objectName.getClassName().getString().getCString()));
1885
|
1886 marek 1.63 // make target object path
1887 CIMObjectPath objectPath(
1888 System::getHostName(),
1889 request->nameSpace,
1890 request->objectName.getClassName());
1891
1892 objectPath.setKeyBindings(request->objectName.getKeyBindings());
1893
1894 CIMObjectPath resultPath(
1895 System::getHostName(),
1896 request->nameSpace,
1897 request->resultClass.getString());
1898
1899 Boolean remote=false;
|
1900 venkat.puvvada 1.132 OpProviderHolder ph;
|
1901 marek 1.63
1902 // resolve provider name
|
1903 venkat.puvvada 1.108 ProviderIdContainer pidc =
1904 request->operationContext.get(ProviderIdContainer::NAME);
|
1905 marek 1.63 ProviderName name = _resolveProviderName(pidc);
1906
|
1907 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
1908 {
1909 ph = providerManager.getRemoteProvider(
1910 name.getLocation(), name.getLogicalName());
|
1911 marek 1.63 }
|
1912 venkat.puvvada 1.108 else
1913 {
1914 // get cached or load new provider module
1915 ph = providerManager.getProvider(
1916 name.getPhysicalName(), name.getLogicalName());
|
1917 marek 1.63 }
1918
1919 // convert arguments
1920 OperationContext context;
1921
|
1922 venkat.puvvada 1.108 context.insert(request->operationContext.get(IdentityContainer::NAME));
1923 context.insert(
1924 request->operationContext.get(AcceptLanguageListContainer::NAME));
1925 context.insert(
1926 request->operationContext.get(ContentLanguageListContainer::NAME));
|
1927 marek 1.63 CMPIProvider & pr=ph.GetProvider();
1928
|
1929 ms.aruran 1.115 PEG_TRACE_STRING(
1930 TRC_PROVIDERMANAGER,
1931 Tracer::LEVEL4,
|
1932 marek 1.63 "Calling provider.referenceNames: " + pr.getName());
1933
|
1934 ms.aruran 1.115 PEG_TRACE_STRING(
1935 TRC_PROVIDERMANAGER,
1936 Tracer::LEVEL4,
1937 String("--- CMPIProviderManager::referenceNames -- role: ") +
1938 request->role + "< aCls " + request->resultClass.getString());
|
1939 marek 1.63
1940 CMPIStatus rc={CMPI_RC_OK,NULL};
1941 CMPI_ContextOnStack eCtx(context);
1942 CMPI_ObjectPathOnStack eRef(objectPath);
|
1943 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
1944 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
1945 marek 1.63 const CString rClass=request->resultClass.getString().getCString();
1946 const CString rRole=request->role.getCString();
1947
|
1948 marek 1.124 _setupCMPIContexts(
|
1949 venkat.puvvada 1.108 &eCtx,
|
1950 marek 1.124 &context,
1951 &pidc,
1952 request->nameSpace.getString(),
1953 remote,
1954 false,
1955 false,
1956 true);
|
1957 marek 1.63
1958 CMPIProvider::pm_service_op_lock op_lock(&pr);
1959
|
1960 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
1961 marek 1.63
|
1962 kumpf 1.92 {
1963 StatProviderTimeMeasurement providerTime(response);
|
1964 marek 1.63
|
1965 venkat.puvvada 1.132 rc = pr.getAssocMI()->ft->referenceNames(
1966 pr.getAssocMI(),
1967 &eCtx,
1968 &eRes,
1969 &eRef,
1970 CHARS(rClass),
1971 CHARS(rRole));
|
1972 kumpf 1.92 }
|
1973 marek 1.63
|
1974 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
1975 // Do this before checking rc from provider to throw exception in case
1976 // rc.msg is also localized.
1977 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
1978 venkat.puvvada 1.108 CMPIData cldata =
1979 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
1980 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
1981 {
1982 response->operationContext.set(
1983 ContentLanguageListContainer(
|
1984 venkat.puvvada 1.108 ContentLanguageList(
1985 LanguageParser::parseContentLanguageHeader(
1986 CMGetCharPtr(cldata.value.string)))));
|
1987 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
1988 dave.sudlik 1.99 }
1989
|
1990 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
1991 dave.sudlik 1.102 {
|
1992 venkat.puvvada 1.108 CIMException cimException(
1993 (CIMStatusCode)rc.rc,
1994 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1995
1996 if (eRes.resError)
1997 {
1998 for (CMPI_Error* currErr=eRes.resError;
|
1999 dave.sudlik 1.102 currErr!=NULL;
2000 currErr=currErr->nextError)
|
2001 venkat.puvvada 1.108 {
2002 cimException.addError(
2003 ((CIMError*)currErr->hdl)->getInstance());
2004 }
2005 }
2006 throw cimException;
|
2007 dave.sudlik 1.102 }
|
2008 marek 1.63 }
2009 HandlerCatch(handler);
2010
2011 PEG_METHOD_EXIT();
2012
2013 return(response);
2014 }
2015
|
2016 venkat.puvvada 1.108 Message * CMPIProviderManager::handleInvokeMethodRequest(
2017 const Message * message)
|
2018 marek 1.63 {
|
2019 ms.aruran 1.115 PEG_METHOD_ENTER(
2020 TRC_PROVIDERMANAGER,
2021 "CMPIProviderManager::handleInvokeMethodRequest()");
|
2022 marek 1.63
|
2023 kumpf 1.92 HandlerIntro(InvokeMethod,message,request,response,handler);
|
2024 venkat.puvvada 1.108 try
2025 {
|
2026 marek 1.129 PEG_TRACE((
2027 TRC_PROVIDERMANAGER,
2028 Tracer::LEVEL3,
2029 "CMPIProviderManager::handleInvokeMethodRequest"
2030 " - Host name: %s Name space: %s Class name: %s",
2031 (const char*) System::getHostName().getCString(),
2032 (const char*) request->nameSpace.getString().getCString(),
2033 (const char*)
2034 request->instanceName.getClassName().getString().getCString()));
|
2035 marek 1.63
2036 // make target object path
2037 CIMObjectPath objectPath(
2038 System::getHostName(),
2039 request->nameSpace,
2040 request->instanceName.getClassName(),
2041 request->instanceName.getKeyBindings());
2042
2043 Boolean remote=false;
|
2044 venkat.puvvada 1.132 OpProviderHolder ph;
|
2045 marek 1.63
2046 // resolve provider name
|
2047 venkat.puvvada 1.108 ProviderIdContainer pidc =
2048 request->operationContext.get(ProviderIdContainer::NAME);
|
2049 marek 1.63 ProviderName name = _resolveProviderName(pidc);
2050
|
2051 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
2052 {
2053 ph = providerManager.getRemoteProvider(
2054 name.getLocation(), name.getLogicalName());
|
2055 marek 1.63 }
|
2056 venkat.puvvada 1.108 else
2057 {
2058 // get cached or load new provider module
2059 ph = providerManager.getProvider(
2060 name.getPhysicalName(), name.getLogicalName());
|
2061 marek 1.63 }
2062
2063 // convert arguments
2064 OperationContext context;
2065
2066 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
2067 venkat.puvvada 1.108 context.insert(
2068 request->operationContext.get(AcceptLanguageListContainer::NAME));
2069 context.insert(
2070 request->operationContext.get(ContentLanguageListContainer::NAME));
|
2071 marek 1.63
2072 CIMObjectPath instanceReference(request->instanceName);
2073
2074 // ATTN: propagate namespace
2075 instanceReference.setNameSpace(request->nameSpace);
2076
2077 // forward request
2078 CMPIProvider & pr=ph.GetProvider();
2079
|
2080 a.dunfey 1.85 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
|
2081 venkat.puvvada 1.121 AutoPtr<NormalizerContext> tmpNormalizerContext(
|
2082 venkat.puvvada 1.132 new CIMOMHandleContext(*pr.getCIMOMHandle()));
|
2083 venkat.puvvada 1.121 request->operationContext.insert(
2084 NormalizerContextContainer(tmpNormalizerContext));
2085 #endif
|
2086 a.dunfey 1.85
|
2087 ms.aruran 1.115 PEG_TRACE_STRING(
2088 TRC_PROVIDERMANAGER,
2089 Tracer::LEVEL4,
|
2090 marek 1.63 "Calling provider.invokeMethod: " + pr.getName());
2091
2092 CMPIStatus rc={CMPI_RC_OK,NULL};
2093 CMPI_ContextOnStack eCtx(context);
2094 CMPI_ObjectPathOnStack eRef(objectPath);
|
2095 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(handler,pr.getBroker());
2096 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
2097 marek 1.63 CMPI_ArgsOnStack eArgsIn(request->inParameters);
2098 Array<CIMParamValue> outArgs;
2099 CMPI_ArgsOnStack eArgsOut(outArgs);
2100 CString mName=request->methodName.getString().getCString();
2101
|
2102 marek 1.124 _setupCMPIContexts(
|
2103 venkat.puvvada 1.108 &eCtx,
|
2104 marek 1.124 &context,
2105 &pidc,
2106 request->nameSpace.getString(),
2107 remote,
2108 false,
2109 false,
2110 true);
|
2111 marek 1.63
2112 CMPIProvider::pm_service_op_lock op_lock(&pr);
2113
|
2114 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
2115 venkat.puvvada 1.108
|
2116 kumpf 1.92 {
2117 StatProviderTimeMeasurement providerTime(response);
|
2118 marek 1.63
|
2119 venkat.puvvada 1.132 rc = pr.getMethMI()->ft->invokeMethod(
2120 pr.getMethMI(),
2121 &eCtx,
2122 &eRes,
2123 &eRef,
2124 CHARS(mName),
2125 &eArgsIn,
2126 &eArgsOut);
|
2127 kumpf 1.92 }
|
2128 marek 1.63
|
2129 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
2130 // Do this before checking rc from provider to throw exception in case
2131 // rc.msg is also localized.
2132 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
2133 venkat.puvvada 1.108 CMPIData cldata =
2134 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
2135 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
2136 {
2137 response->operationContext.set(
2138 ContentLanguageListContainer(
|
2139 venkat.puvvada 1.108 ContentLanguageList(
2140 LanguageParser::parseContentLanguageHeader(
2141 CMGetCharPtr(cldata.value.string)))));
|
2142 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
2143 dave.sudlik 1.99 }
2144
|
2145 marek 1.63 if (rc.rc!=CMPI_RC_OK)
|
2146 dave.sudlik 1.102 {
|
2147 venkat.puvvada 1.108 CIMException cimException(
2148 (CIMStatusCode)rc.rc,
2149 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
2150
2151 if (eRes.resError)
2152 {
2153 for (CMPI_Error* currErr=eRes.resError;
|
2154 dave.sudlik 1.102 currErr!=NULL;
2155 currErr=currErr->nextError)
|
2156 venkat.puvvada 1.108 {
2157 cimException.addError(
2158 ((CIMError*)currErr->hdl)->getInstance());
2159 }
2160 }
2161 throw cimException;
|
2162 dave.sudlik 1.102 }
2163
|
2164 a.dunfey 1.85 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
|
2165 venkat.puvvada 1.121 // Even if external normalization is enabled we don't normalize the
2166 // Embedded instances present in output args. Normalize them here.
|
2167 a.dunfey 1.85 {
2168 // There is no try catch here because if there is no external
2169 // normalization, then these containers were added by this method.
2170 const CachedClassDefinitionContainer * classCont =
2171 dynamic_cast<const CachedClassDefinitionContainer *>(
|
2172 venkat.puvvada 1.108 &request->operationContext.get(
2173 CachedClassDefinitionContainer::NAME));
|
2174 kumpf 1.106 PEGASUS_ASSERT(classCont != 0);
|
2175 a.dunfey 1.85 const NormalizerContextContainer * contextCont =
2176 dynamic_cast<const NormalizerContextContainer*>(
|
2177 venkat.puvvada 1.108 &request->operationContext.get(
2178 NormalizerContextContainer::NAME));
|
2179 kumpf 1.106 PEGASUS_ASSERT(contextCont != 0);
2180
|
2181 a.dunfey 1.85 CIMClass classDef(classCont->getClass());
2182 Uint32 methodIndex = classDef.findMethod(request->methodName);
2183 PEGASUS_ASSERT(methodIndex != PEG_NOT_FOUND);
2184 CIMMethod methodDef(classDef.getMethod(methodIndex));
|
2185 venkat.puvvada 1.108 for (unsigned int i = 0, n = outArgs.size(); i < n; ++i)
|
2186 a.dunfey 1.85 {
2187 CIMParamValue currentParam(outArgs[i]);
2188 CIMValue paramValue(currentParam.getValue());
2189 // If the parameter value is an EmbeddedObject type, we have
2190 // to check against the type of the parameter definition.
2191 // CMPI does not distinguish between EmbeddedObjects and
2192 // EmbeddedInstances, so if the parameter definition has a type
2193 // of EmbeddedInstance, the type of the output parameter must
2194 // be changed.
|
2195 venkat.puvvada 1.108 if (paramValue.getType() == CIMTYPE_OBJECT)
|
2196 a.dunfey 1.85 {
2197 String currentParamName(currentParam.getParameterName());
2198 Uint32 paramIndex = methodDef.findParameter(
2199 CIMName(currentParamName));
|
2200 venkat.puvvada 1.108 if (paramIndex == PEG_NOT_FOUND)
|
2201 a.dunfey 1.85 {
2202 MessageLoaderParms msg("ProviderManager.CMPI."
2203 "CMPIProviderManager.PARAMETER_NOT_FOUND",
|
2204 dave.sudlik 1.117 "Parameter $0 not found in definition for "
2205 "method $1.", currentParamName,
|
2206 a.dunfey 1.85 request->methodName.getString());
|
2207 marek 1.131 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL1,
|
2208 dave.sudlik 1.117 MessageLoader::getMessage(msg));
|
2209 a.dunfey 1.85 handler.setStatus(CIM_ERR_FAILED,
|
2210 dave.sudlik 1.117 MessageLoader::getMessage(msg));
|
2211 a.dunfey 1.85 }
2212 else
2213 {
2214 CIMConstParameter paramDef(
2215 methodDef.getParameter(paramIndex));
|
2216 venkat.puvvada 1.108 if (paramDef.findQualifier(CIMName("EmbeddedInstance"))
|
2217 a.dunfey 1.85 != PEG_NOT_FOUND)
2218 {
|
2219 venkat.puvvada 1.126 if (paramValue.isArray())
2220 {
2221 Array<CIMInstance> paramInstArr;
2222 Array<CIMObject> paramObjectArr;
2223 paramValue.get(paramObjectArr);
2224 for (Uint32 i = 0 ;
2225 i < paramObjectArr.size() ; ++i)
2226 {
2227 paramInstArr.append(
2228 CIMInstance(paramObjectArr[i]));
2229 // resolve each embedded instance.
2230 resolveEmbeddedInstanceTypes(
2231 &handler, paramInstArr[i]);
2232 }
2233 currentParam = CIMParamValue(currentParamName,
2234 CIMValue(paramInstArr));
2235 }
2236 else
2237 {
2238 CIMObject paramObject;
2239 paramValue.get(paramObject);
2240 venkat.puvvada 1.126 CIMInstance paramInst(paramObject);
2241 resolveEmbeddedInstanceTypes(&handler,
2242 paramInst);
2243 currentParam = CIMParamValue(currentParamName,
2244 CIMValue(paramInst));
2245 }
|
2246 a.dunfey 1.85 }
2247 else
2248 {
2249 currentParam = CIMParamValue(currentParamName,
|
2250 venkat.puvvada 1.126 paramValue);
|
2251 a.dunfey 1.85 }
2252
2253 handler.deliverParamValue(currentParam);
2254 }
2255 }
2256 else
2257 {
2258 handler.deliverParamValue(currentParam);
2259 }
2260 }
2261 }
2262 #else
2263 for (int i=0,s=outArgs.size(); i<s; i++)
2264 {
2265 handler.deliverParamValue(outArgs[i]);
2266 }
2267 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
|
2268 venkat.puvvada 1.108 handler.complete();
|
2269 marek 1.63 }
2270 HandlerCatch(handler);
2271
2272 PEG_METHOD_EXIT();
2273
2274 return(response);
2275 }
2276
|
2277 venkat.puvvada 1.108 int LocateIndicationProviderNames(
2278 const CIMInstance& pInstance,
2279 const CIMInstance& pmInstance,
2280 String& providerName,
2281 String& location)
|
2282 marek 1.63 {
|
2283 ms.aruran 1.115 PEG_METHOD_ENTER(
2284 TRC_PROVIDERMANAGER,
2285 "CMPIProviderManager:LocateIndicationProviderNames()");
|
2286 marek 1.63 Uint32 pos = pInstance.findProperty(CIMName ("Name"));
2287 pInstance.getProperty(pos).getValue().get(providerName);
2288
2289 pos = pmInstance.findProperty(CIMName ("Location"));
2290 pmInstance.getProperty(pos).getValue().get(location);
|
2291 ms.aruran 1.115 PEG_METHOD_EXIT();
|
2292 marek 1.63 return 0;
2293 }
2294
|
2295 venkat.puvvada 1.108 Message * CMPIProviderManager::handleCreateSubscriptionRequest(
2296 const Message * message)
|
2297 marek 1.63 {
|
2298 ms.aruran 1.115 PEG_METHOD_ENTER(
2299 TRC_PROVIDERMANAGER,
2300 "CMPIProviderManager::handleCreateSubscriptionRequest()");
|
2301 marek 1.63
2302 HandlerIntroInd(CreateSubscription,message,request,response,
|
2303 venkat.puvvada 1.108 handler);
2304 try
2305 {
|
2306 marek 1.63 CIMInstance req_provider, req_providerModule;
|
2307 venkat.puvvada 1.108 ProviderIdContainer pidc =
2308 (ProviderIdContainer)request->operationContext.get(
2309 ProviderIdContainer::NAME);
|
2310 marek 1.63 req_provider = pidc.getProvider();
2311 req_providerModule = pidc.getModule();
2312
2313 String providerName,providerLocation;
2314 LocateIndicationProviderNames(req_provider, req_providerModule,
|
2315 venkat.puvvada 1.108 providerName,providerLocation);
|
2316 marek 1.63
|
2317 marek 1.129 PEG_TRACE((
2318 TRC_PROVIDERMANAGER,
2319 Tracer::LEVEL3,
2320 "CMPIProviderManager::handleCreateSubscriptionRequest"
2321 " - Host name: %s Name space: %s Provider name(s): %s",
2322 (const char*) System::getHostName().getCString(),
2323 (const char*) request->nameSpace.getString().getCString(),
2324 (const char*) providerName.getCString()));
|
2325 marek 1.63
2326 Boolean remote=false;
|
2327 venkat.puvvada 1.132 OpProviderHolder ph;
|
2328 marek 1.63
|
2329 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
2330 {
2331 ph = providerManager.getRemoteProvider(
2332 providerLocation, providerName);
|
2333 marek 1.63 }
|
2334 venkat.puvvada 1.108 else
2335 {
2336 // get cached or load new provider module
2337 ph = providerManager.getProvider(
2338 providerLocation, providerName);
|
2339 marek 1.63 }
2340
2341 indProvRecord *prec=NULL;
|
2342 marek 1.95 {
2343 WriteLock writeLock(rwSemProvTab);
|
2344 venkat.puvvada 1.108 provTab.lookup(ph.GetProvider().getName(),prec);
2345 if (prec) prec->count++;
2346 else
2347 {
2348 prec=new indProvRecord();
|
2349 venkat.puvvada 1.110 #ifdef PEGASUS_ENABLE_REMOTE_CMPI
2350 if (remote)
2351 {
2352 prec->remoteInfo = pidc.getRemoteInfo();
2353 }
2354 #endif
|
2355 venkat.puvvada 1.108 provTab.insert(ph.GetProvider().getName(),prec);
2356 }
|
2357 marek 1.95 }
|
2358 marek 1.63
2359 //
2360 // Save the provider instance from the request
2361 //
2362 ph.GetProvider ().setProviderInstance (req_provider);
2363
2364 const CIMObjectPath &sPath=request->subscriptionInstance.getPath();
2365
|
2366 marek 1.95 indSelectRecord *srec=NULL;
2367
2368 {
2369 WriteLock writeLock(rwSemSelxTab);
2370 selxTab.lookup(sPath,srec);
2371 if (srec) srec->count++;
|
2372 venkat.puvvada 1.108 else
2373 {
2374 srec=new indSelectRecord();
2375 selxTab.insert(sPath,srec);
|
2376 marek 1.95 }
2377 }
|
2378 marek 1.63
2379 // convert arguments
2380 OperationContext context;
2381 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
2382 venkat.puvvada 1.108 context.insert(
2383 request->operationContext.get(AcceptLanguageListContainer::NAME));
2384 context.insert(
2385 request->operationContext.get(ContentLanguageListContainer::NAME));
2386 context.insert(
2387 request->operationContext.get(SubscriptionInstanceContainer::NAME));
2388 context.insert(
2389 request->operationContext.get(
2390 SubscriptionFilterConditionContainer::NAME));
|
2391 marek 1.63
|
2392 venkat.puvvada 1.108 CIMObjectPath subscriptionName =
2393 request->subscriptionInstance.getPath();
|
2394 marek 1.63
2395 CMPIProvider & pr=ph.GetProvider();
2396
2397 CMPIStatus rc={CMPI_RC_OK,NULL};
2398 CMPI_ContextOnStack eCtx(context);
|
2399 venkat.puvvada 1.108 SubscriptionFilterConditionContainer sub_cntr =
2400 request->operationContext.get(
2401 SubscriptionFilterConditionContainer::NAME);
2402
2403 CIMOMHandleQueryContext *_context=
2404 new CIMOMHandleQueryContext(
2405 CIMNamespaceName(
2406 request->nameSpace.getString()),
|
2407 venkat.puvvada 1.132 *pr.getCIMOMHandle());
|
2408 venkat.puvvada 1.108
2409 CMPI_SelectExp *eSelx=new CMPI_SelectExp(
2410 context,
2411 _context,
2412 request->query,
2413 sub_cntr.getQueryLanguage());
|
2414 marek 1.63
2415 srec->eSelx=eSelx;
|
2416 venkat.puvvada 1.108 srec->qContext=_context;
|
2417 marek 1.63
|
2418 venkat.puvvada 1.132 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
2419 marek 1.63
|
2420 ms.aruran 1.115 PEG_TRACE_STRING(
2421 TRC_PROVIDERMANAGER,
2422 Tracer::LEVEL4,
|
2423 marek 1.63 "Calling provider.createSubscriptionRequest: " + pr.getName());
2424
|
2425 venkat.puvvada 1.108 for (Uint32 i = 0, n = request->classNames.size(); i < n; i++)
2426 {
|
2427 marek 1.63 CIMObjectPath className(
2428 System::getHostName(),
2429 request->nameSpace,
2430 request->classNames[i]);
2431 eSelx->classNames.append(className);
2432 }
2433 CMPI_ObjectPathOnStack eRef(eSelx->classNames[0]);
2434
2435 CIMPropertyList propertyList = request->propertyList;
|
2436 venkat.puvvada 1.108 if (!propertyList.isNull())
2437 {
2438 Array<CIMName> p=propertyList.getPropertyNameArray();
2439 int pCount=p.size();
2440 eSelx->props = new const char*[1+pCount];
2441 for (int i=0; i<pCount; i++)
2442 {
2443 eSelx->props[i]=strdup(p[i].getString().getCString());
2444 }
2445 eSelx->props[pCount]=NULL;
|
2446 marek 1.63 }
2447
2448 Uint16 repeatNotificationPolicy = request->repeatNotificationPolicy;
2449
|
2450 marek 1.124 // includeQualifiers and includeClassOrigin not of interest for
2451 // this type of request
2452 _setupCMPIContexts(
|
2453 kumpf 1.79 &eCtx,
|
2454 marek 1.124 &context,
2455 &pidc,
2456 request->nameSpace.getString(),
2457 remote);
|
2458 marek 1.63
2459 CMPIProvider::pm_service_op_lock op_lock(&pr);
2460
|
2461 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
2462 venkat.puvvada 1.108
|
2463 kumpf 1.92 {
2464 StatProviderTimeMeasurement providerTime(response);
2465
|
2466 venkat.puvvada 1.132 if (pr.getIndMI()->ft->ftVersion >= 100)
|
2467 kumpf 1.92 {
|
2468 venkat.puvvada 1.132 rc = pr.getIndMI()->ft->activateFilter(
2469 pr.getIndMI(),
2470 &eCtx,eSelx,
|
2471 kumpf 1.92 CHARS(eSelx->classNames[0].getClassName().getString().
|
2472 venkat.puvvada 1.132 getCString()),
2473 &eRef,
2474 false);
|
2475 kumpf 1.92 }
2476 else
2477 {
|
2478 venkat.puvvada 1.108 // Older version of (pre 1.00) also pass in a CMPIResult
|
2479 marek 1.63
|
2480 kumpf 1.92 rc = ((CMPIStatus (*)(CMPIIndicationMI*, CMPIContext*,
|
2481 venkat.puvvada 1.108 CMPIResult*, CMPISelectExp*,
2482 const char *, CMPIObjectPath*, CMPIBoolean))
|
2483 venkat.puvvada 1.132 pr.getIndMI()->ft->activateFilter)
2484 (pr.getIndMI(),&eCtx,NULL,eSelx,
|
2485 venkat.puvvada 1.108 CHARS(eSelx->classNames[0].getClassName().getString().
|
2486 dave.sudlik 1.96 getCString()),&eRef,false);
|
2487 kumpf 1.92 }
2488 }
|
2489 marek 1.63
|
2490 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
2491 // Do this before checking rc from provider to throw exception in case
2492 // rc.msg is also localized.
2493 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
2494 venkat.puvvada 1.108 CMPIData cldata =
2495 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
2496 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
2497 {
2498 response->operationContext.set(
2499 ContentLanguageListContainer(
|
2500 venkat.puvvada 1.108 ContentLanguageList(
2501 LanguageParser::parseContentLanguageHeader(
2502 CMGetCharPtr(cldata.value.string)))));
|
2503 dave.sudlik 1.99 }
2504
|
2505 marek 1.63 if (rc.rc!=CMPI_RC_OK)
2506 {
|
2507 marek 1.95 // Removed the select expression from the cache
2508 WriteLock lock(rwSemSelxTab);
2509 if (--srec->count<=0)
2510 {
2511 selxTab.remove(sPath);
2512 delete _context;
2513 delete eSelx;
2514 delete srec;
2515 }
|
2516 venkat.puvvada 1.108 throw CIMException((CIMStatusCode)rc.rc,
2517 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
|
2518 marek 1.63 }
2519 else
2520 {
2521 //
2522 // Increment count of current subscriptions for this provider
2523 //
2524 if (ph.GetProvider ().testIfZeroAndIncrementSubscriptions ())
2525 {
2526 //
2527 // If there were no current subscriptions before the increment,
2528 // the first subscription has been created
2529 // Call the provider's enableIndications method
2530 //
2531 if (_subscriptionInitComplete)
2532 {
2533 _callEnableIndications (req_provider, _indicationCallback,
|
2534 marek 1.124 ph, (const char*)pidc.getRemoteInfo().getCString());
|
2535 marek 1.63 }
2536 }
2537 }
2538 }
2539 HandlerCatch(handler);
2540
2541 PEG_METHOD_EXIT();
2542
2543 return(response);
2544 }
2545
|
2546 venkat.puvvada 1.108 Message * CMPIProviderManager::handleDeleteSubscriptionRequest(
2547 const Message * message)
|
2548 marek 1.63 {
|
2549 ms.aruran 1.115 PEG_METHOD_ENTER(
2550 TRC_PROVIDERMANAGER,
2551 "CMPIProviderManager::handleDeleteSubscriptionRequest()");
|
2552 marek 1.63
2553 HandlerIntroInd(DeleteSubscription,message,request,response,
|
2554 venkat.puvvada 1.108 handler);
2555 try
2556 {
|
2557 marek 1.63 String providerName,providerLocation;
2558
2559 CIMInstance req_provider, req_providerModule;
|
2560 venkat.puvvada 1.108 ProviderIdContainer pidc =
2561 (ProviderIdContainer)request->operationContext.get(
2562 ProviderIdContainer::NAME);
|
2563 marek 1.63 req_provider = pidc.getProvider();
2564 req_providerModule = pidc.getModule();
2565
2566 LocateIndicationProviderNames(req_provider, req_providerModule,
|
2567 venkat.puvvada 1.108 providerName,providerLocation);
|
2568 marek 1.63
|
2569 marek 1.129 PEG_TRACE((
2570 TRC_PROVIDERMANAGER,
2571 Tracer::LEVEL3,
2572 "CMPIProviderManager::handleDeleteSubscriptionRequest"
2573 " - Host name: %s Name space: %s Provider name(s): %s",
2574 (const char*) System::getHostName().getCString(),
2575 (const char*) request->nameSpace.getString().getCString(),
2576 (const char*) providerName.getCString()));
|
2577 marek 1.63
2578 Boolean remote=false;
|
2579 venkat.puvvada 1.132 OpProviderHolder ph;
|
2580 marek 1.63
|
2581 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
2582 {
2583 ph = providerManager.getRemoteProvider(
2584 providerLocation, providerName);
|
2585 marek 1.63 }
|
2586 venkat.puvvada 1.108 else
2587 {
2588 // get cached or load new provider module
2589 ph = providerManager.getProvider(
2590 providerLocation, providerName);
|
2591 marek 1.63 }
2592
2593
2594 indProvRecord *prec=NULL;
|
2595 marek 1.95 {
2596 WriteLock writeLock(rwSemProvTab);
|
2597 venkat.puvvada 1.108 provTab.lookup(ph.GetProvider().getName(),prec);
2598 if (--prec->count<=0)
2599 {
2600 if (prec->handler)
2601 delete prec->handler;
2602 delete prec;
2603 provTab.remove(ph.GetProvider().getName());
2604 prec=NULL;
2605 }
|
2606 marek 1.95 }
|
2607 marek 1.63
2608 indSelectRecord *srec=NULL;
2609 const CIMObjectPath &sPath=request->subscriptionInstance.getPath();
|
2610 r.kieninger 1.81
|
2611 marek 1.95 WriteLock writeLock(rwSemSelxTab);
|
2612 venkat.puvvada 1.108 if (!selxTab.lookup(sPath,srec))
2613 {
|
2614 dave.sudlik 1.117 MessageLoaderParms parms(
2615 "ProviderManager.CMPI.CMPIProviderManager."
2616 "FAILED_LOCATE_SUBSCRIPTION_FILTER",
2617 "Failed to locate the subscription filter.");
|
2618 venkat.puvvada 1.108 // failed to get select expression from hash table
|
2619 dave.sudlik 1.117 throw CIMException(CIM_ERR_FAILED, parms);
|
2620 venkat.puvvada 1.108 };
|
2621 marek 1.63
2622 CMPI_SelectExp *eSelx=srec->eSelx;
|
2623 venkat.puvvada 1.108 CIMOMHandleQueryContext *qContext=srec->qContext;
|
2624 marek 1.63
2625 CMPI_ObjectPathOnStack eRef(eSelx->classNames[0]);
|
2626 marek 1.95 if (--srec->count<=0)
2627 {
|
2628 venkat.puvvada 1.108 selxTab.remove(sPath);
|
2629 marek 1.95 }
|
2630 marek 1.63
2631 // convert arguments
2632 OperationContext context;
2633 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
2634 venkat.puvvada 1.108 context.insert(
2635 request->operationContext.get(AcceptLanguageListContainer::NAME));
2636 context.insert(
2637 request->operationContext.get(ContentLanguageListContainer::NAME));
2638 context.insert(
2639 request->operationContext.get(SubscriptionInstanceContainer::NAME));
|
2640 marek 1.63
|
2641 venkat.puvvada 1.108 CIMObjectPath subscriptionName =
2642 request->subscriptionInstance.getPath();
|
2643 marek 1.63
2644 CMPIProvider & pr=ph.GetProvider();
2645
2646 CMPIStatus rc={CMPI_RC_OK,NULL};
2647 CMPI_ContextOnStack eCtx(context);
|
2648 venkat.puvvada 1.132 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
2649 marek 1.63
|
2650 ms.aruran 1.115 PEG_TRACE_STRING(
2651 TRC_PROVIDERMANAGER,
2652 Tracer::LEVEL4,
|
2653 marek 1.63 "Calling provider.deleteSubscriptionRequest: " + pr.getName());
2654
|
2655 marek 1.124 // includeQualifiers and includeClassOrigin not of interest for
2656 // this type of request
2657 _setupCMPIContexts(
|
2658 venkat.puvvada 1.108 &eCtx,
|
2659 marek 1.124 &context,
2660 &pidc,
2661 request->nameSpace.getString(),
2662 remote);
|
2663 marek 1.63
2664 CMPIProvider::pm_service_op_lock op_lock(&pr);
2665
|
2666 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
2667 venkat.puvvada 1.108
|
2668 kumpf 1.92 {
2669 StatProviderTimeMeasurement providerTime(response);
2670
|
2671 venkat.puvvada 1.132 if (pr.getIndMI()->ft->ftVersion >= 100)
|
2672 kumpf 1.92 {
|
2673 venkat.puvvada 1.132 rc = pr.getIndMI()->ft->deActivateFilter(
2674 pr.getIndMI(),
2675 &eCtx,
2676 eSelx,
|
2677 kumpf 1.92 CHARS(eSelx->classNames[0].getClassName().getString().
|
2678 venkat.puvvada 1.132 getCString()),
2679 &eRef,
2680 prec==NULL);
|
2681 kumpf 1.92 }
2682 else
2683 {
2684 // Older version of (pre 1.00) also pass in a CMPIResult
|
2685 marek 1.63
|
2686 kumpf 1.92 rc = ((CMPIStatus (*)(CMPIIndicationMI*, CMPIContext*,
2687 CMPIResult*, CMPISelectExp*,
|
2688 venkat.puvvada 1.108 const char *, CMPIObjectPath*, CMPIBoolean))
|
2689 venkat.puvvada 1.132 pr.getIndMI()->ft->deActivateFilter)
2690 (pr.getIndMI(),&eCtx,NULL,eSelx,
|
2691 venkat.puvvada 1.108 CHARS(eSelx->classNames[0].getClassName().getString().
|
2692 dave.sudlik 1.96 getCString()),&eRef,prec==NULL);
|
2693 kumpf 1.92 }
2694 }
|
2695 marek 1.63
|
2696 marek 1.95 if (srec->count<=0)
2697 {
|
2698 venkat.puvvada 1.108 delete qContext;
2699 delete eSelx;
2700 delete srec;
|
2701 marek 1.95 }
|
2702 marek 1.63
|
2703 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
2704 // Do this before checking rc from provider to throw exception in case
2705 // rc.msg is also localized.
2706 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
2707 venkat.puvvada 1.108 CMPIData cldata =
2708 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
2709 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
2710 {
2711 response->operationContext.set(
2712 ContentLanguageListContainer(
|
2713 venkat.puvvada 1.108 ContentLanguageList(
2714 LanguageParser::parseContentLanguageHeader(
2715 CMGetCharPtr(cldata.value.string)))));
|
2716 dave.sudlik 1.99 }
2717
|
2718 marek 1.63 if (rc.rc!=CMPI_RC_OK)
2719 {
|
2720 venkat.puvvada 1.108 throw CIMException((CIMStatusCode)rc.rc,
2721 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
|
2722 marek 1.63 }
2723 else
2724 {
2725 //
2726 // Decrement count of current subscriptions for this provider
2727 //
2728 if (ph.GetProvider ().decrementSubscriptionsAndTestIfZero ())
2729 {
2730 //
2731 // If there are no current subscriptions after the decrement,
2732 // the last subscription has been deleted
2733 // Call the provider's disableIndications method
2734 //
2735 if (_subscriptionInitComplete)
2736 {
|
2737 marek 1.124 _callDisableIndications(
2738 ph,
2739 (const char*)pidc.getRemoteInfo().getCString());
|
2740 marek 1.63 }
2741 }
2742 }
2743 }
2744 HandlerCatch(handler);
2745
2746 PEG_METHOD_EXIT();
2747
2748 return(response);
2749 }
2750
|
2751 venkat.puvvada 1.108 Message * CMPIProviderManager::handleDisableModuleRequest(
2752 const Message * message)
|
2753 marek 1.63 {
|
2754 ms.aruran 1.115 PEG_METHOD_ENTER(
2755 TRC_PROVIDERMANAGER,
2756 "CMPIProviderManager::handleDisableModuleRequest()");
|
2757 marek 1.63
2758 CIMDisableModuleRequestMessage * request =
|
2759 venkat.puvvada 1.108 dynamic_cast<CIMDisableModuleRequestMessage *>(
2760 const_cast<Message *>(message));
|
2761 marek 1.63
2762 PEGASUS_ASSERT(request != 0);
2763
|
2764 venkat.puvvada 1.133 //Set to false when provider refused to unload due to pending operations.
2765 Boolean disableModuleOk = true;
2766
|
2767 marek 1.63 // get provider module name
2768 Boolean disableProviderOnly = request->disableProviderOnly;
2769
2770 //
2771 // Unload providers
2772 //
2773 Array<CIMInstance> _pInstances = request->providers;
2774 Array <Boolean> _indicationProviders = request->indicationProviders;
|
2775 venkat.puvvada 1.108 /* The CIMInstances on request->providers array is completly _different_
2776 than the request->providerModule CIMInstance. Hence */
|
2777 marek 1.63
|
2778 konrad.r 1.69 String physicalName=(request->providerModule.getProperty(
|
2779 venkat.puvvada 1.108 request->
2780 providerModule.findProperty("Location")).getValue().toString());
|
2781 marek 1.63
|
2782 venkat.puvvada 1.108 for (Uint32 i = 0, n = _pInstances.size(); i < n; i++)
|
2783 marek 1.63 {
2784 String providerName;
2785 _pInstances [i].getProperty (_pInstances [i].findProperty
2786 (CIMName ("Name"))).getValue ().get (providerName);
2787
|
2788 venkat.puvvada 1.108 Uint32 pos = _pInstances[i].findProperty("Name");
|
2789 marek 1.63
|
2790 venkat.puvvada 1.128 if (!providerManager.isProviderActive(providerName))
2791 {
2792 continue;
|
2793 venkat.puvvada 1.133 }
2794
2795 Boolean unloadOk = providerManager.unloadProvider(
2796 physicalName,
2797 _pInstances[i].getProperty(
2798 _pInstances[i].findProperty("Name")
2799 ).getValue ().toString ());
2800
2801 if (!unloadOk)
2802 {
2803 disableModuleOk = false;
2804 continue;
2805 }
|
2806 marek 1.63 //
2807 // Reset the indication provider's count of current
2808 // subscriptions since it has been disabled
2809 //
2810 if (_indicationProviders [i])
2811 {
2812 if (physicalName.size () > 0)
2813 {
|
2814 venkat.puvvada 1.108 try
2815 {
|
2816 venkat.puvvada 1.132 OpProviderHolder ph =
|
2817 venkat.puvvada 1.108 providerManager.getProvider(
2818 physicalName,
2819 providerName);
2820 ph.GetProvider ().resetSubscriptions ();
2821 }
2822 catch (const Exception &e)
2823 {
|
2824 marek 1.131 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL1,
|
2825 venkat.puvvada 1.108 e.getMessage());
2826 }
|
2827 marek 1.63 }
2828 }
2829 }
2830
|
2831 kumpf 1.123 CIMDisableModuleResponseMessage* response =
2832 dynamic_cast<CIMDisableModuleResponseMessage*>(
2833 request->buildResponse());
|
2834 marek 1.63 PEGASUS_ASSERT(response != 0);
|
2835 venkat.puvvada 1.133
2836 if (disableModuleOk)
2837 {
2838 response->operationalStatus.append(
2839 CIM_MSE_OPSTATUS_VALUE_STOPPED);
2840 }
2841 else
2842 {
2843 response->operationalStatus.append(
2844 CIM_MSE_OPSTATUS_VALUE_OK);
2845 }
|
2846 marek 1.63
2847 PEG_METHOD_EXIT();
2848
2849 return(response);
2850 }
2851
|
2852 venkat.puvvada 1.108 Message * CMPIProviderManager::handleEnableModuleRequest(
2853 const Message * message)
|
2854 marek 1.63 {
|
2855 ms.aruran 1.115 PEG_METHOD_ENTER(
2856 TRC_PROVIDERMANAGER,
2857 "CMPIProviderManager::handleEnableModuleRequest()");
|
2858 marek 1.63
2859 CIMEnableModuleRequestMessage * request =
|
2860 venkat.puvvada 1.108 dynamic_cast<CIMEnableModuleRequestMessage *>(
2861 const_cast<Message *>(message));
|
2862 marek 1.63
2863 PEGASUS_ASSERT(request != 0);
2864
2865 Array<Uint16> operationalStatus;
2866 operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
2867
|
2868 kumpf 1.123 CIMEnableModuleResponseMessage* response =
2869 dynamic_cast<CIMEnableModuleResponseMessage*>(
2870 request->buildResponse());
|
2871 marek 1.63 PEGASUS_ASSERT(response != 0);
|
2872 kumpf 1.123 response->operationalStatus = operationalStatus;
|
2873 marek 1.63
2874 PEG_METHOD_EXIT();
2875
2876 return(response);
2877 }
2878
|
2879 venkat.puvvada 1.108 Message * CMPIProviderManager::handleStopAllProvidersRequest(
2880 const Message * message)
|
2881 marek 1.63 {
|
2882 ms.aruran 1.115 PEG_METHOD_ENTER(
2883 TRC_PROVIDERMANAGER,
2884 "CMPIProviderManager::handleStopAllProvidersRequest()");
|
2885 marek 1.63
2886 CIMStopAllProvidersRequestMessage * request =
|
2887 venkat.puvvada 1.108 dynamic_cast<CIMStopAllProvidersRequestMessage *>(
2888 const_cast<Message *>(message));
|
2889 marek 1.63
2890 PEGASUS_ASSERT(request != 0);
2891
|
2892 kumpf 1.123 CIMStopAllProvidersResponseMessage* response =
2893 dynamic_cast<CIMStopAllProvidersResponseMessage*>(
2894 request->buildResponse());
|
2895 marek 1.63 PEGASUS_ASSERT(response != 0);
2896
2897 // tell the provider manager to shutdown all the providers
2898 providerManager.shutdownAllProviders();
2899
2900 PEG_METHOD_EXIT();
2901
2902 return(response);
2903 }
2904
|
2905 venkat.puvvada 1.108 Message * CMPIProviderManager::handleSubscriptionInitCompleteRequest(
2906 const Message * message)
|
2907 marek 1.63 {
|
2908 ms.aruran 1.115 PEG_METHOD_ENTER(
2909 TRC_PROVIDERMANAGER,
2910 "CMPIProviderManager::handleSubscriptionInitCompleteRequest()");
|
2911 marek 1.63
2912 CIMSubscriptionInitCompleteRequestMessage * request =
2913 dynamic_cast <CIMSubscriptionInitCompleteRequestMessage *>
|
2914 venkat.puvvada 1.108 (const_cast <Message *> (message));
|
2915 marek 1.63
2916 PEGASUS_ASSERT (request != 0);
2917
2918 CIMSubscriptionInitCompleteResponseMessage * response =
2919 dynamic_cast <CIMSubscriptionInitCompleteResponseMessage *>
|
2920 venkat.puvvada 1.108 (request->buildResponse ());
|
2921 marek 1.63
2922 PEGASUS_ASSERT (response != 0);
2923
2924 //
2925 // Set indicator
2926 //
2927 _subscriptionInitComplete = true;
2928
2929 //
2930 // For each provider that has at least one subscription, call
2931 // provider's enableIndications method
2932 //
2933 Array <CMPIProvider *> enableProviders;
2934 enableProviders = providerManager.getIndicationProvidersToEnable ();
2935
2936 Uint32 numProviders = enableProviders.size ();
2937 for (Uint32 i = 0; i < numProviders; i++)
2938 {
2939 try
2940 {
2941 CIMInstance provider;
2942 marek 1.63 provider = enableProviders [i]->getProviderInstance ();
2943
|
2944 venkat.puvvada 1.110 CString info;
2945 #ifdef PEGASUS_ENABLE_REMOTE_CMPI
2946 indProvRecord *provRec = 0;
2947 if (provTab.lookup (enableProviders [i]->getName(), provRec))
2948 {
2949 if (provRec->remoteInfo != String::EMPTY)
2950 {
2951 info = provRec->remoteInfo.getCString();
2952 }
2953 }
2954 #endif
|
2955 marek 1.63 //
2956 // Get cached or load new provider module
2957 //
|
2958 venkat.puvvada 1.132 OpProviderHolder ph;
|
2959 venkat.puvvada 1.110 if ((const char*)info)
2960 {
2961 ph = providerManager.getRemoteProvider
2962 (enableProviders [i]->getModule ()->getFileName (),
2963 enableProviders [i]->getName ());
2964 }
2965 else
2966 {
2967 ph = providerManager.getProvider
2968 (enableProviders [i]->getModule ()->getFileName (),
2969 enableProviders [i]->getName ());
2970 }
|
2971 venkat.puvvada 1.108 _callEnableIndications(
2972 provider,
2973 _indicationCallback,
2974 ph,
2975 (const char*)info);
|
2976 marek 1.63 }
|
2977 konrad.r 1.64 catch (const CIMException & e)
|
2978 marek 1.63 {
|
2979 ms.aruran 1.115 PEG_TRACE_STRING(
2980 TRC_PROVIDERMANAGER,
|
2981 marek 1.131 Tracer::LEVEL1,
|
2982 marek 1.63 "CIMException: " + e.getMessage ());
2983 }
|
2984 konrad.r 1.64 catch (const Exception & e)
|
2985 marek 1.63 {
|
2986 ms.aruran 1.115 PEG_TRACE_STRING(
2987 TRC_PROVIDERMANAGER,
|
2988 marek 1.131 Tracer::LEVEL1,
|
2989 marek 1.63 "Exception: " + e.getMessage ());
2990 }
|
2991 venkat.puvvada 1.108 catch (...)
|
2992 marek 1.63 {
|
2993 ms.aruran 1.115 PEG_TRACE_CSTRING(
2994 TRC_PROVIDERMANAGER,
|
2995 marek 1.131 Tracer::LEVEL1,
|
2996 marek 1.63 "Unknown error in handleSubscriptionInitCompleteRequest");
2997 }
2998 }
2999
3000 PEG_METHOD_EXIT ();
|
3001 venkat.puvvada 1.108 return(response);
|
3002 marek 1.63 }
3003
|
3004 venkat.puvvada 1.108 Message * CMPIProviderManager::handleGetPropertyRequest(
3005 const Message * message)
|
3006 dave.sudlik 1.98 {
|
3007 ms.aruran 1.115 PEG_METHOD_ENTER(
3008 TRC_PROVIDERMANAGER,
3009 "CMPIProviderManager::handleGetPropertyRequest()");
|
3010 dave.sudlik 1.98
3011 HandlerIntro(GetProperty,message,request,response,handler);
3012
3013 // We're only going to be interested in the specific property from this
3014 // instance.
3015 Array<CIMName> localPropertyListArray;
3016 localPropertyListArray.append(request->propertyName);
3017 CIMPropertyList localPropertyList(localPropertyListArray);
3018
3019 // NOTE: GetProperty will use the CIMInstanceProvider interface, so we
3020 // must manually define a request, response, and handler (emulate
3021 // HandlerIntro macro)
3022 CIMGetInstanceRequestMessage * GI_request =
3023 new CIMGetInstanceRequestMessage(
|
3024 venkat.puvvada 1.108 request->messageId,
3025 request->nameSpace,
3026 request->instanceName,
3027 false,
3028 false,
3029 false,
3030 localPropertyList,
3031 request->queueIds,
3032 request->authType,
3033 request->userName
3034 );
|
3035 dave.sudlik 1.98
3036 PEGASUS_ASSERT(GI_request != 0);
3037
3038 CIMGetInstanceResponseMessage * GI_response =
|
3039 venkat.puvvada 1.108 dynamic_cast<CIMGetInstanceResponseMessage*>
3040 (GI_request->buildResponse());
|
3041 dave.sudlik 1.98
3042 PEGASUS_ASSERT(GI_response != 0);
3043
|
3044 venkat.puvvada 1.108 GetInstanceResponseHandler GI_handler(
3045 GI_request,
3046 GI_response,
3047 _responseChunkCallback);
|
3048 dave.sudlik 1.98
|
3049 venkat.puvvada 1.108 try
|
3050 dave.sudlik 1.98 {
|
3051 marek 1.129 PEG_TRACE((
3052 TRC_PROVIDERMANAGER,
3053 Tracer::LEVEL3,
3054 "CMPIProviderManager::handleGetPropertyRequest"
3055 " - Host name: %s Name space: %s "
3056 "Class name: %s Property name: %s",
3057 (const char*) System::getHostName().getCString(),
3058 (const char*) request->nameSpace.getString().getCString(),
3059 (const char*)
3060 request->instanceName.getClassName().getString().getCString(),
3061 (const char*) request->propertyName.getString().getCString()));
3062
|
3063 dave.sudlik 1.98 // make target object path
3064 CIMObjectPath objectPath(
3065 System::getHostName(),
3066 request->nameSpace,
3067 request->instanceName.getClassName(),
3068 request->instanceName.getKeyBindings());
3069
3070 Boolean remote=false;
|
3071 venkat.puvvada 1.132 OpProviderHolder ph;
|
3072 dave.sudlik 1.98
3073 // resolve provider name
|
3074 venkat.puvvada 1.108 ProviderIdContainer pidc =
3075 request->operationContext.get(ProviderIdContainer::NAME);
|
3076 dave.sudlik 1.98 ProviderName name = _resolveProviderName(pidc);
3077
|
3078 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
3079 {
3080 ph = providerManager.getRemoteProvider(
3081 name.getLocation(), name.getLogicalName());
|
3082 dave.sudlik 1.98 }
|
3083 venkat.puvvada 1.108 else
3084 {
3085 // get cached or load new provider module
3086 ph = providerManager.getProvider(
3087 name.getPhysicalName(), name.getLogicalName());
|
3088 dave.sudlik 1.98 }
3089
3090 // convert arguments
3091 OperationContext context;
3092
3093 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
3094 venkat.puvvada 1.108 context.insert(
3095 request->operationContext.get(AcceptLanguageListContainer::NAME));
3096 context.insert(
3097 request->operationContext.get(ContentLanguageListContainer::NAME));
|
3098 dave.sudlik 1.98 // forward request
3099 CMPIProvider & pr=ph.GetProvider();
3100
3101 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
|
3102 venkat.puvvada 1.121 AutoPtr<NormalizerContext> tmpNormalizerContext(
|
3103 venkat.puvvada 1.132 new CIMOMHandleContext(*pr.getCIMOMHandle()));
|
3104 venkat.puvvada 1.121 request->operationContext.insert(
3105 NormalizerContextContainer(tmpNormalizerContext));
3106 #endif
|
3107 dave.sudlik 1.98
|
3108 ms.aruran 1.115 PEG_TRACE_STRING(
3109 TRC_PROVIDERMANAGER,
3110 Tracer::LEVEL4,
|
3111 dave.sudlik 1.98 "Calling provider.getInstance via getProperty: " + pr.getName());
3112
3113 CMPIStatus rc={CMPI_RC_OK,NULL};
3114 CMPI_ContextOnStack eCtx(context);
3115 CMPI_ObjectPathOnStack eRef(objectPath);
|
3116 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(GI_handler,pr.getBroker());
3117 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
3118 dave.sudlik 1.98
3119 // For the getInstance provider call, use the property list that we
3120 // created containing the single property from the getProperty call.
3121 CMPIPropertyList props(localPropertyList);
3122
|
3123 venkat.puvvada 1.108 // Leave includeQualifiers and includeClassOrigin as false for this
3124 // call to getInstance
|
3125 marek 1.124 _setupCMPIContexts(
|
3126 venkat.puvvada 1.108 &eCtx,
|
3127 marek 1.124 &context,
3128 &pidc,
3129 request->nameSpace.getString(),
3130 remote,
3131 false,
3132 false,
3133 true);
|
3134 dave.sudlik 1.98
3135 CMPIProvider::pm_service_op_lock op_lock(&pr);
3136
|
3137 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
3138 dave.sudlik 1.98
3139 {
3140 StatProviderTimeMeasurement providerTime(response);
3141
|
3142 venkat.puvvada 1.132 rc = pr.getInstMI()->ft->getInstance(
3143 pr.getInstMI(),
3144 &eCtx,
3145 &eRes,
3146 &eRef,
|
3147 dave.sudlik 1.98 (const char **)props.getList());
3148 }
3149
|
3150 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
3151 // Do this before checking rc from provider to throw exception in case
3152 // rc.msg is also localized.
3153 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
3154 venkat.puvvada 1.108 CMPIData cldata =
3155 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
3156 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
3157 {
3158 response->operationContext.set(
3159 ContentLanguageListContainer(
|
3160 venkat.puvvada 1.108 ContentLanguageList(
3161 LanguageParser::parseContentLanguageHeader(
3162 CMGetCharPtr(cldata.value.string)))));
|
3163 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
3164 dave.sudlik 1.99 }
3165
|
3166 dave.sudlik 1.98 if (rc.rc!=CMPI_RC_OK)
|
3167 dave.sudlik 1.102 {
|
3168 venkat.puvvada 1.108 CIMException cimException(
3169 (CIMStatusCode)rc.rc,
3170 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
3171
3172 if (eRes.resError)
3173 {
3174 for (CMPI_Error* currErr=eRes.resError;
|
3175 dave.sudlik 1.102 currErr!=NULL;
3176 currErr=currErr->nextError)
|
3177 venkat.puvvada 1.108 {
3178 cimException.addError(
3179 ((CIMError*)currErr->hdl)->getInstance());
3180 }
3181 }
3182 throw cimException;
|
3183 dave.sudlik 1.102 }
|
3184 dave.sudlik 1.98
3185 // Copy property value from instance to getProperty response
|
3186 venkat.puvvada 1.108 if (!(GI_response->cimInstance.isUninitialized()))
|
3187 dave.sudlik 1.98 {
|
3188 venkat.puvvada 1.108 Uint32 pos =
3189 GI_response->cimInstance.findProperty(request->propertyName);
|
3190 dave.sudlik 1.98
|
3191 venkat.puvvada 1.108 if (pos != PEG_NOT_FOUND)
|
3192 dave.sudlik 1.98 {
|
3193 venkat.puvvada 1.108 response->value =
3194 GI_response->cimInstance.getProperty(pos).getValue();
|
3195 dave.sudlik 1.98 }
3196 // Else property not found. Return CIM_ERR_NO_SUCH_PROPERTY.
3197 else
3198 {
3199 throw PEGASUS_CIM_EXCEPTION(
3200 CIM_ERR_NO_SUCH_PROPERTY,
3201 request->propertyName.getString()
3202 );
3203 }
3204 }
3205 }
3206 HandlerCatch(handler);
3207
3208 delete GI_request;
3209 delete GI_response;
3210
3211 PEG_METHOD_EXIT();
3212
3213 return(response);
3214 }
3215
|
3216 venkat.puvvada 1.108 Message * CMPIProviderManager::handleSetPropertyRequest(
3217 const Message * message)
|
3218 dave.sudlik 1.98 {
|
3219 ms.aruran 1.115 PEG_METHOD_ENTER(
3220 TRC_PROVIDERMANAGER,
3221 "CMPIProviderManager::handleSetPropertyRequest()");
|
3222 dave.sudlik 1.98
3223 HandlerIntro(SetProperty,message,request,response,handler);
3224
|
3225 venkat.puvvada 1.108 // We're only going to be interested in the specific property from this
3226 // instance.
|
3227 dave.sudlik 1.98 Array<CIMName> localPropertyListArray;
3228 localPropertyListArray.append(request->propertyName);
3229 CIMPropertyList localPropertyList(localPropertyListArray);
3230
|
3231 venkat.puvvada 1.108 // Build a modified instance with just the specific property and its
3232 // new value.
|
3233 dave.sudlik 1.98 CIMInstance localModifiedInstance(request->instanceName.getClassName());
3234 localModifiedInstance.setPath(request->instanceName);
|
3235 venkat.puvvada 1.108 localModifiedInstance.addProperty(
3236 CIMProperty(request->propertyName, request->newValue));
|
3237 dave.sudlik 1.98
|
3238 venkat.puvvada 1.108 // NOTE: SetProperty will use the CIMInstanceProvider interface, so we must
3239 // manually define a request, response, and handler.
|
3240 dave.sudlik 1.98 CIMModifyInstanceRequestMessage * MI_request =
3241 new CIMModifyInstanceRequestMessage(
|
3242 venkat.puvvada 1.108 request->messageId,
3243 request->nameSpace,
3244 localModifiedInstance,
3245 false,
3246 localPropertyList,
3247 request->queueIds,
3248 request->authType,
3249 request->userName
3250 );
|
3251 dave.sudlik 1.98
3252 PEGASUS_ASSERT(MI_request != 0);
3253
3254 CIMModifyInstanceResponseMessage * MI_response =
|
3255 venkat.puvvada 1.108 dynamic_cast<CIMModifyInstanceResponseMessage*>(
3256 MI_request->buildResponse());
|
3257 dave.sudlik 1.98
3258 PEGASUS_ASSERT(MI_response != 0);
3259
|
3260 venkat.puvvada 1.108 ModifyInstanceResponseHandler MI_handler(
3261 MI_request,
3262 MI_response,
3263 _responseChunkCallback);
|
3264 dave.sudlik 1.98
|
3265 venkat.puvvada 1.108 try
|
3266 dave.sudlik 1.98 {
|
3267 marek 1.129 PEG_TRACE((
3268 TRC_PROVIDERMANAGER,
3269 Tracer::LEVEL3,
3270 "CMPIProviderManager::handleSetPropertyRequest"
3271 " - Host name: %s Name space: %s "
3272 "Class name: %s Property name: %s",
3273 (const char*) System::getHostName().getCString(),
3274 (const char*) request->nameSpace.getString().getCString(),
3275 (const char*)
3276 request->instanceName.getClassName().getString().getCString(),
3277 (const char*) request->propertyName.getString().getCString()));
3278
|
3279 dave.sudlik 1.98 // make target object path
3280 CIMObjectPath objectPath(
3281 System::getHostName(),
3282 request->nameSpace,
3283 request->instanceName.getClassName(),
3284 request->instanceName.getKeyBindings());
3285
3286 Boolean remote=false;
|
3287 venkat.puvvada 1.132 OpProviderHolder ph;
|
3288 dave.sudlik 1.98
3289 // resolve provider name
|
3290 venkat.puvvada 1.108 ProviderIdContainer pidc =
3291 request->operationContext.get(ProviderIdContainer::NAME);
|
3292 dave.sudlik 1.98 ProviderName name = _resolveProviderName(pidc);
3293
|
3294 venkat.puvvada 1.108 if ((remote=pidc.isRemoteNameSpace()))
3295 {
3296 ph = providerManager.getRemoteProvider(
3297 name.getLocation(), name.getLogicalName());
|
3298 dave.sudlik 1.98 }
|
3299 venkat.puvvada 1.108 else
3300 {
3301 // get cached or load new provider module
3302 ph = providerManager.getProvider(
3303 name.getPhysicalName(), name.getLogicalName());
|
3304 dave.sudlik 1.98 }
3305
3306 // convert arguments
3307 OperationContext context;
3308
3309 context.insert(request->operationContext.get(IdentityContainer::NAME));
|
3310 venkat.puvvada 1.108 context.insert(
3311 request->operationContext.get(AcceptLanguageListContainer::NAME));
3312 context.insert(
3313 request->operationContext.get(ContentLanguageListContainer::NAME));
|
3314 dave.sudlik 1.98 // forward request
3315 CMPIProvider & pr=ph.GetProvider();
3316
|
3317 ms.aruran 1.115 PEG_TRACE_STRING(
3318 TRC_PROVIDERMANAGER,
3319 Tracer::LEVEL4,
|
3320 dave.sudlik 1.98 "Calling provider.modifyInstance via setProperty: " + pr.getName());
3321
3322 CMPIStatus rc={CMPI_RC_OK,NULL};
3323 CMPI_ContextOnStack eCtx(context);
3324 CMPI_ObjectPathOnStack eRef(objectPath);
|
3325 venkat.puvvada 1.132 CMPI_ResultOnStack eRes(MI_handler,pr.getBroker());
|
3326 dave.sudlik 1.98 CMPI_InstanceOnStack eInst(localModifiedInstance);
|
3327 venkat.puvvada 1.132 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
3328 dave.sudlik 1.98
3329 CMPIPropertyList props(localPropertyList);
3330
3331 // Leave includeQualifiers as false for this call to modifyInstance
|
3332 marek 1.124 _setupCMPIContexts(
|
3333 venkat.puvvada 1.108 &eCtx,
|
3334 marek 1.124 &context,
3335 &pidc,
3336 request->nameSpace.getString(),
3337 remote,
3338 false,
3339 false,
3340 true);
|
3341 dave.sudlik 1.98
3342 CMPIProvider::pm_service_op_lock op_lock(&pr);
3343
|
3344 r.kieninger 1.119 AutoPThreadSecurity threadLevelSecurity(request->operationContext);
|
3345 dave.sudlik 1.98
3346 {
3347 StatProviderTimeMeasurement providerTime(response);
3348
|
3349 venkat.puvvada 1.132 rc = pr.getInstMI()->ft->modifyInstance(
3350 pr.getInstMI(),
3351 &eCtx,
3352 &eRes,
3353 &eRef,
3354 &eInst,
|
3355 dave.sudlik 1.98 (const char **)props.getList());
3356 }
3357
|
3358 dave.sudlik 1.99 // Need to save ContentLanguage value into operation context of response
3359 // Do this before checking rc from provider to throw exception in case
3360 // rc.msg is also localized.
3361 CMPIStatus tmprc={CMPI_RC_OK,NULL};
|
3362 venkat.puvvada 1.108 CMPIData cldata =
3363 eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
|
3364 dave.sudlik 1.99 if (tmprc.rc == CMPI_RC_OK)
3365 {
3366 response->operationContext.set(
3367 ContentLanguageListContainer(
|
3368 venkat.puvvada 1.108 ContentLanguageList(
3369 LanguageParser::parseContentLanguageHeader(
3370 CMGetCharPtr(cldata.value.string)))));
|
3371 dave.sudlik 1.103 handler.setContext(response->operationContext);
|
3372 dave.sudlik 1.99 }
3373
|
3374 dave.sudlik 1.98 if (rc.rc!=CMPI_RC_OK)
|
3375 dave.sudlik 1.102 {
|
3376 venkat.puvvada 1.108 CIMException cimException(
3377 (CIMStatusCode)rc.rc,
3378 rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
3379
3380 if (eRes.resError)
3381 {
3382 for (CMPI_Error* currErr=eRes.resError;
|
3383 dave.sudlik 1.102 currErr!=NULL;
3384 currErr=currErr->nextError)
|
3385 venkat.puvvada 1.108 {
3386 cimException.addError(
3387 ((CIMError*)currErr->hdl)->getInstance());
3388 }
3389 }
3390 throw cimException;
|
3391 dave.sudlik 1.102 }
|
3392 dave.sudlik 1.98 }
3393 HandlerCatch(handler);
3394
3395 delete MI_request;
3396 delete MI_response;
3397
3398 PEG_METHOD_EXIT();
3399
3400 return(response);
3401 }
3402
|
3403 venkat.puvvada 1.108 Message * CMPIProviderManager::handleUnsupportedRequest(
3404 const Message * message)
|
3405 marek 1.63 {
|
3406 ms.aruran 1.115 PEG_METHOD_ENTER(
3407 TRC_PROVIDERMANAGER,
3408 "CMPIProviderManager::handleUnsupportedRequest()");
|
3409 marek 1.63 CIMRequestMessage* request =
3410 dynamic_cast<CIMRequestMessage *>(const_cast<Message *>(message));
3411 PEGASUS_ASSERT(request != 0 );
3412
3413 CIMResponseMessage* response = request->buildResponse();
3414 response->cimException =
3415 PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY);
3416
3417 PEG_METHOD_EXIT();
3418 return response;
3419 }
3420
3421 ProviderName CMPIProviderManager::_resolveProviderName(
3422 const ProviderIdContainer & providerId)
3423 {
3424 String providerName;
3425 String fileName;
3426 String location;
|
3427 dmitry.mikulin 1.114 String moduleName;
|
3428 marek 1.63 CIMValue genericValue;
3429
|
3430 ms.aruran 1.115 PEG_METHOD_ENTER(
3431 TRC_PROVIDERMANAGER,
3432 "CMPIProviderManager::_resolveProviderName()");
3433
|
3434 dmitry.mikulin 1.114 genericValue = providerId.getModule().getProperty(
3435 providerId.getModule().findProperty("Name")).getValue();
3436 genericValue.get(moduleName);
3437
|
3438 marek 1.63 genericValue = providerId.getProvider().getProperty(
3439 providerId.getProvider().findProperty("Name")).getValue();
3440 genericValue.get(providerName);
3441
3442 genericValue = providerId.getModule().getProperty(
3443 providerId.getModule().findProperty("Location")).getValue();
3444 genericValue.get(location);
3445 fileName = _resolvePhysicalName(location);
3446
|
3447 thilo.boehm 1.89 // An empty file name is only for interest if we are in the
3448 // local name space. So the message is only issued if not
3449 // in the remote Name Space.
3450 if (fileName == String::EMPTY && (!providerId.isRemoteNameSpace()))
3451 {
|
3452 venkat.puvvada 1.108 genericValue.get(location);
3453 String fullName = FileSystem::buildLibraryFileName(location);
3454 Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
3455 "ProviderManager.CMPI.CMPIProviderManager.CANNOT_FIND_LIBRARY",
3456 "For provider $0 library $1 was not found.",
3457 providerName, fullName);
|
3458 thilo.boehm 1.89
3459 }
|
3460 dmitry.mikulin 1.114 ProviderName name(moduleName, providerName, fileName);
|
3461 marek 1.63 name.setLocation(location);
|
3462 ms.aruran 1.115 PEG_METHOD_EXIT();
|
3463 marek 1.63 return name;
3464 }
3465
3466 void CMPIProviderManager::_callEnableIndications
3467 (CIMInstance & req_provider,
|
3468 venkat.puvvada 1.108 PEGASUS_INDICATION_CALLBACK_T _indicationCallback,
|
3469 venkat.puvvada 1.132 OpProviderHolder & ph,
|
3470 venkat.puvvada 1.108 const char* remoteInfo)
|
3471 marek 1.63 {
|
3472 ms.aruran 1.115 PEG_METHOD_ENTER(
3473 TRC_PROVIDERMANAGER,
3474 "CMPIProviderManager::_callEnableIndications()");
|
3475 marek 1.63
3476 try
3477 {
|
3478 w.otsuka 1.86 indProvRecord *provRec =0;
|
3479 marek 1.95 {
3480 WriteLock lock(rwSemProvTab);
3481
|
3482 venkat.puvvada 1.108 if (provTab.lookup (ph.GetProvider ().getName (), provRec))
3483 {
3484 provRec->enabled = true;
3485 CIMRequestMessage * request = 0;
3486 CIMResponseMessage * response = 0;
3487 provRec->handler=new EnableIndicationsResponseHandler(
3488 request,
3489 response,
3490 req_provider,
3491 _indicationCallback,
3492 _responseChunkCallback);
3493 }
|
3494 marek 1.95 }
|
3495 marek 1.63
3496 CMPIProvider & pr=ph.GetProvider();
3497
3498 //
3499 // Versions prior to 86 did not include enableIndications routine
3500 //
|
3501 venkat.puvvada 1.132 if (pr.getIndMI()->ft->ftVersion >= 86)
|
3502 marek 1.63 {
3503 OperationContext context;
|
3504 kumpf 1.112 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
|
3505 venkat.puvvada 1.108 // For the z/OS security model we always need an Identity container
3506 // in the operation context. Since we don't have a client request
3507 // ID here we have to use the cim servers identity for the time
3508 // being.
3509 IdentityContainer idContainer(System::getEffectiveUserName());
3510 context.insert(idContainer);
|
3511 kumpf 1.112 #endif
|
3512 marek 1.90
|
3513 marek 1.63 CMPIStatus rc={CMPI_RC_OK,NULL};
3514 CMPI_ContextOnStack eCtx(context);
|
3515 venkat.puvvada 1.132 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
3516 marek 1.63
|
3517 dave.sudlik 1.100 // Add RemoteInformation -V 5245
3518 if (remoteInfo)
3519 {
3520 eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",
|
3521 venkat.puvvada 1.108 (CMPIValue*)(const char*)remoteInfo,CMPI_chars);
|
3522 dave.sudlik 1.100 }
3523
|
3524 ms.aruran 1.115 PEG_TRACE_STRING(
3525 TRC_PROVIDERMANAGER,
3526 Tracer::LEVEL4,
|
3527 marek 1.63 "Calling provider.enableIndications: " + pr.getName());
3528
|
3529 venkat.puvvada 1.111 pr.protect();
|
3530 marek 1.63
|
3531 dave.sudlik 1.101 // enableIndications() is defined by the CMPI standard as
3532 // returning a CMPIStatus return value. Unfortunately, Pegasus
3533 // originally implemented enableIndications() with a void
3534 // return type, and this incompatibility was not detected for
3535 // some time. Since exceptions thrown from enableIndications()
3536 // are not reported (other than via logging), it was decided to
3537 // discard the returned CMPIStatus here. This will prevent us from
3538 // breaking existing CMPI Indication providers. This is ok since
3539 // there really isn't a user to which the problem should be
3540 // reported.
|
3541 venkat.puvvada 1.132 pr.getIndMI()->ft->enableIndications(pr.getIndMI(),&eCtx);
|
3542 marek 1.63 }
3543 else
3544 {
|
3545 ms.aruran 1.115 PEG_TRACE_STRING(
3546 TRC_PROVIDERMANAGER,
3547 Tracer::LEVEL4,
|
3548 marek 1.63 "Not calling provider.enableIndications: " + pr.getName() +
|
3549 venkat.puvvada 1.108 " routine as it is an earlier version that does not support " \
3550 "this function");
|
3551 marek 1.63 }
3552 }
|
3553 konrad.r 1.64 catch (const Exception & e)
|
3554 marek 1.63 {
3555 Logger::put_l (Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
3556 "ProviderManager.CMPI.CMPIProviderManager."
|
3557 venkat.puvvada 1.108 "ENABLE_INDICATIONS_FAILED",
|
3558 marek 1.63 "Failed to enable indications for provider $0: $1.",
3559 ph.GetProvider ().getName (), e.getMessage ());
3560 }
|
3561 venkat.puvvada 1.108 catch (...)
|
3562 marek 1.63 {
3563 Logger::put_l (Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
3564 "ProviderManager.CMPI.CMPIProviderManager."
|
3565 venkat.puvvada 1.108 "ENABLE_INDICATIONS_FAILED_UNKNOWN",
|
3566 marek 1.63 "Failed to enable indications for provider $0.",
3567 ph.GetProvider ().getName ());
3568 }
3569
3570 PEG_METHOD_EXIT ();
3571 }
3572
3573 void CMPIProviderManager::_callDisableIndications
|
3574 venkat.puvvada 1.132 (OpProviderHolder & ph, const char *remoteInfo)
|
3575 marek 1.63 {
|
3576 ms.aruran 1.115 PEG_METHOD_ENTER(
3577 TRC_PROVIDERMANAGER,
3578 "CMPIProviderManager::_callDisableIndications()");
|
3579 marek 1.63
|
3580 dave.sudlik 1.101 try
|
3581 marek 1.95 {
|
3582 dave.sudlik 1.101 indProvRecord * provRec = 0;
3583 {
3584 WriteLock writeLock(rwSemProvTab);
|
3585 venkat.puvvada 1.108 if (provTab.lookup (ph.GetProvider ().getName (), provRec))
3586 {
3587 provRec->enabled = false;
3588 if (provRec->handler) delete provRec->handler;
3589 provRec->handler = NULL;
3590 }
|
3591 dave.sudlik 1.101 }
3592
3593 CMPIProvider & pr=ph.GetProvider();
|
3594 marek 1.63
|
3595 dave.sudlik 1.101 //
3596 // Versions prior to 86 did not include disableIndications routine
3597 //
|
3598 venkat.puvvada 1.132 if (pr.getIndMI()->ft->ftVersion >= 86)
|
3599 dave.sudlik 1.101 {
3600 OperationContext context;
3601 CMPIStatus rc={CMPI_RC_OK,NULL};
3602 CMPI_ContextOnStack eCtx(context);
3603
3604 if (remoteInfo)
3605 {
|
3606 venkat.puvvada 1.108 eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",
3607 (CMPIValue*)(const char*)remoteInfo,CMPI_chars);
|
3608 dave.sudlik 1.101 }
|
3609 venkat.puvvada 1.132 CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
|
3610 dave.sudlik 1.96
|
3611 ms.aruran 1.115 PEG_TRACE_STRING(
3612 TRC_PROVIDERMANAGER,
3613 Tracer::LEVEL4,
|
3614 dave.sudlik 1.101 "Calling provider.disableIndications: " + pr.getName());
|
3615 dave.sudlik 1.100
|
3616 dave.sudlik 1.101 // disableIndications() is defined by the CMPI standard as
3617 // returning a CMPIStatus return value. Unfortunately, Pegasus
3618 // originally implemented disableIndications() with a void
3619 // return type, and this incompatibility was not detected for
3620 // some time. For consistency with the enableIndications()
3621 // interface, it was decided to discard the returned CMPIStatus
3622 // here. This will prevent us from breaking existing CMPI
3623 // Indication providers. This is ok since there really isn't a
3624 // user to which the problem should be reported.
|
3625 venkat.puvvada 1.132 pr.getIndMI()->ft->disableIndications(
3626 pr.getIndMI(),
|
3627 venkat.puvvada 1.108 &eCtx);
|
3628 marek 1.63
|
3629 venkat.puvvada 1.111 pr.unprotect();
|
3630 dave.sudlik 1.101 }
3631 else
3632 {
|
3633 ms.aruran 1.115 PEG_TRACE_STRING(
3634 TRC_PROVIDERMANAGER,
3635 Tracer::LEVEL4,
|
3636 dave.sudlik 1.101 "Not calling provider.disableIndications: "
3637 + pr.getName() +
|
3638 venkat.puvvada 1.108 " routine as it is an earlier version that does not support" \
3639 " this function");
|
3640 dave.sudlik 1.101 }
3641 }
3642 catch (const Exception & e)
3643 {
3644 Logger::put_l (Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
3645 "ProviderManager.CMPI.CMPIProviderManager."
|
3646 venkat.puvvada 1.108 "DISABLE_INDICATIONS_FAILED",
|
3647 dave.sudlik 1.101 "Failed to disable indications for provider $0: $1.",
3648 ph.GetProvider ().getName (), e.getMessage ());
|
3649 marek 1.63 }
|
3650 venkat.puvvada 1.108 catch (...)
|
3651 marek 1.63 {
|
3652 dave.sudlik 1.101 Logger::put_l (Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
3653 "ProviderManager.CMPI.CMPIProviderManager."
|
3654 venkat.puvvada 1.108 "DISABLE_INDICATIONS_FAILED_UNKNOWN",
|
3655 dave.sudlik 1.101 "Failed to disable indications for provider $0.",
3656 ph.GetProvider ().getName ());
|
3657 marek 1.63 }
3658
3659 PEG_METHOD_EXIT ();
3660 }
3661
3662 PEGASUS_NAMESPACE_END
|
3663 venkat.puvvada 1.108
|