1 martin 1.30 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.31 //
|
3 martin 1.30 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.31 //
|
10 martin 1.30 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.31 //
|
17 martin 1.30 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.31 //
|
20 martin 1.30 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.31 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.30 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.31 //
|
28 martin 1.30 //////////////////////////////////////////////////////////////////////////
|
29 schuur 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #include "OperationResponseHandler.h"
|
33 a.dunfey 1.15 #include "CIMOMHandleContext.h"
|
34 chip 1.7
|
35 marek 1.25 #include <Pegasus/Common/Tracer.h>
|
36 dave.sudlik 1.24 #include <Pegasus/Common/SharedPtr.h>
|
37 a.dunfey 1.15 #include <Pegasus/Provider/CIMOMHandle.h>
|
38 venkat.puvvada 1.26 #include <Pegasus/Config/ConfigManager.h>
|
39 chip 1.7
|
40 schuur 1.1 PEGASUS_NAMESPACE_BEGIN
41
|
42 venkat.puvvada 1.26 static void _initializeNormalizer(
43 CIMOperationRequestMessage *request,
44 Boolean includeQualifiers,
45 Boolean includeClassOrigin,
46 ObjectNormalizer &normalizer)
47 {
|
48 kumpf 1.32 // Attempt to get the cached class definition, normalization is disabled
|
49 venkat.puvvada 1.26 // if it does not exist.
50 if (request->operationContext.contains(
51 CachedClassDefinitionContainer::NAME))
52 {
53 CachedClassDefinitionContainer container =
54 request->operationContext.get(
55 CachedClassDefinitionContainer::NAME);
|
56 mike 1.28 CIMClass cimClass = container.getClass().clone();
|
57 mike 1.29 container = CachedClassDefinitionContainer(cimClass);
|
58 venkat.puvvada 1.26 SharedPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());
59 ObjectNormalizer tmpNormalizer(
60 cimClass,
61 includeQualifiers,
62 includeClassOrigin,
63 request->nameSpace,
64 tmpContext);
65 normalizer = tmpNormalizer;
66 }
67 }
68
|
69 chip 1.7 //
70 // OperationResponseHandler
71 //
72
73 OperationResponseHandler::OperationResponseHandler(
|
74 kumpf 1.23 CIMRequestMessage* request,
75 CIMResponseMessage* response,
|
76 kumpf 1.14 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
|
77 chip 1.7 : _request(request),
78 _response(response),
|
79 kumpf 1.14 _responseChunkCallback(responseChunkCallback),
|
80 chip 1.8 _responseObjectTotal(0),
|
81 chip 1.7 _responseMessageTotal(0),
|
82 kumpf 1.14 _responseObjectThreshold(0)
|
83 brian.campbell 1.3 {
84 #ifndef PEGASUS_RESPONSE_OBJECT_COUNT_THRESHOLD
|
85 kumpf 1.23 # define PEGASUS_RESPONSE_OBJECT_COUNT_THRESHOLD 100
|
86 brian.campbell 1.3 #elif PEGASUS_RESPONSE_OBJECT_COUNT_THRESHOLD == 0
|
87 kumpf 1.23 # undef PEGASUS_RESPONSE_OBJECT_COUNT_THRESHOLD
88 # define PEGASUS_RESPONSE_OBJECT_COUNT_THRESHOLD ~0
|
89 brian.campbell 1.3 #endif
90
|
91 kumpf 1.14 if (!request)
|
92 a.dunfey 1.4 {
93 _responseObjectThreshold = ~0;
94 }
|
95 kumpf 1.23 else
|
96 a.dunfey 1.4 {
97 _responseObjectThreshold = PEGASUS_RESPONSE_OBJECT_COUNT_THRESHOLD;
|
98 brian.campbell 1.3
99 #ifdef PEGASUS_DEBUG
|
100 kumpf 1.23 static const char* responseObjectThreshold =
101 getenv("PEGASUS_RESPONSE_OBJECT_COUNT_THRESHOLD");
|
102 chip 1.7
103 if (responseObjectThreshold)
|
104 kumpf 1.23 {
105 Uint32 i = (Uint32)atoi(responseObjectThreshold);
|
106 chip 1.7
107 if (i > 0)
108 {
109 _responseObjectThreshold = i;
110 }
|
111 kumpf 1.23 }
|
112 brian.campbell 1.3 #endif
|
113 a.dunfey 1.4 }
|
114 brian.campbell 1.3 }
115
116 OperationResponseHandler::~OperationResponseHandler()
117 {
|
118 kumpf 1.23 _request = 0;
119 _response = 0;
|
120 brian.campbell 1.3 }
121
|
122 kumpf 1.23 CIMRequestMessage* OperationResponseHandler::getRequest() const
|
123 chip 1.7 {
|
124 kumpf 1.23 return _request;
|
125 chip 1.7 }
126
|
127 kumpf 1.23 CIMResponseMessage* OperationResponseHandler::getResponse() const
|
128 chip 1.7 {
|
129 kumpf 1.23 return _response;
|
130 chip 1.7 }
131
132 void OperationResponseHandler::setStatus(
133 const Uint32 code,
|
134 kumpf 1.23 const String& message)
|
135 chip 1.7 {
|
136 kumpf 1.23 _response->cimException =
137 PEGASUS_CIM_EXCEPTION(CIMStatusCode(code), message);
|
138 chip 1.7 }
139
140 void OperationResponseHandler::setStatus(
141 const Uint32 code,
|
142 kumpf 1.23 const ContentLanguageList& langs,
143 const String& message)
|
144 chip 1.7 {
145 _response->cimException =
146 PEGASUS_CIM_EXCEPTION_LANG(
147 langs,
148 CIMStatusCode(code),
149 message);
150 }
151
|
152 mike 1.22 void OperationResponseHandler::setCIMException(
153 const CIMException& cimException)
154 {
155 // Assign the cimException argument to _response->cimException. Note that
156 // there is no need to use the PEGASUS_CIM_EXCEPTION_LANG() macro to create
|
157 kumpf 1.32 // a TraceableCIMException since both _response->cimException and
|
158 mike 1.22 // cimException are of type CIMException and the TraceableCIMException
159 // constructor has no side effects.
160 _response->cimException = cimException;
161 }
162
|
163 kumpf 1.23 Boolean OperationResponseHandler::isAsync() const
|
164 chip 1.7 {
|
165 kumpf 1.17 return _responseChunkCallback != 0;
|
166 chip 1.7 }
167
|
168 brian.campbell 1.3 // This is only called from SimpleResponseHandler.deliver() but lives in this
169 // class because all asyncronous response must have a "response" pointer
170 // to go through. Only operation classes have a response pointer
171 void OperationResponseHandler::send(Boolean isComplete)
172 {
|
173 kumpf 1.20 // It is possible to instantiate this class directly (not a derived
174 // class, which would also inherit from SimpleResponseHandler).
175 // The caller would do this only if the operation does not have any
176 // data to be returned.
177
178 SimpleResponseHandler* simpleP =
179 dynamic_cast<SimpleResponseHandler*>(this);
180 if (simpleP == 0)
181 {
182 // if there is no data to be returned, then the message should NEVER be
183 // incomplete (even on an error)
184 PEGASUS_ASSERT(isComplete);
|
185 chip 1.7 return;
|
186 kumpf 1.20 }
|
187 kumpf 1.19
|
188 kumpf 1.20 // some handlers do not send async because their callers cannot handle
189 // partial responses. If this is the case, stop here.
|
190 brian.campbell 1.3
|
191 kumpf 1.20 if (!isAsync())
192 {
193 // preserve traditional behavior
194 if (isComplete)
|
195 chip 1.7 {
|
196 kumpf 1.20 if (_response != 0)
197 {
198 _response->operationContext.set(
199 ContentLanguageListContainer(simpleP->getLanguages()));
200 }
201 transfer();
|
202 chip 1.7 }
203
204 return;
|
205 kumpf 1.20 }
|
206 brian.campbell 1.3
|
207 kumpf 1.23 SimpleResponseHandler& simple = *simpleP;
208 PEGASUS_ASSERT(_response);
209 Uint32 objectCount = simple.size();
|
210 brian.campbell 1.3
|
211 kumpf 1.23 // have not reached threshold yet
212 if ((isComplete == false) && (objectCount < _responseObjectThreshold))
|
213 chip 1.7 {
214 return;
215 }
|
216 brian.campbell 1.3
|
217 kumpf 1.23 CIMResponseMessage* response = _response;
|
218 brian.campbell 1.3
|
219 kumpf 1.23 // for complete responses, just use the one handed down from caller
220 // otherwise, create our own that the caller never sees but is
221 // utilized for async responses underneath
|
222 brian.campbell 1.3
|
223 kumpf 1.23 if (isComplete == false)
|
224 chip 1.7 {
225 _response = _request->buildResponse();
226 }
|
227 brian.campbell 1.3
|
228 kumpf 1.23 _response->setComplete(isComplete);
229 _responseObjectTotal += objectCount;
|
230 brian.campbell 1.3
|
231 kumpf 1.23 // since we are reusing response for every chunk, keep track of original
232 // count
233 _response->setIndex(_responseMessageTotal++);
234
235 // set the originally allocated response to one more than the current.
236 // The reason for doing this is proactive in case of an exception. This
237 // allows the last response to be set as it may not re-enter this code.
|
238 brian.campbell 1.3
|
239 kumpf 1.23 if (isComplete == false)
|
240 chip 1.7 {
241 response->setIndex(_responseMessageTotal);
242 }
|
243 brian.campbell 1.3
|
244 kumpf 1.23 validate();
|
245 brian.campbell 1.3
|
246 kumpf 1.23 if (_response->cimException.getCode() != CIM_ERR_SUCCESS)
|
247 chip 1.7 {
248 simple.clear();
249 }
250
|
251 marek 1.25 PEG_TRACE((
252 TRC_PROVIDERMANAGER,
253 Tracer::LEVEL4,
254 "%s::transfer",
255 (const char*) getClass().getCString()));
|
256 chip 1.7
|
257 kumpf 1.23 transfer();
258 simple.clear();
|
259 brian.campbell 1.3
|
260 kumpf 1.23 _response->operationContext.set(
261 ContentLanguageListContainer(simple.getLanguages()));
|
262 brian.campbell 1.3
|
263 kumpf 1.23 // call thru ProviderManager to get externally declared entry point
|
264 brian.campbell 1.3
|
265 kumpf 1.23 if (isComplete == false)
266 {
267 _responseChunkCallback(_request, _response);
268 }
|
269 brian.campbell 1.3
|
270 kumpf 1.23 // put caller's allocated response back in place. Note that _response
271 // is INVALID after sending because it has been deleted externally
|
272 brian.campbell 1.3
|
273 kumpf 1.23 _response = response;
|
274 brian.campbell 1.3 }
275
|
276 kumpf 1.23 void OperationResponseHandler::transfer()
|
277 chip 1.7 {
278 }
279
|
280 kumpf 1.23 void OperationResponseHandler::validate()
|
281 chip 1.7 {
282 }
283
|
284 kumpf 1.23 String OperationResponseHandler::getClass() const
|
285 chip 1.7 {
|
286 kumpf 1.23 return String("OperationResponseHandler");
|
287 chip 1.7 }
288
|
289 kumpf 1.23 Uint32 OperationResponseHandler::getResponseObjectTotal() const
|
290 chip 1.7 {
|
291 kumpf 1.23 return _responseObjectTotal;
|
292 chip 1.7 }
293
|
294 kumpf 1.23 Uint32 OperationResponseHandler::getResponseMessageTotal() const
|
295 chip 1.7 {
|
296 kumpf 1.23 return _responseMessageTotal;
|
297 chip 1.7 }
298
|
299 kumpf 1.23 Uint32 OperationResponseHandler::getResponseObjectThreshold() const
|
300 chip 1.7 {
|
301 kumpf 1.23 return _responseObjectThreshold;
|
302 chip 1.7 }
303
304 //
305 // GetInstanceResponseHandler
306 //
307
308 GetInstanceResponseHandler::GetInstanceResponseHandler(
|
309 kumpf 1.14 CIMGetInstanceRequestMessage* request,
310 CIMGetInstanceResponseMessage* response,
311 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
312 : OperationResponseHandler(request, response, responseChunkCallback)
|
313 chip 1.7 {
|
314 venkat.puvvada 1.26 _initializeNormalizer(
315 request,
|
316 a.dunfey 1.15 request->includeQualifiers,
317 request->includeClassOrigin,
|
318 venkat.puvvada 1.26 _normalizer);
|
319 chip 1.7 }
320
|
321 marek 1.33.2.3 void GetInstanceResponseHandler::deliver(const CIMInstance& cimInstance)
|
322 r.kieninger 1.33.2.2 {
323 if (cimInstance.isUninitialized())
324 {
325 MessageLoaderParms message(
326 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
327 "The object is not initialized.");
328
329 throw CIMException(CIM_ERR_FAILED, message);
330 }
331
332 if (SimpleInstanceResponseHandler::size() != 0)
333 {
334 MessageLoaderParms message(
335 "Server.OperationResponseHandler.TOO_MANY_OBJECTS_DELIVERED",
336 "Too many objects delivered.");
337
338 throw CIMException(CIM_ERR_FAILED, message);
339 }
340
|
341 marek 1.33.2.3 CIMInstance localInstance(cimInstance);
|
342 r.kieninger 1.33.2.2 #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION
343 // The normalizer expects an object path embedded in instances even
344 // though it is not required by this operation. Use the requested
345 // object path is missing from the instance.
346 if (localInstance.getPath().getKeyBindings().size() == 0)
347 {
348 // ATTN: should clone before modification
349 localInstance.setPath(static_cast<CIMGetInstanceRequestMessage*>(
350 getRequest())->instanceName);
351 }
352 #endif
|
353 marek 1.33.2.3 SimpleInstanceResponseHandler::deliver(
354 _normalizer.processInstance(localInstance));
|
355 r.kieninger 1.33.2.2 }
356
|
357 marek 1.33.2.3 void GetInstanceResponseHandler::deliver(const SCMOInstance& cimInstance)
|
358 chip 1.7 {
|
359 kumpf 1.23 if (cimInstance.isUninitialized())
|
360 chip 1.7 {
361 MessageLoaderParms message(
362 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
363 "The object is not initialized.");
364
365 throw CIMException(CIM_ERR_FAILED, message);
366 }
367
|
368 kumpf 1.23 if (SimpleInstanceResponseHandler::size() != 0)
|
369 chip 1.9 {
370 MessageLoaderParms message(
371 "Server.OperationResponseHandler.TOO_MANY_OBJECTS_DELIVERED",
372 "Too many objects delivered.");
373
374 throw CIMException(CIM_ERR_FAILED, message);
375 }
376
|
377 marek 1.33.2.3 SimpleInstanceResponseHandler::deliver(cimInstance);
|
378 chip 1.7 }
379
|
380 kumpf 1.23 void GetInstanceResponseHandler::complete()
|
381 chip 1.9 {
|
382 kumpf 1.23 if (SimpleInstanceResponseHandler::size() == 0)
|
383 chip 1.9 {
384 MessageLoaderParms message(
385 "Server.OperationResponseHandler.TOO_FEW_OBJECTS_DELIVERED",
386 "Too few objects delivered.");
|
387 venkat.puvvada 1.21 // Provider claims success, no instances returned. -V see Bug #4104
388 setStatus(CIM_ERR_NOT_FOUND);
|
389 chip 1.9 throw CIMException(CIM_ERR_FAILED, message);
390 }
391
392 SimpleInstanceResponseHandler::complete();
393 }
394
|
395 kumpf 1.23 String GetInstanceResponseHandler::getClass() const
|
396 chip 1.7 {
|
397 kumpf 1.23 return String("GetInstanceResponseHandler");
|
398 chip 1.7 }
399
|
400 kumpf 1.23 void GetInstanceResponseHandler::transfer()
|
401 chip 1.7 {
|
402 kumpf 1.23 if (size() > 0)
|
403 chip 1.7 {
|
404 kumpf 1.23 CIMGetInstanceResponseMessage& msg =
405 *static_cast<CIMGetInstanceResponseMessage*>(getResponse());
|
406 marek 1.33.2.3 Array<CIMInstance> cimObjs= getObjects();
407 Array<SCMOInstance> scmoObjs= getSCMOObjects();
408 if (cimObjs.size() != 0)
409 {
410 msg.getResponseData().setInstance(cimObjs[0]);
411 }
412 else
413 {
414 msg.getResponseData().setSCMO(scmoObjs);
415 }
|
416 chip 1.7 }
417 }
418
|
419 kumpf 1.23 void GetInstanceResponseHandler::validate()
|
420 chip 1.7 {
|
421 kumpf 1.23 if (getResponseObjectTotal() == 0)
|
422 chip 1.7 {
423 // error? provider claims success,
424 // but did not deliver an instance.
425 setStatus(CIM_ERR_NOT_FOUND);
426 }
427 }
428
429 //
430 // EnumerateInstancesResponseHandler
431 //
432
433 EnumerateInstancesResponseHandler::EnumerateInstancesResponseHandler(
|
434 kumpf 1.14 CIMEnumerateInstancesRequestMessage* request,
435 CIMEnumerateInstancesResponseMessage* response,
436 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
437 : OperationResponseHandler(request, response, responseChunkCallback)
|
438 chip 1.7 {
|
439 venkat.puvvada 1.26 _initializeNormalizer(
440 request,
|
441 a.dunfey 1.15 request->includeQualifiers,
442 request->includeClassOrigin,
|
443 venkat.puvvada 1.26 _normalizer);
|
444 chip 1.7 }
445
|
446 kumpf 1.23 void EnumerateInstancesResponseHandler::deliver(const CIMInstance& cimInstance)
|
447 chip 1.7 {
|
448 kumpf 1.23 if (cimInstance.isUninitialized())
|
449 chip 1.7 {
450 MessageLoaderParms message(
451 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
452 "The object is not initialized.");
453
454 throw CIMException(CIM_ERR_FAILED, message);
455 }
456
|
457 kumpf 1.23 SimpleInstanceResponseHandler::deliver(
458 _normalizer.processInstance(cimInstance));
|
459 chip 1.7 }
460
|
461 marek 1.33.2.3 void EnumerateInstancesResponseHandler::deliver(
462 const SCMOInstance& scmoInstance)
|
463 r.kieninger 1.33.2.1 {
|
464 marek 1.33.2.3 if (scmoInstance.isUninitialized())
|
465 r.kieninger 1.33.2.1 {
466 MessageLoaderParms message(
467 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
468 "The object is not initialized.");
469
470 throw CIMException(CIM_ERR_FAILED, message);
|
471 r.kieninger 1.33.2.2 }
|
472 marek 1.33.2.3 SimpleInstanceResponseHandler::deliver(scmoInstance);
|
473 r.kieninger 1.33.2.1 }
474
|
475 kumpf 1.23 String EnumerateInstancesResponseHandler::getClass() const
|
476 chip 1.7 {
|
477 kumpf 1.23 return String("EnumerateInstancesResponseHandler");
|
478 chip 1.7 }
479
|
480 kumpf 1.23 void EnumerateInstancesResponseHandler::transfer()
|
481 chip 1.7 {
|
482 kumpf 1.23 CIMEnumerateInstancesResponseMessage& msg =
483 *static_cast<CIMEnumerateInstancesResponseMessage*>(getResponse());
|
484 chip 1.7
|
485 marek 1.33.2.3 Array<CIMInstance> cimObjs= getObjects();
486 Array<SCMOInstance> scmoObjs= getSCMOObjects();
487 if (cimObjs.size() != 0)
488 {
489 msg.getResponseData().setInstances(cimObjs);
490 }
491 if (scmoObjs.size() != 0)
492 {
493 msg.getResponseData().setSCMO(scmoObjs);
494 }
|
495 chip 1.7 }
496
497 //
498 // EnumerateInstanceNamesResponseHandler
499 //
500
501 EnumerateInstanceNamesResponseHandler::EnumerateInstanceNamesResponseHandler(
|
502 kumpf 1.14 CIMEnumerateInstanceNamesRequestMessage* request,
503 CIMEnumerateInstanceNamesResponseMessage* response,
504 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
505 : OperationResponseHandler(request, response, responseChunkCallback)
|
506 chip 1.7 {
|
507 venkat.puvvada 1.26 _initializeNormalizer(
508 request,
|
509 a.dunfey 1.15 false,
510 false,
|
511 venkat.puvvada 1.26 _normalizer);
|
512 chip 1.7 }
513
|
514 kumpf 1.23 void EnumerateInstanceNamesResponseHandler::deliver(
515 const CIMObjectPath& cimObjectPath)
|
516 chip 1.7 {
|
517 kumpf 1.23 if (cimObjectPath.getClassName().isNull())
|
518 chip 1.7 {
519 MessageLoaderParms message(
520 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
521 "The object is not initialized.");
522
523 throw CIMException(CIM_ERR_FAILED, message);
524 }
525
|
526 kumpf 1.23 SimpleObjectPathResponseHandler::deliver(
527 _normalizer.processInstanceObjectPath(cimObjectPath));
|
528 chip 1.7 }
529
|
530 r.kieninger 1.33.2.1 void EnumerateInstanceNamesResponseHandler::deliver(
531 const SCMOInstance& scmoObjectPath)
532 {
533 if (scmoObjectPath.getClassName()==NULL)
534 {
535 MessageLoaderParms message(
536 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
537 "The object is not initialized.");
538
539 throw CIMException(CIM_ERR_FAILED, message);
540 }
541
542 SimpleObjectPathResponseHandler::deliver(scmoObjectPath);
543 }
544
|
545 kumpf 1.23 String EnumerateInstanceNamesResponseHandler::getClass() const
|
546 chip 1.7 {
|
547 kumpf 1.23 return String("EnumerateInstanceNamesResponseHandler");
|
548 chip 1.7 }
549
|
550 kumpf 1.23 void EnumerateInstanceNamesResponseHandler::transfer()
|
551 chip 1.7 {
|
552 kumpf 1.23 CIMEnumerateInstanceNamesResponseMessage& msg =
553 *static_cast<CIMEnumerateInstanceNamesResponseMessage*>(getResponse());
|
554 chip 1.7
|
555 marek 1.33.2.3 Array<CIMObjectPath> cimObjs= getObjects();
556 Array<SCMOInstance> scmoObjs= getSCMOObjects();
557 if (cimObjs.size() != 0)
558 {
559 msg.getResponseData().setInstanceNames(cimObjs);
560 }
561 if (scmoObjs.size() != 0)
562 {
563 msg.getResponseData().setSCMO(scmoObjs);
564 }
|
565 chip 1.7 }
566
567 //
568 // CreateInstanceResponseHandler
569 //
570
571 CreateInstanceResponseHandler::CreateInstanceResponseHandler(
|
572 kumpf 1.14 CIMCreateInstanceRequestMessage* request,
573 CIMCreateInstanceResponseMessage* response,
574 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
575 : OperationResponseHandler(request, response, responseChunkCallback)
|
576 chip 1.7 {
577 }
578
|
579 kumpf 1.23 void CreateInstanceResponseHandler::deliver(const CIMObjectPath& cimObjectPath)
|
580 chip 1.7 {
|
581 kumpf 1.23 if (cimObjectPath.getClassName().isNull())
|
582 chip 1.7 {
583 MessageLoaderParms message(
584 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
585 "The object is not initialized.");
586
587 throw CIMException(CIM_ERR_FAILED, message);
588 }
589
|
590 kumpf 1.23 if (SimpleObjectPathResponseHandler::size() != 0)
|
591 chip 1.11 {
592 MessageLoaderParms message(
593 "Server.OperationResponseHandler.TOO_MANY_OBJECTS_DELIVERED",
594 "Too many objects delivered.");
595
596 throw CIMException(CIM_ERR_FAILED, message);
597 }
598
|
599 chip 1.7 SimpleObjectPathResponseHandler::deliver(cimObjectPath);
600 }
601
|
602 kumpf 1.23 void CreateInstanceResponseHandler::complete()
|
603 chip 1.9 {
|
604 kumpf 1.23 if (SimpleObjectPathResponseHandler::size() == 0)
|
605 chip 1.9 {
606 MessageLoaderParms message(
607 "Server.OperationResponseHandler.TOO_FEW_OBJECTS_DELIVERED",
608 "Too few objects delivered.");
609
610 throw CIMException(CIM_ERR_FAILED, message);
611 }
612
613 SimpleObjectPathResponseHandler::complete();
614 }
615
|
616 kumpf 1.23 String CreateInstanceResponseHandler::getClass() const
|
617 chip 1.7 {
|
618 kumpf 1.23 return String("CreateInstanceResponseHandler");
|
619 chip 1.7 }
620
621 #if 0
622 // ATTN: is it an error to not return instance name?
|
623 kumpf 1.23 void CreateInstanceResponseHandler::validate()
|
624 chip 1.7 {
|
625 kumpf 1.23 if (getResponseObjectTotal() == 0)
|
626 chip 1.7 {
627 setStatus(CIM_ERR_NOT_FOUND);
628 }
629 }
630 #endif
631
|
632 kumpf 1.23 void CreateInstanceResponseHandler::transfer()
|
633 chip 1.7 {
|
634 kumpf 1.23 if (size() > 0)
|
635 chip 1.7 {
|
636 kumpf 1.23 CIMCreateInstanceResponseMessage& msg =
637 *static_cast<CIMCreateInstanceResponseMessage*>(getResponse());
|
638 chip 1.7
639 msg.instanceName = getObjects()[0];
640 }
641 }
642
643 //
644 // ModifyInstanceResponseHandler
645 //
646
647 ModifyInstanceResponseHandler::ModifyInstanceResponseHandler(
|
648 kumpf 1.14 CIMModifyInstanceRequestMessage* request,
649 CIMModifyInstanceResponseMessage* response,
650 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
651 : OperationResponseHandler(request, response, responseChunkCallback)
|
652 chip 1.7 {
653 }
654
|
655 kumpf 1.23 String ModifyInstanceResponseHandler::getClass() const
|
656 chip 1.7 {
|
657 kumpf 1.23 return String("ModifyInstanceResponseHandler");
|
658 chip 1.7 }
659
660 //
661 // DeleteInstanceResponseHandler
662 //
663
664 DeleteInstanceResponseHandler::DeleteInstanceResponseHandler(
|
665 kumpf 1.14 CIMDeleteInstanceRequestMessage* request,
666 CIMDeleteInstanceResponseMessage* response,
667 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
668 : OperationResponseHandler(request, response, responseChunkCallback)
|
669 chip 1.7 {
670 }
671
|
672 kumpf 1.23 String DeleteInstanceResponseHandler::getClass() const
|
673 chip 1.7 {
|
674 kumpf 1.23 return String("DeleteInstanceResponseHandler");
|
675 chip 1.7 }
676
677 //
678 // GetPropertyResponseHandler
679 //
680
681 GetPropertyResponseHandler::GetPropertyResponseHandler(
|
682 kumpf 1.14 CIMGetPropertyRequestMessage* request,
683 CIMGetPropertyResponseMessage* response,
684 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
685 : OperationResponseHandler(request, response, responseChunkCallback)
|
686 chip 1.7 {
687 }
688
|
689 kumpf 1.23 void GetPropertyResponseHandler::deliver(const CIMValue& cimValue)
|
690 chip 1.7 {
|
691 kumpf 1.23 if (cimValue.isNull())
|
692 chip 1.7 {
693 MessageLoaderParms message(
694 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
695 "The object is not initialized.");
696
697 throw CIMException(CIM_ERR_FAILED, message);
698 }
699
700 SimpleValueResponseHandler::deliver(cimValue);
701 }
702
|
703 kumpf 1.23 String GetPropertyResponseHandler::getClass() const
|
704 chip 1.7 {
|
705 kumpf 1.23 return String("GetPropertyResponseHandler");
|
706 chip 1.7 }
707
|
708 kumpf 1.23 void GetPropertyResponseHandler::transfer()
|
709 chip 1.7 {
|
710 kumpf 1.23 if (size() > 0)
|
711 chip 1.7 {
|
712 kumpf 1.23 CIMGetPropertyResponseMessage& msg =
713 *static_cast<CIMGetPropertyResponseMessage*>(getResponse());
|
714 chip 1.7
715 msg.value = getObjects()[0];
716 }
717 }
718
|
719 kumpf 1.23 void GetPropertyResponseHandler::validate()
|
720 chip 1.7 {
721 // error? provider claims success,
722 // but did not deliver an instance.
|
723 kumpf 1.23 if (getResponseObjectTotal() == 0)
|
724 chip 1.7 {
725 setStatus(CIM_ERR_NOT_FOUND);
726 }
727 }
728
729 //
730 // SetPropertyResponseHandler
731 //
732
733 SetPropertyResponseHandler::SetPropertyResponseHandler(
|
734 kumpf 1.14 CIMSetPropertyRequestMessage* request,
735 CIMSetPropertyResponseMessage* response,
736 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
737 : OperationResponseHandler(request, response, responseChunkCallback)
|
738 chip 1.7 {
739 }
740
|
741 kumpf 1.23 String SetPropertyResponseHandler::getClass() const
|
742 chip 1.7 {
|
743 kumpf 1.23 return String("SetPropertyResponseHandler");
|
744 chip 1.7 }
745
746 //
747 // ExecQueryResponseHandler
748 //
749
750 ExecQueryResponseHandler::ExecQueryResponseHandler(
|
751 kumpf 1.14 CIMExecQueryRequestMessage* request,
752 CIMExecQueryResponseMessage* response,
753 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
754 : OperationResponseHandler(request, response, responseChunkCallback)
|
755 chip 1.7 {
756 }
757
|
758 kumpf 1.23 void ExecQueryResponseHandler::deliver(const CIMInstance& cimInstance)
|
759 chip 1.7 {
|
760 kumpf 1.23 if (cimInstance.isUninitialized())
|
761 chip 1.7 {
762 MessageLoaderParms message(
763 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
764 "The object is not initialized.");
765
766 throw CIMException(CIM_ERR_FAILED, message);
767 }
768
769 SimpleInstance2ObjectResponseHandler::deliver(cimInstance);
770 }
771
|
772 marek 1.33.2.3 void ExecQueryResponseHandler::deliver(const SCMOInstance& scmoInstance)
|
773 r.kieninger 1.33.2.1 {
|
774 marek 1.33.2.3 if (scmoInstance.isUninitialized())
|
775 r.kieninger 1.33.2.1 {
776 MessageLoaderParms message(
777 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
778 "The object is not initialized.");
779
780 throw CIMException(CIM_ERR_FAILED, message);
|
781 r.kieninger 1.33.2.2 }
|
782 r.kieninger 1.33.2.1
|
783 marek 1.33.2.3 SimpleInstance2ObjectResponseHandler::deliver(scmoInstance);
|
784 r.kieninger 1.33.2.1 }
785
|
786 kumpf 1.23 String ExecQueryResponseHandler::getClass() const
|
787 chip 1.7 {
|
788 kumpf 1.23 return String("ExecQueryResponseHandler");
|
789 chip 1.7 }
790
|
791 kumpf 1.23 void ExecQueryResponseHandler::transfer()
|
792 chip 1.7 {
|
793 kumpf 1.23 CIMExecQueryResponseMessage& msg =
794 *static_cast<CIMExecQueryResponseMessage*>(getResponse());
|
795 chip 1.7
|
796 marek 1.33.2.3 Array<CIMObject> cimObjs= getObjects();
797 Array<SCMOInstance> scmoObjs= getSCMOObjects();
798 if (cimObjs.size() != 0)
799 {
800 msg.getResponseData().setObjects(cimObjs);
801 }
802 if (scmoObjs.size() != 0)
803 {
804 msg.getResponseData().setSCMO(scmoObjs);
805 }
|
806 chip 1.7 }
807
|
808 kumpf 1.23 Boolean ExecQueryResponseHandler::isAsync() const
|
809 chip 1.7 {
|
810 kumpf 1.23 return false;
|
811 chip 1.7 }
812
813 //
814 // AssociatorsResponseHandler
815 //
816
817 AssociatorsResponseHandler::AssociatorsResponseHandler(
|
818 kumpf 1.14 CIMAssociatorsRequestMessage* request,
819 CIMAssociatorsResponseMessage* response,
820 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
821 : OperationResponseHandler(request, response, responseChunkCallback)
|
822 chip 1.7 {
823 }
824
|
825 kumpf 1.23 void AssociatorsResponseHandler::deliver(const CIMObject& cimObject)
|
826 chip 1.7 {
|
827 kumpf 1.23 if (cimObject.isUninitialized())
|
828 chip 1.7 {
829 MessageLoaderParms message(
830 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
831 "The object is not initialized.");
832
833 throw CIMException(CIM_ERR_FAILED, message);
834 }
835
836 SimpleObjectResponseHandler::deliver(cimObject);
837 }
838
|
839 marek 1.33.2.3 void AssociatorsResponseHandler::deliver(const SCMOInstance& scmoObject)
|
840 r.kieninger 1.33.2.2 {
|
841 marek 1.33.2.3 if (scmoObject.isUninitialized())
|
842 r.kieninger 1.33.2.2 {
843 MessageLoaderParms message(
844 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
845 "The object is not initialized.");
846
847 throw CIMException(CIM_ERR_FAILED, message);
848 }
|
849 marek 1.33.2.3 SimpleObjectResponseHandler::deliver(scmoObject);
|
850 r.kieninger 1.33.2.2 }
851
|
852 kumpf 1.23 String AssociatorsResponseHandler::getClass() const
|
853 chip 1.7 {
|
854 kumpf 1.23 return String("AssociatorsResponseHandler");
|
855 chip 1.7 }
856
|
857 kumpf 1.23 void AssociatorsResponseHandler::transfer()
|
858 chip 1.7 {
|
859 kumpf 1.23 CIMAssociatorsResponseMessage& msg =
860 *static_cast<CIMAssociatorsResponseMessage*>(getResponse());
|
861 chip 1.7
|
862 marek 1.33.2.3 Array<CIMObject> cimObjs= getObjects();
863 Array<SCMOInstance> scmoObjs= getSCMOObjects();
864 if (cimObjs.size() != 0)
865 {
866 msg.getResponseData().setObjects(cimObjs);
867 }
868 if (scmoObjs.size() != 0)
869 {
870 msg.getResponseData().setSCMO(scmoObjs);
871 }
|
872 chip 1.7 }
873
874 //
875 // AssociatorNamesResponseHandler
876 //
877
878 AssociatorNamesResponseHandler::AssociatorNamesResponseHandler(
|
879 kumpf 1.14 CIMAssociatorNamesRequestMessage* request,
880 CIMAssociatorNamesResponseMessage* response,
881 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
882 : OperationResponseHandler(request, response, responseChunkCallback)
|
883 chip 1.7 {
884 }
885
|
886 kumpf 1.23 void AssociatorNamesResponseHandler::deliver(const CIMObjectPath& cimObjectPath)
|
887 chip 1.7 {
|
888 kumpf 1.23 if (cimObjectPath.getClassName().isNull())
|
889 chip 1.7 {
890 MessageLoaderParms message(
891 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
892 "The object is not initialized.");
893
894 throw CIMException(CIM_ERR_FAILED, message);
895 }
896
897 SimpleObjectPathResponseHandler::deliver(cimObjectPath);
898 }
899
|
900 marek 1.33.2.3 void AssociatorNamesResponseHandler::deliver(const SCMOInstance& scmoObjectPath)
|
901 r.kieninger 1.33.2.2 {
|
902 marek 1.33.2.3 SimpleObjectPathResponseHandler::deliver(scmoObjectPath);
|
903 r.kieninger 1.33.2.2 }
904
|
905 kumpf 1.23 String AssociatorNamesResponseHandler::getClass() const
|
906 chip 1.7 {
|
907 kumpf 1.23 return String("AssociatorNamesResponseHandler");
|
908 chip 1.7 }
909
|
910 kumpf 1.23 void AssociatorNamesResponseHandler::transfer()
|
911 chip 1.7 {
|
912 kumpf 1.23 CIMAssociatorNamesResponseMessage& msg =
913 *static_cast<CIMAssociatorNamesResponseMessage*>(getResponse());
|
914 chip 1.7
|
915 marek 1.33.2.3 Array<CIMObjectPath> cimObjs= getObjects();
916 Array<SCMOInstance> scmoObjs= getSCMOObjects();
917 if (cimObjs.size() != 0)
918 {
919 msg.getResponseData().setInstanceNames(cimObjs);
920 }
921 if (scmoObjs.size() != 0)
922 {
923 msg.getResponseData().setSCMO(scmoObjs);
924 }
|
925 chip 1.7 }
926
927 //
928 // ReferencesResponseHandler
929 //
930
931 ReferencesResponseHandler::ReferencesResponseHandler(
|
932 kumpf 1.14 CIMReferencesRequestMessage* request,
933 CIMReferencesResponseMessage* response,
934 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
935 : OperationResponseHandler(request, response, responseChunkCallback)
|
936 chip 1.7 {
937 }
938
|
939 kumpf 1.23 void ReferencesResponseHandler::deliver(const CIMObject& cimObject)
|
940 chip 1.7 {
|
941 kumpf 1.23 if (cimObject.isUninitialized())
|
942 chip 1.7 {
943 MessageLoaderParms message(
944 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
945 "The object is not initialized.");
946
947 throw CIMException(CIM_ERR_FAILED, message);
948 }
949
950 SimpleObjectResponseHandler::deliver(cimObject);
951 }
952
|
953 marek 1.33.2.3 void ReferencesResponseHandler::deliver(const SCMOInstance& scmoObject)
|
954 r.kieninger 1.33.2.2 {
|
955 marek 1.33.2.3 if (scmoObject.isUninitialized())
|
956 r.kieninger 1.33.2.2 {
957 MessageLoaderParms message(
958 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
959 "The object is not initialized.");
960
961 throw CIMException(CIM_ERR_FAILED, message);
962 }
|
963 marek 1.33.2.3 SimpleObjectResponseHandler::deliver(scmoObject);
|
964 r.kieninger 1.33.2.2 }
965
|
966 kumpf 1.23 String ReferencesResponseHandler::getClass() const
|
967 chip 1.7 {
|
968 kumpf 1.23 return String("ReferencesResponseHandler");
|
969 chip 1.7 }
970
|
971 kumpf 1.23 void ReferencesResponseHandler::transfer()
|
972 chip 1.7 {
|
973 kumpf 1.23 CIMReferencesResponseMessage& msg =
974 *static_cast<CIMReferencesResponseMessage*>(getResponse());
|
975 chip 1.7
|
976 marek 1.33.2.3 Array<CIMObject> cimObjs= getObjects();
977 Array<SCMOInstance> scmoObjs= getSCMOObjects();
978 if (cimObjs.size() != 0)
979 {
980 msg.getResponseData().setObjects(cimObjs);
981 }
982 if (scmoObjs.size() != 0)
983 {
984 msg.getResponseData().setSCMO(scmoObjs);
985 }
|
986 chip 1.7 }
987
988 //
989 // ReferenceNamesResponseHandler
990 //
991
992 ReferenceNamesResponseHandler::ReferenceNamesResponseHandler(
|
993 kumpf 1.14 CIMReferenceNamesRequestMessage* request,
994 CIMReferenceNamesResponseMessage* response,
995 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
996 : OperationResponseHandler(request, response, responseChunkCallback)
|
997 chip 1.7 {
998 }
999
|
1000 kumpf 1.23 void ReferenceNamesResponseHandler::deliver(const CIMObjectPath& cimObjectPath)
|
1001 chip 1.7 {
|
1002 kumpf 1.23 if (cimObjectPath.getClassName().isNull())
|
1003 chip 1.7 {
1004 MessageLoaderParms message(
1005 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
1006 "The object is not initialized.");
1007
1008 throw CIMException(CIM_ERR_FAILED, message);
1009 }
1010
1011 SimpleObjectPathResponseHandler::deliver(cimObjectPath);
1012 }
1013
|
1014 marek 1.33.2.3 void ReferenceNamesResponseHandler::deliver(const SCMOInstance& scmoObjectPath)
|
1015 r.kieninger 1.33.2.2 {
|
1016 marek 1.33.2.3 SimpleObjectPathResponseHandler::deliver(scmoObjectPath);
|
1017 r.kieninger 1.33.2.2 }
1018
|
1019 kumpf 1.23 String ReferenceNamesResponseHandler::getClass() const
|
1020 chip 1.7 {
|
1021 kumpf 1.23 return String("ReferenceNamesResponseHandler");
|
1022 chip 1.7 }
1023
|
1024 kumpf 1.23 void ReferenceNamesResponseHandler::transfer()
|
1025 chip 1.7 {
|
1026 kumpf 1.23 CIMReferenceNamesResponseMessage& msg =
1027 *static_cast<CIMReferenceNamesResponseMessage*>(getResponse());
|
1028 chip 1.7
|
1029 marek 1.33.2.3 Array<CIMObjectPath> cimObjs= getObjects();
1030 Array<SCMOInstance> scmoObjs= getSCMOObjects();
1031 if (cimObjs.size() != 0)
1032 {
1033 msg.getResponseData().setInstanceNames(cimObjs);
1034 }
1035 if (scmoObjs.size() != 0)
1036 {
1037 msg.getResponseData().setSCMO(scmoObjs);
1038 }
|
1039 chip 1.7 }
1040
1041 //
1042 // InvokeMethodResponseHandler
1043 //
1044
1045 InvokeMethodResponseHandler::InvokeMethodResponseHandler(
|
1046 kumpf 1.14 CIMInvokeMethodRequestMessage* request,
1047 CIMInvokeMethodResponseMessage* response,
1048 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
1049 : OperationResponseHandler(request, response, responseChunkCallback)
|
1050 chip 1.7 {
1051 }
1052
|
1053 kumpf 1.23 void InvokeMethodResponseHandler::deliverParamValue(
1054 const CIMParamValue& cimParamValue)
|
1055 chip 1.7 {
|
1056 kumpf 1.23 if (cimParamValue.isUninitialized())
|
1057 chip 1.7 {
1058 MessageLoaderParms message(
1059 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
1060 "The object is not initialized.");
1061
1062 throw CIMException(CIM_ERR_FAILED, message);
1063 }
1064
1065 SimpleMethodResultResponseHandler::deliverParamValue(cimParamValue);
1066 }
1067
|
1068 kumpf 1.23 void InvokeMethodResponseHandler::deliver(const CIMValue& cimValue)
|
1069 chip 1.7 {
|
1070 kumpf 1.23 if (cimValue.isNull())
|
1071 chip 1.7 {
1072 MessageLoaderParms message(
1073 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
1074 "The object is not initialized.");
1075
1076 throw CIMException(CIM_ERR_FAILED, message);
1077 }
1078
1079 SimpleMethodResultResponseHandler::deliver(cimValue);
1080 }
1081
|
1082 kumpf 1.23 String InvokeMethodResponseHandler::getClass() const
|
1083 chip 1.7 {
|
1084 kumpf 1.23 return String("InvokeMethodResponseHandler");
|
1085 chip 1.7 }
1086
|
1087 kumpf 1.23 void InvokeMethodResponseHandler::transfer()
|
1088 chip 1.7 {
|
1089 kumpf 1.23 CIMInvokeMethodResponseMessage& msg =
1090 *static_cast<CIMInvokeMethodResponseMessage*>(getResponse());
|
1091 chip 1.7
1092 msg.outParameters = getParamValues();
1093
1094 // ATTN-RK-20020903: Is it legal for the return value to be null?
1095 // if not, then the check must be done here since deliver() works off the
1096 // virtual size, which refers to out parameters!
1097 msg.retValue = getReturnValue();
1098 }
1099
1100 //
1101 // EnableIndicationsResponseHandler
1102 //
1103
1104 EnableIndicationsResponseHandler::EnableIndicationsResponseHandler(
|
1105 kumpf 1.14 CIMRequestMessage* request,
1106 CIMResponseMessage* response,
|
1107 kumpf 1.17 const CIMInstance& provider,
|
1108 kumpf 1.14 PEGASUS_INDICATION_CALLBACK_T indicationCallback,
1109 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
1110 : OperationResponseHandler(request, response, responseChunkCallback),
1111 _indicationCallback(indicationCallback)
|
1112 chip 1.7 {
1113 _provider = provider;
1114 }
1115
|
1116 kumpf 1.23 void EnableIndicationsResponseHandler::deliver(
1117 const CIMIndication& cimIndication)
|
1118 chip 1.7 {
1119 OperationContext context;
1120
1121 Array<CIMObjectPath> subscriptionInstanceNames;
1122
|
1123 kumpf 1.23 context.insert(
1124 SubscriptionInstanceNamesContainer(subscriptionInstanceNames));
|
1125 chip 1.7
1126 deliver(context, cimIndication);
1127 }
1128
|
1129 kumpf 1.23 void EnableIndicationsResponseHandler::deliver(
1130 const OperationContext& context,
1131 const CIMIndication& cimIndication)
|
1132 chip 1.7 {
|
1133 kumpf 1.23 if (cimIndication.isUninitialized())
|
1134 chip 1.7 {
1135 MessageLoaderParms message(
1136 "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
1137 "The object is not initialized.");
1138
1139 throw CIMException(CIM_ERR_FAILED, message);
1140 }
1141
1142 // ATTN: temporarily convert indication to instance
1143 CIMInstance cimInstance(cimIndication);
1144
1145 // Get list of subscription instance names from context
1146 Array<CIMObjectPath> subscriptionInstanceNames;
1147
|
1148 kumpf 1.23 if (context.contains(SubscriptionInstanceNamesContainer::NAME))
|
1149 chip 1.7 {
1150 SubscriptionInstanceNamesContainer container =
1151 context.get(SubscriptionInstanceNamesContainer::NAME);
1152
1153 subscriptionInstanceNames = container.getInstanceNames();
1154 }
|
1155 a.dunfey 1.16 else
|
1156 chip 1.7 {
1157 subscriptionInstanceNames.clear();
1158 }
1159
|
1160 kumpf 1.12 ContentLanguageList contentLangs;
|
1161 chip 1.7
|
1162 kumpf 1.23 if (context.contains(ContentLanguageListContainer::NAME))
|
1163 chip 1.7 {
1164 // Get the Content-Language for this indication. The provider
1165 // does not have to add specify a language for the indication.
1166 ContentLanguageListContainer langContainer =
1167 context.get(ContentLanguageListContainer::NAME);
1168
1169 contentLangs = langContainer.getLanguages();
1170 }
|
1171 a.dunfey 1.16 else
|
1172 chip 1.7 {
1173 // The provider did not explicitly set a Content-Language for
1174 // the indication. Fall back to the lang set in this object.
1175 contentLangs = getLanguages();
1176 }
1177
1178 // create message
|
1179 kumpf 1.23 CIMProcessIndicationRequestMessage* request =
|
1180 chip 1.7 new CIMProcessIndicationRequestMessage(
1181 XmlWriter::getNextMessageId(),
1182 cimInstance.getPath().getNameSpace(),
1183 cimInstance,
1184 subscriptionInstanceNames,
1185 _provider,
1186 QueueIdStack()); // Must be filled in by the callback function
1187
1188 request->operationContext = context;
1189
|
1190 kumpf 1.23 if (request->operationContext.contains(ContentLanguageListContainer::NAME))
|
1191 chip 1.7 {
|
1192 kumpf 1.23 request->operationContext.set(
1193 ContentLanguageListContainer(contentLangs));
|
1194 chip 1.7 }
|
1195 a.dunfey 1.16 else
|
1196 chip 1.7 {
|
1197 kumpf 1.23 request->operationContext.insert(
1198 ContentLanguageListContainer(contentLangs));
|
1199 chip 1.7 }
1200
1201 _indicationCallback(request);
1202 }
1203
|
1204 kumpf 1.23 void EnableIndicationsResponseHandler::deliver(
1205 const Array<CIMIndication>& cimIndications)
|
1206 chip 1.7 {
1207 OperationContext context;
1208
1209 deliver(context, cimIndications);
1210 }
1211
|
1212 kumpf 1.23 void EnableIndicationsResponseHandler::deliver(
1213 const OperationContext& context,
1214 const Array<CIMIndication>& cimIndications)
|
1215 chip 1.7 {
|
1216 kumpf 1.23 for (Uint32 i = 0, n = cimIndications.size(); i < n; i++)
|
1217 chip 1.7 {
1218 deliver(context, cimIndications[i]);
1219 }
1220 }
1221
|
1222 kumpf 1.23 String EnableIndicationsResponseHandler::getClass() const
|
1223 chip 1.7 {
|
1224 kumpf 1.23 return String("EnableIndicationsResponseHandler");
|
1225 chip 1.7 }
1226
|
1227 kumpf 1.23 Boolean EnableIndicationsResponseHandler::isAsync() const
|
1228 chip 1.7 {
|
1229 kumpf 1.23 return false;
|
1230 chip 1.7 }
1231
|
1232 schuur 1.1 PEGASUS_NAMESPACE_END
|