1 a.dunfey 1.56.2.1 //%2006////////////////////////////////////////////////////////////////////////
|
2 chip 1.1 //
|
3 karl 1.43 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.7 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.43 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.47 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 a.dunfey 1.56.2.1 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 chip 1.1 //
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.43 //
|
21 chip 1.1 // 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 // Author: Chip Vincent (cvincent@us.ibm.com)
33 //
34 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
35 // (carolann_graves@hp.com)
36 // Mike Day, IBM (mdday@us.ibm.com)
37 // Karl Schopmeyer(k.schopmeyer@opengroup.org) - Fix associators.
|
38 kumpf 1.28 // Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com)
|
39 kumpf 1.31 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
40 carolann.graves 1.49 // Seema Gupta (gseema@in.ibm.com) for PEP135
41 // Willis White (whiwill@us.ibm.com)
42 // Josephine Eskaline Joyce (jojustin@in.ibm.com) for PEP#101
|
43 chip 1.1 //
44 //%/////////////////////////////////////////////////////////////////////////////
45
46 #include "DefaultProviderManager.h"
47
48 #include <Pegasus/Common/CIMMessage.h>
49 #include <Pegasus/Common/OperationContext.h>
50 #include <Pegasus/Common/Tracer.h>
51 #include <Pegasus/Common/StatisticalData.h>
52 #include <Pegasus/Common/Logger.h>
53 #include <Pegasus/Common/MessageLoader.h> //l10n
|
54 kumpf 1.38 #include <Pegasus/Common/Constants.h>
|
55 chip 1.1
|
56 chuck 1.44 #include <Pegasus/Query/QueryExpression/QueryExpression.h>
|
57 schuur 1.12 #include <Pegasus/ProviderManager2/QueryExpressionFactory.h>
58
|
59 chip 1.1 #include <Pegasus/ProviderManager2/Default/Provider.h>
|
60 schuur 1.21 #include <Pegasus/ProviderManager2/OperationResponseHandler.h>
|
61 chip 1.1
|
62 schuur 1.14 #include <Pegasus/ProviderManager2/ProviderManagerService.h>
|
63 kumpf 1.28 #include <Pegasus/ProviderManager2/ProviderType.h>
|
64 chip 1.1
|
65 a.dunfey 1.56.2.1 #define HandleCatch(handler) \
66 catch(CIMException & e) \
67 { \
68 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \
69 "Exception: " + e.getMessage()); \
70 handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); \
71 } \
72 catch(Exception & e) \
73 { \
74 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \
75 "Exception: " + e.getMessage()); \
76 handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage());\
77 } \
78 catch(...) \
79 { \
80 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \
81 "Exception: Unknown"); \
82 handler.setStatus(CIM_ERR_FAILED, "Unknown error."); \
83 } \
84 STAT_RESPONSEEND
85
86 a.dunfey 1.56.2.1
|
87 chip 1.1 PEGASUS_NAMESPACE_BEGIN
88
89 // auto variable to protect provider during operations
90 class pm_service_op_lock
91 {
92 private:
93 pm_service_op_lock(void);
94
95 public:
96 pm_service_op_lock(Provider *provider) : _provider(provider)
97 {
98 _provider->protect();
99 }
100
101 ~pm_service_op_lock(void)
102 {
103 _provider->unprotect();
104 }
105
106 Provider * _provider;
107 };
108 chip 1.1
109 //
|
110 kumpf 1.31 // Default Provider Manager
111 //
|
112 chip 1.1 DefaultProviderManager::DefaultProviderManager(void)
113 {
|
114 carolann.graves 1.49 _subscriptionInitComplete = false;
|
115 chip 1.1 }
116
117 DefaultProviderManager::~DefaultProviderManager(void)
118 {
119 }
120
|
121 dj.gorey 1.25 Message * DefaultProviderManager::processMessage(Message * request)
|
122 chip 1.1 {
123 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
124 "DefaultProviderManager::processMessage()");
125
126 Message * response = 0;
127
128 // pass the request message to a handler method based on message type
129 switch(request->getType())
130 {
131 case CIM_GET_INSTANCE_REQUEST_MESSAGE:
|
132 dj.gorey 1.25 response = handleGetInstanceRequest(request);
|
133 chip 1.1
134 break;
135 case CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE:
|
136 dj.gorey 1.25 response = handleEnumerateInstancesRequest(request);
|
137 chip 1.1
138 break;
139 case CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE:
|
140 dj.gorey 1.25 response = handleEnumerateInstanceNamesRequest(request);
|
141 chip 1.1
142 break;
143 case CIM_CREATE_INSTANCE_REQUEST_MESSAGE:
|
144 dj.gorey 1.25 response = handleCreateInstanceRequest(request);
|
145 chip 1.1
146 break;
147 case CIM_MODIFY_INSTANCE_REQUEST_MESSAGE:
|
148 dj.gorey 1.25 response = handleModifyInstanceRequest(request);
|
149 chip 1.1
150 break;
151 case CIM_DELETE_INSTANCE_REQUEST_MESSAGE:
|
152 dj.gorey 1.25 response = handleDeleteInstanceRequest(request);
|
153 chip 1.1
154 break;
155 case CIM_EXEC_QUERY_REQUEST_MESSAGE:
|
156 dj.gorey 1.25 response = handleExecQueryRequest(request);
|
157 chip 1.1
158 break;
159 case CIM_ASSOCIATORS_REQUEST_MESSAGE:
|
160 dj.gorey 1.25 response = handleAssociatorsRequest(request);
|
161 chip 1.1
162 break;
163 case CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE:
|
164 dj.gorey 1.25 response = handleAssociatorNamesRequest(request);
|
165 chip 1.1
166 break;
167 case CIM_REFERENCES_REQUEST_MESSAGE:
|
168 dj.gorey 1.25 response = handleReferencesRequest(request);
|
169 chip 1.1
170 break;
171 case CIM_REFERENCE_NAMES_REQUEST_MESSAGE:
|
172 dj.gorey 1.25 response = handleReferenceNamesRequest(request);
|
173 chip 1.1
174 break;
175 case CIM_GET_PROPERTY_REQUEST_MESSAGE:
|
176 dj.gorey 1.25 response = handleGetPropertyRequest(request);
|
177 chip 1.1
178 break;
179 case CIM_SET_PROPERTY_REQUEST_MESSAGE:
|
180 dj.gorey 1.25 response = handleSetPropertyRequest(request);
|
181 chip 1.1
182 break;
183 case CIM_INVOKE_METHOD_REQUEST_MESSAGE:
|
184 dj.gorey 1.25 response = handleInvokeMethodRequest(request);
|
185 chip 1.1
186 break;
187 case CIM_CREATE_SUBSCRIPTION_REQUEST_MESSAGE:
|
188 dj.gorey 1.25 response = handleCreateSubscriptionRequest(request);
|
189 chip 1.1
190 break;
191 case CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE:
|
192 dj.gorey 1.25 response = handleModifySubscriptionRequest(request);
|
193 chip 1.1
194 break;
195 case CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE:
|
196 dj.gorey 1.25 response = handleDeleteSubscriptionRequest(request);
|
197 chip 1.1
198 break;
|
199 schuur 1.14 case CIM_EXPORT_INDICATION_REQUEST_MESSAGE:
|
200 dj.gorey 1.25 response = handleExportIndicationRequest(request);
|
201 schuur 1.14 break;
202
|
203 chip 1.1 case CIM_DISABLE_MODULE_REQUEST_MESSAGE:
|
204 dj.gorey 1.25 response = handleDisableModuleRequest(request);
|
205 chip 1.1
206 break;
207 case CIM_ENABLE_MODULE_REQUEST_MESSAGE:
|
208 dj.gorey 1.25 response = handleEnableModuleRequest(request);
|
209 chip 1.1
210 break;
211 case CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE:
|
212 dj.gorey 1.25 response = handleStopAllProvidersRequest(request);
|
213 chip 1.1
214 break;
|
215 kumpf 1.30 case CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE:
216 response = handleInitializeProviderRequest(request);
217
218 break;
|
219 carolann.graves 1.49 case CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE:
220 response = handleSubscriptionInitCompleteRequest (request);
221
222 break;
|
223 chip 1.1 default:
|
224 dj.gorey 1.25 response = handleUnsupportedRequest(request);
|
225 chip 1.1
226 break;
227 }
228
229 PEG_METHOD_EXIT();
230
231 return(response);
232 }
233
|
234 dj.gorey 1.25 Message * DefaultProviderManager::handleUnsupportedRequest(const Message * message)
|
235 chip 1.1 {
236 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleUnsupportedRequest");
237
238 PEG_METHOD_EXIT();
239
240 // a null response implies unsupported or unknown operation
241 return(0);
242 }
243
|
244 kumpf 1.30 Message * DefaultProviderManager::handleInitializeProviderRequest(
245 const Message * message)
246 {
247 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
248 "DefaultProviderManager::handleInitializeProviderRequest");
249
250 CIMInitializeProviderRequestMessage * request =
251 dynamic_cast<CIMInitializeProviderRequestMessage *>
252 (const_cast<Message *>(message));
253
254 PEGASUS_ASSERT(request != 0);
255
|
256 kumpf 1.54 CIMInitializeProviderResponseMessage* response =
257 dynamic_cast<CIMInitializeProviderResponseMessage*>(
258 request->buildResponse());
259 PEGASUS_ASSERT(response != 0);
|
260 kumpf 1.30
261 OperationResponseHandler handler(request, response);
262
263 try
264 {
265 // resolve provider name
266 ProviderName name = _resolveProviderName(
267 request->operationContext.get(ProviderIdContainer::NAME));
268
269 // get cached or load new provider module
|
270 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
271 name.getPhysicalName(), name.getLogicalName());
|
272 kumpf 1.30 }
273 catch(CIMException & e)
274 {
275 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3,
276 "CIMException: " + e.getMessage());
277
278 handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage());
279 }
280 catch(Exception & e)
281 {
282 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3,
283 "Exception: " + e.getMessage());
284
285 handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage());
286 }
287 catch(...)
288 {
289 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3,
290 "Exception: Unknown");
291
292 handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
293 kumpf 1.30 }
294
295 PEG_METHOD_EXIT();
296
297 return(response);
298 }
299
|
300 dj.gorey 1.25 Message * DefaultProviderManager::handleGetInstanceRequest(const Message * message)
|
301 chip 1.1 {
302 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleGetInstanceRequest");
303
304 CIMGetInstanceRequestMessage * request =
305 dynamic_cast<CIMGetInstanceRequestMessage *>(const_cast<Message *>(message));
306
307 PEGASUS_ASSERT(request != 0);
308
|
309 kumpf 1.54 CIMGetInstanceResponseMessage* response =
310 dynamic_cast<CIMGetInstanceResponseMessage*>(
311 request->buildResponse());
|
312 chip 1.1 PEGASUS_ASSERT(response != 0);
313
314 // create a handler for this request
315 GetInstanceResponseHandler handler(request, response);
316
317 try
318 {
319 Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
320 "DefaultProviderManager::handleGetInstanceRequest - Host name: $0 Name space: $1 Class name: $2",
321 System::getHostName(),
322 request->nameSpace.getString(),
323 request->instanceName.getClassName().getString());
324
325 // make target object path
326 CIMObjectPath objectPath(
327 System::getHostName(),
328 request->nameSpace,
329 request->instanceName.getClassName(),
330 request->instanceName.getKeyBindings());
331
|
332 chip 1.5 // resolve provider name
|
333 kumpf 1.28 ProviderName name = _resolveProviderName(
334 request->operationContext.get(ProviderIdContainer::NAME));
|
335 chip 1.1
336 // get cached or load new provider module
|
337 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
338 name.getPhysicalName(), name.getLogicalName());
|
339 chip 1.1
340 // convert arguments
341 OperationContext context;
342
|
343 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
344 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
345 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
346 chip 1.1
347 CIMPropertyList propertyList(request->propertyList);
348
349 // forward request
350 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
351 "Calling provider.getInstance: " +
352 ph.GetProvider().getName());
353
354 pm_service_op_lock op_lock(&ph.GetProvider());
355
|
356 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
357 chip 1.1
358 ph.GetProvider().getInstance(
359 context,
360 objectPath,
361 request->includeQualifiers,
362 request->includeClassOrigin,
363 propertyList,
364 handler);
365 }
|
366 a.dunfey 1.56.2.1 HandleCatch(handler);
|
367 chip 1.1
368 PEG_METHOD_EXIT();
369
|
370 w.white 1.53 STAT_COPYDISPATCHER
371
|
372 chip 1.1 return(response);
373 }
374
|
375 dj.gorey 1.25 Message * DefaultProviderManager::handleEnumerateInstancesRequest(const Message * message)
|
376 chip 1.1 {
377 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleEnumerateInstanceRequest");
378
379 CIMEnumerateInstancesRequestMessage * request =
380 dynamic_cast<CIMEnumerateInstancesRequestMessage *>(const_cast<Message *>(message));
381
382 PEGASUS_ASSERT(request != 0);
383
|
384 kumpf 1.54 CIMEnumerateInstancesResponseMessage* response =
385 dynamic_cast<CIMEnumerateInstancesResponseMessage*>(
386 request->buildResponse());
|
387 chip 1.1 PEGASUS_ASSERT(response != 0);
388
389 // create a handler for this request
390 EnumerateInstancesResponseHandler handler(request, response);
391
392 try
393 {
|
394 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
395 Logger::TRACE,
396 "DefaultProviderManager::handleEnumerateInstancesRequest - "
397 "Host name: $0 Name space: $1 Class name: $2",
|
398 chip 1.1 System::getHostName(),
399 request->nameSpace.getString(),
|
400 mike 1.56 request->className.getString()));
|
401 chip 1.1
402 // make target object path
403 CIMObjectPath objectPath(
404 System::getHostName(),
405 request->nameSpace,
406 request->className);
407
|
408 chip 1.5 // resolve provider name
|
409 kumpf 1.28 ProviderName name = _resolveProviderName(
410 request->operationContext.get(ProviderIdContainer::NAME));
|
411 chip 1.1
412 // get cached or load new provider module
|
413 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
414 name.getPhysicalName(), name.getLogicalName());
|
415 chip 1.1
416 // convert arguments
417 OperationContext context;
418
|
419 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
420 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
421 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
422 chip 1.1
423 CIMPropertyList propertyList(request->propertyList);
424
425 // forward request
426 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
427 "Calling provider.enumerateInstances: " +
428 ph.GetProvider().getName());
429
430 pm_service_op_lock op_lock(&ph.GetProvider());
431
|
432 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
433 chip 1.1
434 ph.GetProvider().enumerateInstances(
435 context,
436 objectPath,
437 request->includeQualifiers,
438 request->includeClassOrigin,
439 propertyList,
440 handler);
441 }
|
442 a.dunfey 1.56.2.1 HandleCatch(handler);
|
443 chip 1.1
444 PEG_METHOD_EXIT();
445
|
446 w.white 1.53 STAT_COPYDISPATCHER
447
|
448 chip 1.1 return(response);
449 }
450
|
451 dj.gorey 1.25 Message * DefaultProviderManager::handleEnumerateInstanceNamesRequest(const Message * message)
|
452 chip 1.1 {
453 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleEnumerateInstanceNamesRequest");
454
455 CIMEnumerateInstanceNamesRequestMessage * request =
456 dynamic_cast<CIMEnumerateInstanceNamesRequestMessage *>(const_cast<Message *>(message));
457
458 PEGASUS_ASSERT(request != 0);
459
|
460 kumpf 1.54 CIMEnumerateInstanceNamesResponseMessage* response =
461 dynamic_cast<CIMEnumerateInstanceNamesResponseMessage*>(
462 request->buildResponse());
|
463 chip 1.1 PEGASUS_ASSERT(response != 0);
464
465 // create a handler for this request
466 EnumerateInstanceNamesResponseHandler handler(request, response);
467
468 // process the request
469 try
470 {
|
471 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
472 Logger::TRACE,
473 "DefaultProviderManager::handleEnumerateInstanceNamesRequest - "
474 "Host name: $0 Name space: $1 Class name: $2",
|
475 chip 1.1 System::getHostName(),
476 request->nameSpace.getString(),
|
477 mike 1.56 request->className.getString()));
|
478 chip 1.1
479 // make target object path
480 CIMObjectPath objectPath(
481 System::getHostName(),
482 request->nameSpace,
483 request->className);
484
|
485 chip 1.5 // resolve provider name
|
486 kumpf 1.28 ProviderName name = _resolveProviderName(
487 request->operationContext.get(ProviderIdContainer::NAME));
|
488 chip 1.1
489 // get cached or load new provider module
|
490 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
491 name.getPhysicalName(), name.getLogicalName());
|
492 chip 1.1
493 // convert arguments
494 OperationContext context;
495
|
496 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
497 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
498 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
499
|
500 chip 1.1 // forward request
501 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
502 "Calling provider.enumerateInstanceNames: " +
503 ph.GetProvider().getName());
504
505 pm_service_op_lock op_lock(&ph.GetProvider());
506
|
507 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
508 chip 1.1
509 ph.GetProvider().enumerateInstanceNames(
510 context,
511 objectPath,
512 handler);
513 }
|
514 a.dunfey 1.56.2.1 HandleCatch(handler);
|
515 chip 1.1
516 PEG_METHOD_EXIT();
517
|
518 w.white 1.53 STAT_COPYDISPATCHER
519
|
520 chip 1.1 return(response);
521 }
522
|
523 dj.gorey 1.25 Message * DefaultProviderManager::handleCreateInstanceRequest(const Message * message)
|
524 chip 1.1 {
525 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleCreateInstanceRequest");
526
527 CIMCreateInstanceRequestMessage * request =
528 dynamic_cast<CIMCreateInstanceRequestMessage *>(const_cast<Message *>(message));
529
530 PEGASUS_ASSERT(request != 0);
531
532 // create response message
|
533 kumpf 1.54 CIMCreateInstanceResponseMessage* response =
534 dynamic_cast<CIMCreateInstanceResponseMessage*>(
535 request->buildResponse());
|
536 chip 1.1 PEGASUS_ASSERT(response != 0);
537
538 // create a handler for this request
539 CreateInstanceResponseHandler handler(request, response);
540
541 try
542 {
|
543 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
544 Logger::TRACE,
545 "DefaultProviderManager::handleCreateInstanceRequest - "
546 "Host name: $0 Name space: $1 Class name: $2",
|
547 chip 1.1 System::getHostName(),
548 request->nameSpace.getString(),
|
549 mike 1.56 request->newInstance.getPath().getClassName().getString()));
|
550 chip 1.1
551 // make target object path
552 CIMObjectPath objectPath(
553 System::getHostName(),
554 request->nameSpace,
555 request->newInstance.getPath().getClassName(),
556 request->newInstance.getPath().getKeyBindings());
557
|
558 chip 1.5 // resolve provider name
|
559 kumpf 1.28 ProviderName name = _resolveProviderName(
560 request->operationContext.get(ProviderIdContainer::NAME));
|
561 chip 1.1
562 // get cached or load new provider module
|
563 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
564 name.getPhysicalName(), name.getLogicalName());
|
565 chip 1.1
566 // convert arguments
567 OperationContext context;
568
|
569 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
570 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
571 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
572 chip 1.1
573 // forward request
574 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
575 "Calling provider.createInstance: " +
576 ph.GetProvider().getName());
577
578 pm_service_op_lock op_lock(&ph.GetProvider());
579
|
580 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
581 chip 1.1
582 ph.GetProvider().createInstance(
583 context,
584 objectPath,
585 request->newInstance,
586 handler);
587 }
|
588 a.dunfey 1.56.2.1 HandleCatch(handler);
|
589 chip 1.1
590 PEG_METHOD_EXIT();
591
|
592 w.white 1.53 STAT_COPYDISPATCHER
593
|
594 chip 1.1 return(response);
595 }
596
|
597 dj.gorey 1.25 Message * DefaultProviderManager::handleModifyInstanceRequest(const Message * message)
|
598 chip 1.1 {
599 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleModifyInstanceRequest");
600
601 CIMModifyInstanceRequestMessage * request =
602 dynamic_cast<CIMModifyInstanceRequestMessage *>(const_cast<Message *>(message));
603
604 PEGASUS_ASSERT(request != 0);
605
606 // create response message
|
607 kumpf 1.54 CIMModifyInstanceResponseMessage* response =
608 dynamic_cast<CIMModifyInstanceResponseMessage*>(
609 request->buildResponse());
|
610 chip 1.1 PEGASUS_ASSERT(response != 0);
611
612 // create a handler for this request
613 ModifyInstanceResponseHandler handler(request, response);
614
615 try
616 {
|
617 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
618 Logger::TRACE,
619 "DefaultProviderManager::handleModifyInstanceRequest - "
620 "Host name: $0 Name space: $1 Class name: $2",
|
621 chip 1.1 System::getHostName(),
622 request->nameSpace.getString(),
|
623 mike 1.56 request->modifiedInstance.getPath().getClassName().getString()));
|
624 chip 1.1
625 // make target object path
626 CIMObjectPath objectPath(
627 System::getHostName(),
628 request->nameSpace,
629 request->modifiedInstance.getPath ().getClassName(),
630 request->modifiedInstance.getPath ().getKeyBindings());
631
|
632 chip 1.5 // resolve provider name
|
633 kumpf 1.28 ProviderName name = _resolveProviderName(
634 request->operationContext.get(ProviderIdContainer::NAME));
|
635 chip 1.1
636 // get cached or load new provider module
|
637 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
638 name.getPhysicalName(), name.getLogicalName());
|
639 chip 1.1
640 // convert arguments
641 OperationContext context;
642
|
643 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
644 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
645 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
646 chip 1.1
647 CIMPropertyList propertyList(request->propertyList);
648
649 // forward request
650 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
651 "Calling provider.modifyInstance: " +
652 ph.GetProvider().getName());
653
654 pm_service_op_lock op_lock(&ph.GetProvider());
655
|
656 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
657 chip 1.1
658 ph.GetProvider().modifyInstance(
659 context,
660 objectPath,
661 request->modifiedInstance,
662 request->includeQualifiers,
663 propertyList,
664 handler);
665 }
|
666 a.dunfey 1.56.2.1 HandleCatch(handler);
|
667 chip 1.1
668 PEG_METHOD_EXIT();
669
|
670 w.white 1.53 STAT_COPYDISPATCHER
671
|
672 chip 1.1 return(response);
673 }
674
|
675 dj.gorey 1.25 Message * DefaultProviderManager::handleDeleteInstanceRequest(const Message * message)
|
676 chip 1.1 {
677 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleDeleteInstanceRequest");
678
679 CIMDeleteInstanceRequestMessage * request =
680 dynamic_cast<CIMDeleteInstanceRequestMessage *>(const_cast<Message *>(message));
681
682 PEGASUS_ASSERT(request != 0);
683
684 // create response message
|
685 kumpf 1.54 CIMDeleteInstanceResponseMessage* response =
686 dynamic_cast<CIMDeleteInstanceResponseMessage*>(
687 request->buildResponse());
|
688 chip 1.1 PEGASUS_ASSERT(response != 0);
689
690 // create a handler for this request
691 DeleteInstanceResponseHandler handler(request, response);
692
693 try
694 {
|
695 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
696 Logger::TRACE,
697 "DefaultProviderManager::handleDeleteInstanceRequest - "
698 "Host name: $0 Name space: $1 Class name: $2",
|
699 chip 1.1 System::getHostName(),
700 request->nameSpace.getString(),
|
701 mike 1.56 request->instanceName.getClassName().getString()));
|
702 chip 1.1
703 // make target object path
704 CIMObjectPath objectPath(
705 System::getHostName(),
706 request->nameSpace,
707 request->instanceName.getClassName(),
708 request->instanceName.getKeyBindings());
709
|
710 chip 1.5 // resolve provider name
|
711 kumpf 1.28 ProviderName name = _resolveProviderName(
712 request->operationContext.get(ProviderIdContainer::NAME));
|
713 chip 1.1
714 // get cached or load new provider module
|
715 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
716 name.getPhysicalName(), name.getLogicalName());
|
717 chip 1.1
718 // convert arguments
719 OperationContext context;
720
|
721 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
722 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
723 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
724 chip 1.1
725 // forward request
726 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
727 "Calling provider.deleteInstance: " +
728 ph.GetProvider().getName());
729
730 pm_service_op_lock op_lock(&ph.GetProvider());
731
|
732 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
733 chip 1.1
734 ph.GetProvider().deleteInstance(
735 context,
736 objectPath,
737 handler);
738 }
|
739 a.dunfey 1.56.2.1 HandleCatch(handler);
|
740 chip 1.1
741 PEG_METHOD_EXIT();
742
|
743 w.white 1.53 STAT_COPYDISPATCHER
744
|
745 chip 1.1 return(response);
746 }
747
|
748 dj.gorey 1.25 Message * DefaultProviderManager::handleExecQueryRequest(const Message * message)
|
749 chip 1.1 {
|
750 schuur 1.12 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleExecQueryRequest");
|
751 chip 1.1
752 CIMExecQueryRequestMessage * request =
753 dynamic_cast<CIMExecQueryRequestMessage *>(const_cast<Message *>(message));
754
755 PEGASUS_ASSERT(request != 0);
756
|
757 kumpf 1.54 CIMExecQueryResponseMessage* response =
758 dynamic_cast<CIMExecQueryResponseMessage*>(
759 request->buildResponse());
|
760 chip 1.1 PEGASUS_ASSERT(response != 0);
761
|
762 schuur 1.12 // create a handler for this request
763 ExecQueryResponseHandler handler(request, response);
764
765 try
766 {
|
767 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
768 Logger::TRACE,
769 "DefaultProviderManager::handleExecQueryRequest - "
770 "Host name: $0 Name space: $1 Class name: $2",
|
771 schuur 1.12 System::getHostName(),
772 request->nameSpace.getString(),
|
773 mike 1.56 request->className.getString()));
|
774 schuur 1.12
775 // make target object path
776 CIMObjectPath objectPath(
777 System::getHostName(),
778 request->nameSpace,
779 request->className);
780
781 // resolve provider name
|
782 kumpf 1.28 ProviderName name = _resolveProviderName(
783 request->operationContext.get(ProviderIdContainer::NAME));
|
784 schuur 1.12
785 // get cached or load new provider module
|
786 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
787 name.getPhysicalName(), name.getLogicalName());
|
788 schuur 1.12
789 if (dynamic_cast<CIMInstanceQueryProvider*>(ph.GetCIMProvider()) == 0) {
790 String errorString = " instance provider is registered supporting execQuery "
|
791 dj.gorey 1.25 "but is not a CIMQueryInstanceProvider subclass.";
|
792 schuur 1.12 throw CIMException(CIM_ERR_FAILED,"ProviderLoadFailure (" + name.getPhysicalName() + ":" +
|
793 dj.gorey 1.25 name.getLogicalName() + "):" + errorString);
|
794 schuur 1.12 }
795
796 // convert arguments
797 OperationContext context;
798
|
799 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
800 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
801 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
802 schuur 1.12
|
803 chuck 1.44 QueryExpression qx(request->queryLanguage,request->query);
|
804 schuur 1.12
805 // forward request
806 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
807 "Calling provider.executeQueryRequest: " +
808 ph.GetProvider().getName());
809
810 pm_service_op_lock op_lock(&ph.GetProvider());
811
|
812 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
813 schuur 1.12
814 ph.GetProvider().execQuery(
815 context,
816 objectPath,
817 qx,
818 handler);
819 }
|
820 a.dunfey 1.56.2.1 HandleCatch(handler);
|
821 chip 1.1
822 PEG_METHOD_EXIT();
823
824 return(response);
825 }
826
|
827 dj.gorey 1.25 Message * DefaultProviderManager::handleAssociatorsRequest(const Message * message)
|
828 chip 1.1 {
829 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleAssociatorsRequest");
830
831 CIMAssociatorsRequestMessage * request =
832 dynamic_cast<CIMAssociatorsRequestMessage *>(const_cast<Message *>(message));
833
834 PEGASUS_ASSERT(request != 0);
835
|
836 kumpf 1.54 CIMAssociatorsResponseMessage* response =
837 dynamic_cast<CIMAssociatorsResponseMessage*>(
838 request->buildResponse());
|
839 chip 1.1 PEGASUS_ASSERT(response != 0);
840
841 // create a handler for this request
842 AssociatorsResponseHandler handler(request, response);
843
844 // process the request
845 try
846 {
|
847 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
848 Logger::TRACE,
849 "DefaultProviderManager::handleAssociatorsRequest - "
850 "Host name: $0 Name space: $1 Class name: $2",
|
851 chip 1.1 System::getHostName(),
852 request->nameSpace.getString(),
|
853 mike 1.56 request->objectName.getClassName().getString()));
|
854 chip 1.1
855 // make target object path
856 CIMObjectPath objectPath(
857 System::getHostName(),
858 request->nameSpace,
859 request->objectName.getClassName());
860
861 objectPath.setKeyBindings(request->objectName.getKeyBindings());
862
|
863 schuur 1.19 CIMObjectPath assocPath(
864 System::getHostName(),
865 request->nameSpace,
866 request->assocClass.getString());
867
|
868 chip 1.5 // resolve provider name
|
869 kumpf 1.28 ProviderName name = _resolveProviderName(
870 request->operationContext.get(ProviderIdContainer::NAME));
|
871 chip 1.2
872 // get cached or load new provider module
|
873 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
874 name.getPhysicalName(), name.getLogicalName());
|
875 chip 1.2
876 // convert arguments
877 OperationContext context;
878
|
879 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
880 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
881 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
882
|
883 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
884 chip 1.2 pm_service_op_lock op_lock(&ph.GetProvider());
|
885 chip 1.1
|
886 chip 1.2 ph.GetProvider().associators(
887 context,
888 objectPath,
889 request->assocClass,
890 request->resultClass,
891 request->role,
892 request->resultRole,
893 request->includeQualifiers,
894 request->includeClassOrigin,
|
895 a.dunfey 1.39 request->propertyList,
|
896 chip 1.2 handler);
|
897 chip 1.1 }
|
898 a.dunfey 1.56.2.1 HandleCatch(handler);
|
899 chip 1.1
900 PEG_METHOD_EXIT();
901
|
902 w.white 1.53 STAT_COPYDISPATCHER
903
|
904 chip 1.1 return(response);
905 }
906
|
907 dj.gorey 1.25 Message * DefaultProviderManager::handleAssociatorNamesRequest(const Message * message)
|
908 chip 1.1 {
909 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleAssociatorNamesRequest");
910
911 CIMAssociatorNamesRequestMessage * request =
912 dynamic_cast<CIMAssociatorNamesRequestMessage *>(const_cast<Message *>(message));
913
914 PEGASUS_ASSERT(request != 0);
915
|
916 kumpf 1.54 CIMAssociatorNamesResponseMessage* response =
917 dynamic_cast<CIMAssociatorNamesResponseMessage*>(
918 request->buildResponse());
|
919 chip 1.1 PEGASUS_ASSERT(response != 0);
920
921 // create a handler for this request
922 AssociatorNamesResponseHandler handler(request, response);
923
924 // process the request
925 try
926 {
|
927 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
928 Logger::TRACE,
929 "DefaultProviderManager::handleAssociationNamesRequest - "
930 "Host name: $0 Name space: $1 Class name: $2",
|
931 chip 1.1 System::getHostName(),
932 request->nameSpace.getString(),
|
933 mike 1.56 request->objectName.getClassName().getString()));
|
934 chip 1.1
935 // make target object path
936 CIMObjectPath objectPath(
937 System::getHostName(),
938 request->nameSpace,
939 request->objectName.getClassName());
940
941 objectPath.setKeyBindings(request->objectName.getKeyBindings());
942
|
943 schuur 1.19 CIMObjectPath assocPath(
944 System::getHostName(),
945 request->nameSpace,
946 request->assocClass.getString());
947
|
948 chip 1.5 // resolve provider name
|
949 kumpf 1.28 ProviderName name = _resolveProviderName(
950 request->operationContext.get(ProviderIdContainer::NAME));
|
951 chip 1.2
952 // get cached or load new provider module
|
953 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
954 name.getPhysicalName(), name.getLogicalName());
|
955 chip 1.2
956 // convert arguments
957 OperationContext context;
|
958 chip 1.1
|
959 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
960 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
961 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
962 chip 1.1
|
963 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
964 chip 1.2 pm_service_op_lock op_lock(&ph.GetProvider());
|
965 chip 1.1
|
966 chip 1.2 ph.GetProvider().associatorNames(
967 context,
968 objectPath,
969 request->assocClass,
970 request->resultClass,
971 request->role,
972 request->resultRole,
973 handler);
|
974 chip 1.1 }
|
975 a.dunfey 1.56.2.1 HandleCatch(handler);
|
976 chip 1.1
977 PEG_METHOD_EXIT();
978
|
979 w.white 1.53 STAT_COPYDISPATCHER
980
|
981 chip 1.1 return(response);
982 }
983
|
984 dj.gorey 1.25 Message * DefaultProviderManager::handleReferencesRequest(const Message * message)
|
985 chip 1.1 {
986 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleReferencesRequest");
987
988 CIMReferencesRequestMessage * request =
989 dynamic_cast<CIMReferencesRequestMessage *>(const_cast<Message *>(message));
990
991 PEGASUS_ASSERT(request != 0);
992
|
993 kumpf 1.54 CIMReferencesResponseMessage* response =
994 dynamic_cast<CIMReferencesResponseMessage*>(
995 request->buildResponse());
|
996 chip 1.1 PEGASUS_ASSERT(response != 0);
997
998 // create a handler for this request
999 ReferencesResponseHandler handler(request, response);
1000
1001 // process the request
1002 try
1003 {
|
1004 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
1005 Logger::TRACE,
1006 "DefaultProviderManager::handleReferencesRequest - "
1007 "Host name: $0 Name space: $1 Class name: $2",
|
1008 chip 1.1 System::getHostName(),
1009 request->nameSpace.getString(),
|
1010 mike 1.56 request->objectName.getClassName().getString()));
|
1011 chip 1.1
1012 // make target object path
1013 CIMObjectPath objectPath(
1014 System::getHostName(),
1015 request->nameSpace,
1016 request->objectName.getClassName());
1017
1018 objectPath.setKeyBindings(request->objectName.getKeyBindings());
1019
|
1020 schuur 1.19 CIMObjectPath resultPath(
1021 System::getHostName(),
1022 request->nameSpace,
1023 request->resultClass.getString());
1024
|
1025 chip 1.5 // resolve provider name
|
1026 kumpf 1.28 ProviderName name = _resolveProviderName(
1027 request->operationContext.get(ProviderIdContainer::NAME));
|
1028 chip 1.2
1029 // get cached or load new provider module
|
1030 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
1031 name.getPhysicalName(), name.getLogicalName());
|
1032 chip 1.2
1033 // convert arguments
1034 OperationContext context;
1035
|
1036 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
1037 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1038 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
1039 chip 1.2
|
1040 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
1041 chip 1.1
|
1042 chip 1.2 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1043 "Calling provider.references: " +
1044 ph.GetProvider().getName());
|
1045 chip 1.1
|
1046 chip 1.2 pm_service_op_lock op_lock(&ph.GetProvider());
|
1047 chip 1.1
|
1048 chip 1.2 ph.GetProvider().references(
1049 context,
1050 objectPath,
1051 request->resultClass,
1052 request->role,
1053 request->includeQualifiers,
1054 request->includeClassOrigin,
|
1055 a.dunfey 1.42 request->propertyList,
|
1056 chip 1.2 handler);
|
1057 chip 1.1 }
|
1058 a.dunfey 1.56.2.1 HandleCatch(handler);
|
1059 chip 1.1
1060 PEG_METHOD_EXIT();
1061
|
1062 w.white 1.53 STAT_COPYDISPATCHER
1063
|
1064 chip 1.1 return(response);
1065 }
1066
|
1067 dj.gorey 1.25 Message * DefaultProviderManager::handleReferenceNamesRequest(const Message * message)
|
1068 chip 1.1 {
1069 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleReferenceNamesRequest");
1070
1071 CIMReferenceNamesRequestMessage * request =
1072 dynamic_cast<CIMReferenceNamesRequestMessage *>(const_cast<Message *>(message));
1073
1074 PEGASUS_ASSERT(request != 0);
1075
|
1076 kumpf 1.54 CIMReferenceNamesResponseMessage* response =
1077 dynamic_cast<CIMReferenceNamesResponseMessage*>(
1078 request->buildResponse());
1079 PEGASUS_ASSERT(response != 0);
|
1080 chip 1.1
1081 // create a handler for this request
1082 ReferenceNamesResponseHandler handler(request, response);
1083
1084 // process the request
1085 try
1086 {
|
1087 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
1088 Logger::TRACE,
1089 "DefaultProviderManager::handleReferenceNamesRequest - "
1090 "Host name: $0 Name space: $1 Class name: $2",
|
1091 chip 1.1 System::getHostName(),
1092 request->nameSpace.getString(),
|
1093 mike 1.56 request->objectName.getClassName().getString()));
|
1094 chip 1.1
1095 // make target object path
1096 CIMObjectPath objectPath(
1097 System::getHostName(),
1098 request->nameSpace,
1099 request->objectName.getClassName());
1100
1101 objectPath.setKeyBindings(request->objectName.getKeyBindings());
1102
|
1103 schuur 1.19 CIMObjectPath resultPath(
1104 System::getHostName(),
1105 request->nameSpace,
1106 request->resultClass.getString());
1107
|
1108 chip 1.5 // resolve provider name
|
1109 kumpf 1.28 ProviderName name = _resolveProviderName(
1110 request->operationContext.get(ProviderIdContainer::NAME));
|
1111 chip 1.1
|
1112 chip 1.2 // get cached or load new provider module
|
1113 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
1114 name.getPhysicalName(), name.getLogicalName());
|
1115 chip 1.1
|
1116 chip 1.2 // convert arguments
1117 OperationContext context;
|
1118 chip 1.1
|
1119 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
1120 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1121 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
1122 chip 1.1
|
1123 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
1124 chip 1.1
|
1125 chip 1.2 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1126 "Calling provider.referenceNames: " +
1127 ph.GetProvider().getName());
|
1128 chip 1.1
|
1129 chip 1.2 pm_service_op_lock op_lock(&ph.GetProvider());
|
1130 chip 1.1
|
1131 chip 1.2 ph.GetProvider().referenceNames(
1132 context,
1133 objectPath,
1134 request->resultClass,
1135 request->role,
1136 handler);
|
1137 chip 1.1 }
|
1138 a.dunfey 1.56.2.1 HandleCatch(handler);
|
1139 chip 1.1
1140 PEG_METHOD_EXIT();
1141
|
1142 w.white 1.53 STAT_COPYDISPATCHER
1143
|
1144 chip 1.1 return(response);
1145 }
1146
|
1147 dj.gorey 1.25 Message * DefaultProviderManager::handleGetPropertyRequest(const Message * message)
|
1148 chip 1.1 {
1149 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleGetPropertyRequest");
1150
1151 CIMGetPropertyRequestMessage * request =
1152 dynamic_cast<CIMGetPropertyRequestMessage *>(const_cast<Message *>(message));
1153
1154 PEGASUS_ASSERT(request != 0);
1155
1156 // create response message
|
1157 kumpf 1.54 CIMGetPropertyResponseMessage* response =
1158 dynamic_cast<CIMGetPropertyResponseMessage*>(
1159 request->buildResponse());
|
1160 chip 1.1 PEGASUS_ASSERT(response != 0);
1161
1162 GetPropertyResponseHandler handler(request, response);
1163
1164 try
1165 {
|
1166 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
1167 Logger::TRACE,
1168 "DefaultProviderManager::handleGetPropertyRequest - "
1169 "Host name: $0 Name space: $1 Class name: $2",
|
1170 chip 1.1 System::getHostName(),
1171 request->nameSpace.getString(),
|
1172 mike 1.56 request->instanceName.getClassName().getString()));
|
1173 chip 1.1
1174 // make target object path
1175 CIMObjectPath objectPath(
1176 System::getHostName(),
1177 request->nameSpace,
1178 request->instanceName.getClassName(),
1179 request->instanceName.getKeyBindings());
1180
|
1181 chip 1.5 // resolve provider name
|
1182 kumpf 1.28 ProviderName name = _resolveProviderName(
1183 request->operationContext.get(ProviderIdContainer::NAME));
|
1184 chip 1.1
1185 // get cached or load new provider module
|
1186 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
1187 name.getPhysicalName(), name.getLogicalName());
|
1188 chip 1.1
1189 // convert arguments
1190 OperationContext context;
1191
|
1192 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
1193 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1194 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
1195 chip 1.1
1196 CIMName propertyName = request->propertyName;
1197
|
1198 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
1199 chip 1.1
1200 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1201 "Calling provider.getProperty: " +
1202 ph.GetProvider().getName());
1203
1204 // forward request
1205 pm_service_op_lock op_lock(&ph.GetProvider());
1206
1207 ph.GetProvider().getProperty(
1208 context,
1209 objectPath,
1210 propertyName,
1211 handler);
1212 }
|
1213 a.dunfey 1.56.2.1 HandleCatch(handler);
|
1214 chip 1.1
1215 PEG_METHOD_EXIT();
1216
|
1217 w.white 1.53 STAT_COPYDISPATCHER
1218
|
1219 chip 1.1 return(response);
1220 }
1221
|
1222 dj.gorey 1.25 Message * DefaultProviderManager::handleSetPropertyRequest(const Message * message)
|
1223 chip 1.1 {
1224 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleSetPropertyRequest");
1225
1226 CIMSetPropertyRequestMessage * request =
1227 dynamic_cast<CIMSetPropertyRequestMessage *>(const_cast<Message *>(message));
1228
1229 PEGASUS_ASSERT(request != 0);
1230
1231 // create response message
|
1232 kumpf 1.54 CIMSetPropertyResponseMessage* response =
1233 dynamic_cast<CIMSetPropertyResponseMessage*>(
1234 request->buildResponse());
|
1235 chip 1.1 PEGASUS_ASSERT(response != 0);
1236
1237 SetPropertyResponseHandler handler(request, response);
1238
1239 try
1240 {
|
1241 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
1242 Logger::TRACE,
1243 "DefaultProviderManager::handleSetPropertyRequest - "
1244 "Host name: $0 Name space: $1 Class name: $2",
|
1245 chip 1.1 System::getHostName(),
1246 request->nameSpace.getString(),
|
1247 mike 1.56 request->instanceName.getClassName().getString()));
|
1248 chip 1.1
1249 // make target object path
1250 CIMObjectPath objectPath(
1251 System::getHostName(),
1252 request->nameSpace,
1253 request->instanceName.getClassName(),
1254 request->instanceName.getKeyBindings());
1255
|
1256 chip 1.5 // resolve provider name
|
1257 kumpf 1.28 ProviderName name = _resolveProviderName(
1258 request->operationContext.get(ProviderIdContainer::NAME));
|
1259 chip 1.1
1260 // get cached or load new provider module
|
1261 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
1262 name.getPhysicalName(), name.getLogicalName());
|
1263 chip 1.1
1264 // convert arguments
1265 OperationContext context;
1266
|
1267 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
1268 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1269 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
1270 chip 1.1
1271 CIMName propertyName = request->propertyName;
1272 CIMValue propertyValue = request->newValue;
1273
|
1274 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
1275 chip 1.1
1276 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1277 "Calling provider.setProperty: " +
1278 ph.GetProvider().getName());
1279
1280 // forward request
1281 pm_service_op_lock op_lock(&ph.GetProvider());
1282
1283 ph.GetProvider().setProperty(
1284 context,
1285 objectPath,
1286 propertyName,
1287 propertyValue,
1288 handler);
1289 }
|
1290 a.dunfey 1.56.2.1 HandleCatch(handler);
|
1291 chip 1.1
1292 PEG_METHOD_EXIT();
1293
|
1294 w.white 1.53 STAT_COPYDISPATCHER
1295
|
1296 chip 1.1 return(response);
1297 }
1298
|
1299 dj.gorey 1.25 Message * DefaultProviderManager::handleInvokeMethodRequest(const Message * message)
|
1300 chip 1.1 {
1301 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleInvokeMethodRequest");
1302
1303 CIMInvokeMethodRequestMessage * request =
1304 dynamic_cast<CIMInvokeMethodRequestMessage *>(const_cast<Message *>(message));
1305
1306 PEGASUS_ASSERT(request != 0);
1307
1308 // create response message
|
1309 kumpf 1.54 CIMInvokeMethodResponseMessage* response =
1310 dynamic_cast<CIMInvokeMethodResponseMessage*>(
1311 request->buildResponse());
|
1312 chip 1.1 PEGASUS_ASSERT(response != 0);
1313
1314 // create a handler for this request
1315 InvokeMethodResponseHandler handler(request, response);
1316
1317 try
1318 {
|
1319 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
1320 Logger::TRACE,
1321 "DefaultProviderManager::handleInvokeMethodRequest - "
1322 "Host name: $0 Name space: $1 Class name: $2",
|
1323 chip 1.1 System::getHostName(),
1324 request->nameSpace.getString(),
|
1325 mike 1.56 request->instanceName.getClassName().getString()));
|
1326 chip 1.1
1327 // make target object path
1328 CIMObjectPath objectPath(
1329 System::getHostName(),
1330 request->nameSpace,
1331 request->instanceName.getClassName(),
1332 request->instanceName.getKeyBindings());
1333
|
1334 chip 1.5 // resolve provider name
|
1335 kumpf 1.28 ProviderName name = _resolveProviderName(
1336 request->operationContext.get(ProviderIdContainer::NAME));
|
1337 chip 1.1
1338 // get cached or load new provider module
|
1339 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
1340 name.getPhysicalName(), name.getLogicalName());
|
1341 chip 1.1
1342 // convert arguments
1343 OperationContext context;
1344
|
1345 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
1346 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1347 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
1348 chip 1.1
1349 CIMObjectPath instanceReference(request->instanceName);
1350
1351 // ATTN: propagate namespace
1352 instanceReference.setNameSpace(request->nameSpace);
1353
1354 // forward request
|
1355 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART;
|
1356 chip 1.1
1357 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1358 "Calling provider.invokeMethod: " +
1359 ph.GetProvider().getName());
1360
1361 pm_service_op_lock op_lock(&ph.GetProvider());
1362
1363 ph.GetProvider().invokeMethod(
1364 context,
1365 instanceReference,
1366 request->methodName,
1367 request->inParameters,
1368 handler);
1369 }
|
1370 a.dunfey 1.56.2.1 HandleCatch(handler);
|
1371 chip 1.1
1372 PEG_METHOD_EXIT();
1373
1374 return(response);
1375 }
1376
|
1377 dj.gorey 1.25 Message * DefaultProviderManager::handleCreateSubscriptionRequest(const Message * message)
|
1378 chip 1.1 {
1379 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleCreateSubscriptionRequest");
1380
1381 CIMCreateSubscriptionRequestMessage * request =
1382 dynamic_cast<CIMCreateSubscriptionRequestMessage *>(const_cast<Message *>(message));
1383
1384 PEGASUS_ASSERT(request != 0);
1385
|
1386 kumpf 1.54 CIMCreateSubscriptionResponseMessage* response =
1387 dynamic_cast<CIMCreateSubscriptionResponseMessage*>(
1388 request->buildResponse());
|
1389 chip 1.1 PEGASUS_ASSERT(response != 0);
1390
1391 OperationResponseHandler handler(request, response);
1392
1393 try
1394 {
|
1395 chip 1.2 String temp;
1396
1397 for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1398 {
1399 temp.append(request->classNames[i].getString());
1400
1401 if(i == (n - 1))
1402 {
1403 temp.append(", ");
1404 }
1405 }
1406
|
1407 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
1408 Logger::TRACE,
1409 "DefaultProviderManager::handleCreateSubscriptionRequest - "
1410 "Host name: $0 Name space: $1 Class name(s): $2",
|
1411 chip 1.2 System::getHostName(),
1412 request->nameSpace.getString(),
|
1413 mike 1.56 temp));
|
1414 chip 1.2
|
1415 se.gupta 1.33 CIMInstance req_provider, req_providerModule;
|
1416 se.gupta 1.34 ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
1417 req_provider = pidc.getProvider();
1418 req_providerModule = pidc.getModule();
|
1419 schuur 1.18
|
1420 se.gupta 1.33 String physicalName=_resolvePhysicalName( req_providerModule.getProperty(
1421 req_providerModule.findProperty("Location")).getValue().toString());
1422
1423 ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (),
1424 physicalName,
1425 req_providerModule.getProperty(req_providerModule.findProperty
1426 ("InterfaceType")).getValue().toString(),
1427 0);
|
1428 kumpf 1.50
1429 // get cached or load new provider module
1430 OpProviderHolder ph = providerManager.getProvider(
1431 name.getPhysicalName(), name.getLogicalName());
|
1432 dj.gorey 1.25
|
1433 carolann.graves 1.49 //
1434 // Save the provider instance from the request
1435 //
1436 ph.GetProvider ().setProviderInstance (req_provider);
1437
|
1438 chip 1.1 // convert arguments
1439 OperationContext context;
1440
|
1441 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
1442 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1443 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1444 context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));
1445 context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));
1446 context.insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME));
|
1447 humberto 1.45 context.insert(request->operationContext.get(SubscriptionFilterQueryContainer::NAME));
|
1448 chip 1.1
1449 CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
1450
1451 Array<CIMObjectPath> classNames;
1452
1453 for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1454 {
1455 CIMObjectPath className(
1456 System::getHostName(),
1457 request->nameSpace,
1458 request->classNames[i]);
1459
1460 classNames.append(className);
1461 }
1462
1463 CIMPropertyList propertyList = request->propertyList;
1464
1465 Uint16 repeatNotificationPolicy = request->repeatNotificationPolicy;
1466
1467 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1468 "Calling provider.createSubscription: " +
1469 chip 1.1 ph.GetProvider().getName());
1470
1471 pm_service_op_lock op_lock(&ph.GetProvider());
1472
1473 ph.GetProvider().createSubscription(
1474 context,
1475 subscriptionName,
1476 classNames,
1477 propertyList,
1478 repeatNotificationPolicy);
|
1479 carolann.graves 1.49
1480 //
1481 // Increment count of current subscriptions for this provider
1482 //
1483 if (ph.GetProvider ().testIfZeroAndIncrementSubscriptions ())
1484 {
1485 //
1486 // If there were no current subscriptions before the increment,
1487 // the first subscription has been created
1488 // Call the provider's enableIndications method
1489 //
1490 if (_subscriptionInitComplete)
1491 {
1492 _callEnableIndications (req_provider,
1493 _indicationCallback, ph);
1494 }
1495 }
|
1496 chip 1.1 }
1497 catch(CIMException & e)
1498 {
1499 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1500 "Exception: " + e.getMessage());
|
1501 chip 1.2
|
1502 chip 1.1 handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1503 }
1504 catch(Exception & e)
1505 {
1506 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1507 "Exception: " + e.getMessage());
|
1508 chip 1.2
|
1509 chip 1.1 handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1510 }
1511 catch(...)
1512 {
1513 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1514 "Exception: Unknown");
|
1515 chip 1.2
|
1516 chip 1.1 handler.setStatus(CIM_ERR_FAILED, "Unknown Error");
1517 }
1518
1519 PEG_METHOD_EXIT();
1520
1521 return(response);
1522 }
1523
|
1524 dj.gorey 1.25 Message * DefaultProviderManager::handleModifySubscriptionRequest( const Message * message)
|
1525 chip 1.1 {
1526 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleModifySubscriptionRequest");
1527
1528 CIMModifySubscriptionRequestMessage * request =
1529 dynamic_cast<CIMModifySubscriptionRequestMessage *>(const_cast<Message *>(message));
1530
1531 PEGASUS_ASSERT(request != 0);
1532
|
1533 kumpf 1.54 CIMModifySubscriptionResponseMessage* response =
1534 dynamic_cast<CIMModifySubscriptionResponseMessage*>(
1535 request->buildResponse());
|
1536 chip 1.1 PEGASUS_ASSERT(response != 0);
1537
1538 OperationResponseHandler handler(request, response);
1539
1540 try
1541 {
|
1542 chip 1.2 String temp;
1543
1544 for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1545 {
1546 temp.append(request->classNames[i].getString());
1547
1548 if(i == (n - 1))
1549 {
1550 temp.append(", ");
1551 }
1552 }
1553
|
1554 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
1555 Logger::TRACE,
1556 "DefaultProviderManager::handleCreateSubscriptionRequest - "
1557 "Host name: $0 Name space: $1 Class name(s): $2",
|
1558 chip 1.2 System::getHostName(),
1559 request->nameSpace.getString(),
|
1560 mike 1.56 temp));
|
1561 se.gupta 1.33
|
1562 se.gupta 1.34 CIMInstance req_provider, req_providerModule;
1563 ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
1564 req_provider = pidc.getProvider();
1565 req_providerModule = pidc.getModule();
1566
1567 String physicalName=_resolvePhysicalName( req_providerModule.getProperty(
|
1568 se.gupta 1.33 req_providerModule.findProperty("Location")).getValue().toString());
1569
|
1570 se.gupta 1.34 ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (),
|
1571 se.gupta 1.33 physicalName,
1572 req_providerModule.getProperty(req_providerModule.findProperty
1573 ("InterfaceType")).getValue().toString(),
1574 0);
|
1575 chip 1.1
1576 // get cached or load new provider module
|
1577 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
1578 name.getPhysicalName(), name.getLogicalName());
|
1579 dj.gorey 1.25
|
1580 chip 1.1 // convert arguments
1581 OperationContext context;
|
1582 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
1583 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1584 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1585 context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));
1586 context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));
1587 context.insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME));
|
1588 humberto 1.45 context.insert(request->operationContext.get(SubscriptionFilterQueryContainer::NAME));
|
1589 chip 1.1
1590 CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
1591
1592 Array<CIMObjectPath> classNames;
1593
1594 for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1595 {
1596 CIMObjectPath className(
1597 System::getHostName(),
1598 request->nameSpace,
1599 request->classNames[i]);
1600
1601 classNames.append(className);
1602 }
1603
1604 CIMPropertyList propertyList = request->propertyList;
1605
1606 Uint16 repeatNotificationPolicy = request->repeatNotificationPolicy;
1607
1608 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1609 "Calling provider.modifySubscription: " +
1610 chip 1.1 ph.GetProvider().getName());
1611
1612 pm_service_op_lock op_lock(&ph.GetProvider());
1613
1614 ph.GetProvider().modifySubscription(
1615 context,
1616 subscriptionName,
1617 classNames,
1618 propertyList,
1619 repeatNotificationPolicy);
1620 }
1621 catch(CIMException & e)
1622 {
1623 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1624 "Exception: " + e.getMessage());
|
1625 chip 1.2
|
1626 chip 1.1 handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1627 }
1628 catch(Exception & e)
1629 {
1630 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1631 "Exception: " + e.getMessage());
|
1632 chip 1.2
|
1633 chip 1.1 handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1634 }
1635 catch(...)
1636 {
1637 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1638 "Exception: Unknown");
|
1639 chip 1.2
|
1640 chip 1.1 handler.setStatus(CIM_ERR_FAILED, "Unknown Error");
1641 }
1642
1643 PEG_METHOD_EXIT();
1644
1645 return(response);
1646 }
1647
|
1648 dj.gorey 1.25 Message * DefaultProviderManager::handleDeleteSubscriptionRequest(const Message * message)
|
1649 chip 1.1 {
1650 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleDeleteSubscriptionRequest");
1651
1652 CIMDeleteSubscriptionRequestMessage * request =
1653 dynamic_cast<CIMDeleteSubscriptionRequestMessage *>(const_cast<Message *>(message));
1654
1655 PEGASUS_ASSERT(request != 0);
1656
|
1657 kumpf 1.54 CIMDeleteSubscriptionResponseMessage* response =
1658 dynamic_cast<CIMDeleteSubscriptionResponseMessage*>(
1659 request->buildResponse());
|
1660 chip 1.1 PEGASUS_ASSERT(response != 0);
1661
1662 OperationResponseHandler handler(request, response);
1663
1664 try
1665 {
|
1666 chip 1.2 String temp;
1667
1668 for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1669 {
1670 temp.append(request->classNames[i].getString());
1671
1672 if(i == (n - 1))
1673 {
1674 temp.append(", ");
1675 }
1676 }
1677
|
1678 mike 1.56 PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,
1679 Logger::TRACE,
1680 "DefaultProviderManager::handleDeleteSubscriptionRequest - "
1681 "Host name: $0 Name space: $1 Class name(s): $2",
|
1682 chip 1.2 System::getHostName(),
1683 request->nameSpace.getString(),
|
1684 mike 1.56 temp));
|
1685 chip 1.2
|
1686 se.gupta 1.34 CIMInstance req_provider, req_providerModule;
1687 ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
1688
1689 req_provider = pidc.getProvider();
1690 req_providerModule = pidc.getModule();
|
1691 se.gupta 1.33
1692 String physicalName=_resolvePhysicalName( req_providerModule.getProperty(
1693 req_providerModule.findProperty("Location")).getValue().toString());
1694
1695 ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (),
1696 physicalName,
1697 req_providerModule.getProperty(req_providerModule.findProperty
1698 ("InterfaceType")).getValue().toString(),
1699 0);
|
1700 chip 1.1
1701 // get cached or load new provider module
|
1702 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
1703 name.getPhysicalName(), name.getLogicalName());
|
1704 dj.gorey 1.25
|
1705 chip 1.1 // convert arguments
1706 OperationContext context;
1707
|
1708 se.gupta 1.34 context.insert(request->operationContext.get(IdentityContainer::NAME));
1709 context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1710 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1711 context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));
1712 context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));
1713
|
1714 chip 1.1 CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
1715
1716 Array<CIMObjectPath> classNames;
1717
1718 for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1719 {
1720 CIMObjectPath className(
1721 System::getHostName(),
1722 request->nameSpace,
1723 request->classNames[i]);
1724
1725 classNames.append(className);
1726 }
1727
1728 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1729 "Calling provider.deleteSubscription: " +
1730 ph.GetProvider().getName());
1731
1732 pm_service_op_lock op_lock(&ph.GetProvider());
1733
1734 ph.GetProvider().deleteSubscription(
1735 chip 1.1 context,
1736 subscriptionName,
1737 classNames);
|
1738 carolann.graves 1.49
1739 //
1740 // Decrement count of current subscriptions for this provider
1741 //
1742 if (ph.GetProvider ().decrementSubscriptionsAndTestIfZero ())
1743 {
1744 //
1745 // If there are no current subscriptions after the decrement,
1746 // the last subscription has been deleted
1747 // Call the provider's disableIndications method
1748 //
1749 if (_subscriptionInitComplete)
1750 {
1751 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1752 "Calling provider.disableIndications: " +
1753 ph.GetProvider ().getName ());
1754
1755 ph.GetProvider ().disableIndications ();
1756
1757 ph.GetProvider ().unprotect ();
1758
1759 carolann.graves 1.49 //
1760 //
1761 //
1762 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1763 "Removing and Destroying indication handler for " +
1764 ph.GetProvider ().getName ());
1765
1766 delete _removeEntry (_generateKey (ph.GetProvider ()));
1767 }
1768 }
|
1769 chip 1.1 }
1770 catch(CIMException & e)
1771 {
1772 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1773 "Exception: " + e.getMessage());
|
1774 chip 1.2
|
1775 chip 1.1 handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1776 }
1777 catch(Exception & e)
1778 {
1779 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1780 "Exception: " + e.getMessage());
|
1781 chip 1.2
|
1782 chip 1.1 handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1783 }
1784 catch(...)
1785 {
1786 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1787 "Exception: Unknown");
|
1788 chip 1.2
|
1789 chip 1.1 handler.setStatus(CIM_ERR_FAILED, "Unknown Error");
1790 }
1791
1792 PEG_METHOD_EXIT();
1793
1794 return(response);
1795 }
1796
|
1797 dj.gorey 1.25 Message *DefaultProviderManager::handleExportIndicationRequest(const Message *message)
|
1798 schuur 1.14 {
1799 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManagerService::handlExportIndicationRequest");
1800
1801 CIMExportIndicationRequestMessage * request =
1802 dynamic_cast<CIMExportIndicationRequestMessage *>(const_cast<Message *>(message));
1803
1804 PEGASUS_ASSERT(request != 0);
1805
|
1806 kumpf 1.54 CIMExportIndicationResponseMessage* response =
1807 dynamic_cast<CIMExportIndicationResponseMessage*>(
1808 request->buildResponse());
|
1809 schuur 1.14 PEGASUS_ASSERT(response != 0);
1810
1811 OperationResponseHandler handler(request, response);
1812
1813 try
1814 {
|
1815 kumpf 1.28 // resolve provider name
1816 ProviderName name = _resolveProviderName(
1817 request->operationContext.get(ProviderIdContainer::NAME));
|
1818 schuur 1.14
|
1819 kumpf 1.28 // get cached or load new provider module
|
1820 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
1821 name.getPhysicalName(), name.getLogicalName());
|
1822 schuur 1.14
|
1823 a.dunfey 1.56.2.1 STAT_PMS_PROVIDERSTART
|
1824 w.white 1.40
|
1825 schuur 1.14 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
|
1826 dj.gorey 1.25 "Calling provider.: " +
1827 ph.GetProvider().getName());
|
1828 schuur 1.14
1829 OperationContext context;
1830
|
1831 denise.eckstein 1.55 context.insert(request->operationContext.get(IdentityContainer::NAME));
1832
|
1833 schuur 1.14 //L10N_TODO
1834 //l10n
1835 // ATTN-CEC 06/04/03 NOTE: I can't find where the consume msg is sent. This
1836 // does not appear to be hooked-up. When it is added, need to
1837 // make sure that Content-Language is set in the consume msg.
1838 // NOTE: A-L is not needed to be set in the consume msg.
1839 // add the langs to the context
|
1840 se.gupta 1.33
|
1841 se.gupta 1.34 context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
|
1842 schuur 1.14
1843 CIMInstance indication_copy = request->indicationInstance;
1844 pm_service_op_lock op_lock(&ph.GetProvider());
1845
1846 ph.GetProvider().consumeIndication(context,
|
1847 dj.gorey 1.25 request->destinationPath,
1848 indication_copy);
|
1849 schuur 1.14 }
|
1850 a.dunfey 1.56.2.1 HandleCatch(handler);
|
1851 schuur 1.14
1852 PEG_METHOD_EXIT();
1853
1854 return(response);
1855 }
1856
1857
1858
1859
|
1860 chip 1.1 //
1861 // This function disables a provider module if disableProviderOnly is not true,
1862 // otherwise, disables a provider. Disable provider module means that
1863 // block all the providers which contain in the module and unload the
1864 // providers.
1865 // Disable provider means unload the provider and the provider is not blocked.
1866 //
1867 // ATTN-YZ-P2-20030519: Provider needs to be blocked when disable a provider.
1868 //
|
1869 dj.gorey 1.25 Message * DefaultProviderManager::handleDisableModuleRequest(const Message * message)
|
1870 chip 1.1 {
1871 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleDisableModuleRequest");
|
1872 schuur 1.19
|
1873 chip 1.1 CIMDisableModuleRequestMessage * request =
1874 dynamic_cast<CIMDisableModuleRequestMessage *>(const_cast<Message *>(message));
1875
1876 PEGASUS_ASSERT(request != 0);
|
1877 dj.gorey 1.25
|
1878 schuur 1.18 Array<Uint16> operationalStatus;
1879 CIMException cimException;
|
1880 chip 1.1
|
1881 schuur 1.18 try
|
1882 chip 1.1 {
|
1883 schuur 1.18 // get provider module name
1884 String moduleName;
1885 CIMInstance mInstance = request->providerModule;
1886 Uint32 pos = mInstance.findProperty(CIMName ("Name"));
|
1887 kumpf 1.28 PEGASUS_ASSERT(pos != PEG_NOT_FOUND);
1888 mInstance.getProperty(pos).getValue().get(moduleName);
|
1889 chip 1.1
|
1890 schuur 1.18 Boolean disableProviderOnly = request->disableProviderOnly;
1891
|
1892 chip 1.1 //
|
1893 kumpf 1.28 // Unload providers
|
1894 chip 1.1 //
|
1895 schuur 1.18 Array<CIMInstance> _pInstances = request->providers;
1896 Array<Boolean> _indicationProviders = request->indicationProviders;
|
1897 dj.gorey 1.25
|
1898 schuur 1.18 String physicalName=_resolvePhysicalName(
1899 mInstance.getProperty(
1900 mInstance.findProperty("Location")).getValue().toString());
|
1901 dj.gorey 1.25
|
1902 schuur 1.18 for(Uint32 i = 0, n = _pInstances.size(); i < n; i++)
|
1903 chip 1.1 {
|
1904 schuur 1.18 String pName(_pInstances[i].getProperty(
1905 _pInstances[i].findProperty("Name")).getValue().toString());
|
1906 chip 1.1
|
1907 kumpf 1.51 Sint16 ret_value = providerManager.disableProvider(pName);
|
1908 chip 1.1
|
1909 schuur 1.18 if (ret_value == 0)
1910 {
|
1911 schuur 1.23 // disable failed since there are pending requests,
|
1912 kumpf 1.28 // stop trying to disable other providers in this module.
|
1913 kumpf 1.38 operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
|
1914 kumpf 1.28 break;
|
1915 dj.gorey 1.25 }
|
1916 kumpf 1.28 else if (ret_value == 1) // Success
|
1917 dj.gorey 1.25 {
|
1918 schuur 1.18 if (_indicationProviders[i])
|
1919 dj.gorey 1.25 {
|
1920 carolann.graves 1.49 //
1921 // Reset the indication provider's count of current
1922 // subscriptions since it has been disabled
1923 //
1924 if (physicalName.size () > 0)
1925 {
|
1926 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
1927 physicalName, pName);
|
1928 carolann.graves 1.49
1929 ph.GetProvider ().resetSubscriptions ();
1930 }
1931
1932 //
1933 // If it is an indication provider
1934 // remove the entry from the table since the
1935 // provider has been disabled
1936 //
|
1937 kumpf 1.27 delete _removeEntry(_generateKey(pName,physicalName));
|
1938 dj.gorey 1.25 }
1939 }
|
1940 schuur 1.18 else
1941 {
|
1942 dj.gorey 1.25 // disable failed for other reason, throw exception
|
1943 schuur 1.18 throw PEGASUS_CIM_EXCEPTION_L(
1944 CIM_ERR_FAILED,
1945 MessageLoaderParms(
1946 "ProviderManager.ProviderManagerService."
1947 "DISABLE_PROVIDER_FAILED",
1948 "Failed to disable the provider."));
1949 }
1950 }
1951 }
1952 catch(CIMException & e)
1953 {
|
1954 dj.gorey 1.25 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
|
1955 schuur 1.18 "Exception: " + e.getMessage());
1956 cimException = e;
1957 }
1958 catch(Exception & e)
1959 {
|
1960 dj.gorey 1.25 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
|
1961 schuur 1.18 "Exception: " + e.getMessage());
1962 cimException = CIMException(CIM_ERR_FAILED, e.getMessage());
1963 }
1964 catch(...)
1965 {
|
1966 dj.gorey 1.25 PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
|
1967 schuur 1.18 "Exception: Unknown");
1968 //l10n
1969 //response->cimException = CIMException(CIM_ERR_FAILED, "Unknown Error");
1970 cimException = PEGASUS_CIM_EXCEPTION_L(
1971 CIM_ERR_FAILED,
1972 MessageLoaderParms(
1973 "ProviderManager.ProviderManagerService.UNKNOWN_ERROR",
1974 "Unknown Error"));
|
1975 chip 1.1 }
1976
|
1977 kumpf 1.28 if (cimException.getCode() == CIM_ERR_SUCCESS)
1978 {
1979 // Status is set to OK if a provider was busy
1980 if (operationalStatus.size() == 0)
1981 {
|
1982 kumpf 1.38 operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_STOPPED);
|
1983 kumpf 1.28 }
1984 }
1985 else
1986 {
1987 // If exception occurs, module is not stopped
|
1988 kumpf 1.38 operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
|
1989 kumpf 1.28 }
1990
|
1991 kumpf 1.54 CIMDisableModuleResponseMessage* response =
1992 dynamic_cast<CIMDisableModuleResponseMessage*>(
1993 request->buildResponse());
1994 PEGASUS_ASSERT(response != 0);
|
1995 chip 1.1
|
1996 kumpf 1.54 response->operationalStatus = operationalStatus;
|
1997 chip 1.1
1998 PEG_METHOD_EXIT();
1999
2000 return(response);
2001 }
2002
|
2003 dj.gorey 1.25 Message * DefaultProviderManager::handleEnableModuleRequest(const Message * message)
|
2004 chip 1.1 {
2005 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleEnableModuleRequest");
2006
2007 CIMEnableModuleRequestMessage * request =
2008 dynamic_cast<CIMEnableModuleRequestMessage *>(const_cast<Message *>(message));
2009
2010 PEGASUS_ASSERT(request != 0);
2011
2012 Array<Uint16> operationalStatus;
|
2013 kumpf 1.38 operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
|
2014 chip 1.1
|
2015 kumpf 1.54 CIMEnableModuleResponseMessage* response =
2016 dynamic_cast<CIMEnableModuleResponseMessage*>(
2017 request->buildResponse());
2018 PEGASUS_ASSERT(response != 0);
|
2019 chip 1.1
|
2020 kumpf 1.54 response->operationalStatus = operationalStatus;
|
2021 chip 1.1
2022 PEG_METHOD_EXIT();
2023 return(response);
2024 }
2025
|
2026 dj.gorey 1.25 Message * DefaultProviderManager::handleStopAllProvidersRequest(const Message * message)
|
2027 chip 1.1 {
2028 PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleStopAllProvidersRequest");
2029
2030 CIMStopAllProvidersRequestMessage * request =
2031 dynamic_cast<CIMStopAllProvidersRequestMessage *>(const_cast<Message *>(message));
2032
2033 PEGASUS_ASSERT(request != 0);
2034
|
2035 kumpf 1.54 CIMStopAllProvidersResponseMessage* response =
2036 dynamic_cast<CIMStopAllProvidersResponseMessage*>(
2037 request->buildResponse());
|
2038 chip 1.1 PEGASUS_ASSERT(response != 0);
2039
2040 // tell the provider manager to shutdown all the providers
|
2041 schuur 1.10 providerManager.shutdownAllProviders();
|
2042 a.dunfey 1.56.2.1
2043 try
2044 {
2045 // Delete the response handlers that were not explicitly disabled.
2046 AutoMutex lock(_responseTableMutex);
2047
2048 for (IndicationResponseTable::Iterator i = _responseTable.start();
2049 i != 0; i++)
2050 {
2051 EnableIndicationsResponseHandler *handler = i.value();
2052 delete handler;
2053 }
2054
2055 _responseTable.clear();
2056 }
2057 catch (...) { }
|
2058 chip 1.1
2059 PEG_METHOD_EXIT();
2060
2061 return(response);
2062 }
2063
|
2064 carolann.graves 1.49 Message *
2065 DefaultProviderManager::handleSubscriptionInitCompleteRequest
2066 (const Message * message)
2067 {
2068 PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
2069 "DefaultProviderManager::handleSubscriptionInitCompleteRequest");
2070
2071 CIMSubscriptionInitCompleteRequestMessage * request =
2072 dynamic_cast <CIMSubscriptionInitCompleteRequestMessage *>
2073 (const_cast <Message *> (message));
2074
2075 PEGASUS_ASSERT (request != 0);
2076
2077 CIMSubscriptionInitCompleteResponseMessage * response =
2078 dynamic_cast <CIMSubscriptionInitCompleteResponseMessage *>
2079 (request->buildResponse ());
2080
2081 PEGASUS_ASSERT (response != 0);
2082
2083 //
2084 // Set indicator
2085 carolann.graves 1.49 //
2086 _subscriptionInitComplete = true;
2087
2088 //
2089 // For each provider that has at least one subscription, call
2090 // provider's enableIndications method
2091 //
2092 Array <Provider *> enableProviders;
2093 enableProviders = providerManager.getIndicationProvidersToEnable ();
2094
2095 Uint32 numProviders = enableProviders.size ();
2096 for (Uint32 i = 0; i < numProviders; i++)
2097 {
2098 try
2099 {
2100 CIMInstance provider;
2101 provider = enableProviders [i]->getProviderInstance ();
2102
2103 //
2104 // Get cached or load new provider module
2105 //
|
2106 kumpf 1.50 OpProviderHolder ph = providerManager.getProvider(
2107 enableProviders[i]->getModule()->getFileName(),
2108 enableProviders[i]->getName());
|
2109 carolann.graves 1.49
2110 _callEnableIndications (provider, _indicationCallback, ph);
2111 }
2112 catch (CIMException & e)
2113 {
2114 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2115 "CIMException: " + e.getMessage ());
2116 }
2117 catch (Exception & e)
2118 {
2119 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2120 "Exception: " + e.getMessage ());
2121 }
2122 catch(...)
2123 {
2124 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2125 "Unknown error in handleSubscriptionInitCompleteRequest");
2126 }
2127 }
2128
2129 PEG_METHOD_EXIT ();
2130 carolann.graves 1.49 return (response);
2131 }
2132
|
2133 chip 1.1 void DefaultProviderManager::_insertEntry (
2134 const Provider & provider,
|
2135 a.dunfey 1.56.2.1 EnableIndicationsResponseHandler* handler)
|
2136 chip 1.1 {
|
2137 carolann.graves 1.41 PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
|
2138 chip 1.1 "DefaultProviderManager::_insertEntry");
2139
|
2140 a.dunfey 1.56.2.1 String tableKey = _generateKey(provider);
|
2141 chip 1.1
|
2142 a.dunfey 1.56.2.1 AutoMutex lock(_responseTableMutex);
2143 _responseTable.insert(tableKey, handler);
|
2144 chip 1.1
2145 PEG_METHOD_EXIT();
2146 }
2147
2148 EnableIndicationsResponseHandler * DefaultProviderManager::_removeEntry(
2149 const String & key)
2150 {
|
2151 carolann.graves 1.41 PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
|
2152 chip 1.1 "DefaultProviderManager::_removeEntry");
2153 EnableIndicationsResponseHandler *ret = 0;
2154
|
2155 a.dunfey 1.56.2.1 AutoMutex lock(_responseTableMutex);
|
2156 chip 1.1 _responseTable.lookup(key, ret);
|
2157 a.dunfey 1.56.2.1 _responseTable.remove(key);
|
2158 chip 1.1
2159 PEG_METHOD_EXIT();
2160
2161 return(ret);
2162 }
2163
2164 String DefaultProviderManager::_generateKey (
2165 const Provider & provider)
2166 {
2167 String tableKey;
2168
|
2169 carolann.graves 1.41 PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
|
2170 chip 1.1 "DefaultProviderManager::_generateKey");
2171
2172 //
2173 // Append provider key values to key
2174 //
2175 String providerName = provider.getName();
2176 String providerFileName = provider.getModule()->getFileName();
2177 tableKey.append (providerName);
2178 tableKey.append (providerFileName);
2179
2180 PEG_METHOD_EXIT();
2181
2182 return(tableKey);
|
2183 schuur 1.18 }
2184
2185 String DefaultProviderManager::_generateKey (
2186 const String & providerName,
2187 const String & providerFileName)
2188 {
2189 String tableKey;
2190
|
2191 carolann.graves 1.41 PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
|
2192 schuur 1.18 "DefaultProviderManagerService::_generateKey");
2193
2194 //
2195 // Append providerName and providerFileName to key
2196 //
2197 tableKey.append (providerName);
2198 tableKey.append (providerFileName);
2199
2200 PEG_METHOD_EXIT ();
2201 return tableKey;
|
2202 chip 1.5 }
2203
|
2204 kumpf 1.28 ProviderName DefaultProviderManager::_resolveProviderName(
2205 const ProviderIdContainer & providerId)
|
2206 chip 1.5 {
|
2207 kumpf 1.28 String providerName;
2208 String fileName;
2209 String interfaceName;
2210 CIMValue genericValue;
2211
2212 genericValue = providerId.getProvider().getProperty(
2213 providerId.getProvider().findProperty("Name")).getValue();
2214 genericValue.get(providerName);
2215
2216 genericValue = providerId.getModule().getProperty(
2217 providerId.getModule().findProperty("Location")).getValue();
2218 genericValue.get(fileName);
2219 fileName = _resolvePhysicalName(fileName);
2220
2221 // ATTN: This attribute is probably not required
2222 genericValue = providerId.getModule().getProperty(
2223 providerId.getModule().findProperty("InterfaceType")).getValue();
2224 genericValue.get(interfaceName);
|
2225 chip 1.5
|
2226 kumpf 1.28 return ProviderName(providerName, fileName, interfaceName, 0);
|
2227 schuur 1.23 }
2228
|
2229 kumpf 1.31 Boolean DefaultProviderManager::hasActiveProviders()
2230 {
2231 return providerManager.hasActiveProviders();
2232 }
2233
2234 void DefaultProviderManager::unloadIdleProviders()
|
2235 schuur 1.23 {
|
2236 kumpf 1.31 providerManager.unloadIdleProviders();
|
2237 chip 1.1 }
2238
|
2239 carolann.graves 1.49 void DefaultProviderManager::_callEnableIndications
2240 (CIMInstance & req_provider,
2241 PEGASUS_INDICATION_CALLBACK _indicationCallback,
2242 OpProviderHolder & ph)
2243 {
2244 PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
2245 "DefaultProviderManager::_callEnableIndications");
2246
2247 try
2248 {
2249 CIMRequestMessage * request = 0;
2250 CIMResponseMessage * response = 0;
2251 EnableIndicationsResponseHandler * enableHandler =
2252 new EnableIndicationsResponseHandler
2253 (request, response, req_provider, _indicationCallback);
2254
2255 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2256 "Calling provider.enableIndications: " +
2257 ph.GetProvider ().getName ());
2258
2259 pm_service_op_lock op_lock (& ph.GetProvider ());
2260 carolann.graves 1.49 ph.GetProvider ().protect ();
2261 ph.GetProvider ().enableIndications (* enableHandler);
2262
2263 //
2264 // Store the handler so it is persistent for as
2265 // long as the provider has indications enabled
2266 //
2267 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2268 "Storing indication handler for " +
2269 ph.GetProvider ().getName ());
2270
2271 _insertEntry (ph.GetProvider (), enableHandler);
2272 }
2273 catch (CIMException & e)
2274 {
2275 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2276 "CIMException: " + e.getMessage ());
2277
|
2278 mike 1.56 Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
|
2279 carolann.graves 1.49 "ProviderManager.Default.DefaultProviderManager."
2280 "ENABLE_INDICATIONS_FAILED",
2281 "Failed to enable indications for provider $0: $1.",
2282 ph.GetProvider ().getName (), e.getMessage ());
2283 }
2284 catch (Exception & e)
2285 {
2286 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2287 "Exception: " + e.getMessage ());
2288
2289 Logger::put_l (Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
2290 "ProviderManager.Default.DefaultProviderManager."
2291 "ENABLE_INDICATIONS_FAILED",
2292 "Failed to enable indications for provider $0: $1.",
2293 ph.GetProvider ().getName (), e.getMessage ());
2294 }
2295 catch(...)
2296 {
2297 PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2298 "Unexpected error in _callEnableIndications");
2299
2300 carolann.graves 1.49 Logger::put_l (Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
2301 "ProviderManager.Default.DefaultProviderManager."
2302 "ENABLE_INDICATIONS_FAILED_UNKNOWN",
2303 "Failed to enable indications for provider $0.",
2304 ph.GetProvider ().getName ());
2305 }
2306
2307 PEG_METHOD_EXIT ();
2308 }
2309
|
2310 kumpf 1.26 PEGASUS_NAMESPACE_END
|