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