1 martin 1.3 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.4 //
|
3 martin 1.3 // 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.4 //
|
10 martin 1.3 // 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.4 //
|
17 martin 1.3 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.4 //
|
20 martin 1.3 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.4 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.3 // 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.4 //
|
28 martin 1.3 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #include <Pegasus/Common/StatisticalData.h>
33 #include "XmlWriter.h"
34 #include "BinaryCodec.h"
35 #include "CIMBuffer.h"
36 #include "StringConversion.h"
37 #include "Print.h"
38
39 #define ENABLE_VALIDATION
40
41 #if defined(_EQUAL)
42 # undef _EQUAL
43 #endif
44
45 #define _EQUAL(X, Y) (X.size() == (sizeof(Y)-1) && String::equalNoCase(X, Y))
46
47 // Header flags:
48 #define LOCAL_ONLY (1 << 0)
49 #define INCLUDE_QUALIFIERS (1 << 1)
50 mike 1.1 #define INCLUDE_CLASS_ORIGIN (1 << 2)
51 #define DEEP_INHERITANCE (1 << 3)
|
52 karl 1.12.2.1 #define CONTINUE_ON_ERROR (1 << 4)
|
53 mike 1.1
54 PEGASUS_NAMESPACE_BEGIN
55
56 //==============================================================================
57 //
58 // Local definitions:
59 //
60 //==============================================================================
61
62 static const Uint32 _MAGIC = 0xF00DFACE;
63 static const Uint32 _REVERSE_MAGIC = 0xCEFA0DF0;
64 static const Uint32 _VERSION = 1;
65 static const size_t _DEFAULT_CIM_BUFFER_SIZE = 16*1024;
66
67 enum Operation
68 {
69 OP_Invalid,
70 OP_GetClass,
71 OP_GetInstance,
72 OP_IndicationDelivery,
73 OP_DeleteClass,
74 mike 1.1 OP_DeleteInstance,
75 OP_CreateClass,
76 OP_CreateInstance,
77 OP_ModifyClass,
78 OP_ModifyInstance,
79 OP_EnumerateClasses,
80 OP_EnumerateClassNames,
81 OP_EnumerateInstances,
82 OP_EnumerateInstanceNames,
83 OP_ExecQuery,
84 OP_Associators,
85 OP_AssociatorNames,
86 OP_References,
87 OP_ReferenceNames,
88 OP_GetProperty,
89 OP_SetProperty,
90 OP_GetQualifier,
91 OP_SetQualifier,
92 OP_DeleteQualifier,
93 OP_EnumerateQualifiers,
94 OP_InvokeMethod,
|
95 karl 1.12.2.4 // EXP_PULL_BEGIN
|
96 karl 1.12.2.1 OP_OpenEnumerateInstances,
97 OP_OpenEnumerateInstancePaths,
98 OP_OpenReferenceInstances,
99 OP_OpenReferenceInstancePaths,
100 OP_OpenAssociatorInstances,
101 OP_OpenAssociatorInstancePaths,
102 OP_PullInstancesWithPath,
103 OP_PullInstancePaths,
104 OP_CloseEnumeration,
105 OP_EnumerationCount,
|
106 karl 1.12.2.4 // EXP_PULL_END
|
107 kumpf 1.2 OP_Count
|
108 mike 1.1 };
109
110 static Operation _NameToOp(const CIMName& name)
111 {
112 const String& s = name.getString();
113
114 switch (s[0])
115 {
116 case 'A':
117 if (_EQUAL(s, "Associators"))
118 return OP_Associators;
119 if (_EQUAL(s, "AssociatorNames"))
120 return OP_AssociatorNames;
121 break;
122 case 'C':
123 if (_EQUAL(s, "CreateInstance"))
124 return OP_CreateInstance;
125 if (_EQUAL(s, "CreateClass"))
126 return OP_CreateClass;
|
127 karl 1.12.2.4 //EXP_PULL_BEGIN
|
128 karl 1.12.2.1 if (_EQUAL(s, "CloseEnumeration"))
129 return OP_CloseEnumeration;
|
130 karl 1.12.2.4 // EXP_PULL_END
|
131 mike 1.1 break;
132 case 'D':
133 if (_EQUAL(s, "DeleteInstance"))
134 return OP_DeleteInstance;
135 if (_EQUAL(s, "DeleteClass"))
136 return OP_DeleteClass;
137 if (_EQUAL(s, "DeleteQualifier"))
138 return OP_DeleteQualifier;
139 break;
140 case 'E':
141 if (_EQUAL(s, "EnumerateInstances"))
142 return OP_EnumerateInstances;
143 if (_EQUAL(s, "EnumerateInstanceNames"))
144 return OP_EnumerateInstanceNames;
145 if (_EQUAL(s, "ExecQuery"))
146 return OP_ExecQuery;
147 if (_EQUAL(s, "EnumerateClassNames"))
148 return OP_EnumerateClassNames;
149 if (_EQUAL(s, "EnumerateClasses"))
150 return OP_EnumerateClasses;
151 if (_EQUAL(s, "EnumerateQualifiers"))
152 mike 1.1 return OP_EnumerateQualifiers;
153 break;
154 case 'G':
155 if (_EQUAL(s, "GetInstance"))
156 return OP_GetInstance;
157 if (_EQUAL(s, "GetClass"))
158 return OP_GetClass;
159 if (_EQUAL(s, "GetQualifier"))
160 return OP_GetQualifier;
161 if (_EQUAL(s, "GetProperty"))
162 return OP_GetProperty;
163 break;
164 case 'I':
165 if (_EQUAL(s, "InvokeMethod"))
166 return OP_InvokeMethod;
167 if (_EQUAL(s, "IndicationDelivery"))
168 return OP_IndicationDelivery;
169 break;
170 case 'M':
171 if (_EQUAL(s, "ModifyInstance"))
172 return OP_ModifyInstance;
173 mike 1.1 if (_EQUAL(s, "ModifyClass"))
174 return OP_ModifyClass;
175 break;
|
176 karl 1.12.2.4 // EXP_PULL_BEGIN
|
177 karl 1.12.2.1 case 'O':
178 if (_EQUAL(s, "OpenEnumerateInstances"))
179 return OP_OpenEnumerateInstances;
180 if (_EQUAL(s, "OpenEnumerateInstancePaths"))
181 return OP_OpenEnumerateInstancePaths;
182 if (_EQUAL(s, "OpenReferenceInstances"))
183 return OP_OpenReferenceInstances;
184 if (_EQUAL(s, "OpenReferenceInstancePaths"))
185 return OP_OpenReferenceInstancePaths;
186 if (_EQUAL(s, "OpenAssociatorInstances"))
187 return OP_OpenAssociatorInstances;
188 if (_EQUAL(s, "OpenAssociatorInstancePaths"))
189 return OP_OpenAssociatorInstancePaths;
190 break;
191 case 'P':
192 if (_EQUAL(s, "PullInstancesWithPath"))
193 return OP_PullInstancesWithPath;
194 if (_EQUAL(s, "PullInstancePaths"))
195 return OP_PullInstancePaths;
196 break;
|
197 karl 1.12.2.4 // EXP_PULL_END
|
198 mike 1.1 case 'R':
199 if (_EQUAL(s, "References"))
200 return OP_References;
201 if (_EQUAL(s, "ReferenceNames"))
202 return OP_ReferenceNames;
203 break;
204 case 'S':
205 if (_EQUAL(s, "SetQualifier"))
206 return OP_SetQualifier;
207 if (_EQUAL(s, "SetProperty"))
208 return OP_SetProperty;
209 break;
210 }
211
212 // Unknown, se we will assume it is an extrinsic method!
213 return OP_InvokeMethod;
214 }
215
216 static void _putHeader(
217 CIMBuffer& out,
218 Uint32 flags,
219 mike 1.1 const String& messageId,
220 Operation operation)
221 {
222 // [MAGIC]
223 out.putUint32(_MAGIC);
224
225 // [VERSION]
226 out.putUint32(_VERSION);
227
228 // [FLAGS]
229 out.putUint32(flags);
230
231 // [MESSAGEID]
232 out.putString(messageId);
233
234 // [OPERATION]
235 out.putUint32(operation);
236 }
237
238 static bool _getHeader(
239 CIMBuffer& in,
240 mike 1.1 Uint32& flags,
241 String& messageId,
242 Operation& operation_)
243 {
244 Uint32 magic;
245 Uint32 version;
246
247 // [MAGIC]
248 if (!in.getUint32(magic))
249 return false;
250
251 if (magic != _MAGIC)
252 {
253 if (magic != _REVERSE_MAGIC)
254 return false;
255
256 // Sender has opposite endianess so turn on endian swapping:
257 in.setSwap(true);
258 }
259
260 // [VERSION]
261 mike 1.1 if (!in.getUint32(version) || version != _VERSION)
262 return false;
263
264 // [FLAGS]
265 if (!in.getUint32(flags))
266 return false;
267
268 // [MESSAGEID]
269 if (!in.getString(messageId))
270 return false;
271
272 // [OPERATION]
273 {
274 Uint32 op;
275
276 if (!in.getUint32(op) || op == OP_Invalid || op >= OP_Count)
277 return false;
278
279 operation_ = Operation(op);
280 }
281
282 mike 1.1 return true;
283 }
284
285 //==============================================================================
286 //
287 // EnumerateInstances
288 //
289 //==============================================================================
290
291 static void _encodeEnumerateInstancesRequest(
292 CIMBuffer& buf,
293 CIMEnumerateInstancesRequestMessage* msg,
294 CIMName& name)
295 {
296 /* See ../Client/CIMOperationRequestEncoder.cpp */
297
298 static const CIMName NAME("EnumerateInstances");
299 name = NAME;
300
301 // [HEADER]
302
303 mike 1.1 Uint32 flags = 0;
304
305 if (msg->deepInheritance)
306 flags |= DEEP_INHERITANCE;
307
308 if (msg->includeQualifiers)
309 flags |= INCLUDE_QUALIFIERS;
310
311 if (msg->includeClassOrigin)
312 flags |= INCLUDE_CLASS_ORIGIN;
313
314 _putHeader(buf, flags, msg->messageId, OP_EnumerateInstances);
315
316 // [NAMESPACE]
317 buf.putNamespaceName(msg->nameSpace);
318
319 // [CLASSNAME]
320 buf.putName(msg->className);
321
322 // [PROPERTY-LIST]
323 buf.putPropertyList(msg->propertyList);
324 mike 1.1 }
325
326 static CIMEnumerateInstancesRequestMessage* _decodeEnumerateInstancesRequest(
327 CIMBuffer& in,
328 Uint32 queueId,
329 Uint32 returnQueueId,
330 Uint32 flags,
331 const String& messageId)
332 {
333 /* See ../Server/CIMOperationRequestDecoder.cpp */
334
335 STAT_GETSTARTTIME
336
337 Boolean deepInheritance = flags & DEEP_INHERITANCE;
|
338 karl 1.12.2.5 #ifndef PEGASUS_DISABLE_INSTANCE_QUALIFIERS
|
339 mike 1.1 Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;
|
340 karl 1.12.2.5 #endif
|
341 mike 1.1 Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
342
343 // [NAMESPACE]
344
345 CIMNamespaceName nameSpace;
346
347 if (!in.getNamespaceName(nameSpace))
348 return 0;
349
350 // [CLASSNAME]
351 CIMName className;
352
353 if (!in.getName(className))
354 return 0;
355
356 // [PROPERTY-LIST]
357 CIMPropertyList propertyList;
358 if (!in.getPropertyList(propertyList))
359 return 0;
360
361 AutoPtr<CIMEnumerateInstancesRequestMessage> request(
362 mike 1.1 new CIMEnumerateInstancesRequestMessage(
363 messageId,
364 nameSpace,
365 className,
366 deepInheritance,
367 #ifdef PEGASUS_DISABLE_INSTANCE_QUALIFIERS
368 false,
369 #else
370 includeQualifiers,
371 #endif
372 includeClassOrigin,
373 propertyList,
374 QueueIdStack(queueId, returnQueueId)));
375
376 request->binaryRequest = true;
377
378 STAT_SERVERSTART
379
380 return request.release();
381 }
382
383 mike 1.1 static void _encodeEnumerateInstancesResponseBody(
384 CIMBuffer& out,
|
385 thilo.boehm 1.10 CIMResponseData& data,
|
386 karl 1.12.2.3 CIMName& name,
387 bool isFirst)
|
388 mike 1.1 {
389 /* See ../Server/CIMOperationResponseEncoder.cpp */
390
391 static const CIMName NAME("EnumerateInstances");
392 name = NAME;
393
|
394 karl 1.12.2.3 // Only write the property list on the first provider response
395 if (isFirst)
396 {
397 // [PROPERTY-LIST]
398 out.putPropertyList(data.getPropertyList());
399 }
|
400 r.kieninger 1.8 data.encodeBinaryResponse(out);
|
401 mike 1.1 }
402
403 static CIMEnumerateInstancesResponseMessage* _decodeEnumerateInstancesResponse(
404 CIMBuffer& in,
405 const String& messageId)
406 {
407 CIMEnumerateInstancesResponseMessage* msg;
408 CIMException cimException;
409
410 msg = new CIMEnumerateInstancesResponseMessage(
411 messageId,
412 cimException,
413 QueueIdStack());
414
|
415 karl 1.12.2.1 // Instead of resolving the binary data here, we delegate this
|
416 r.kieninger 1.9 // to a later point in time when the data is actually retrieved through
|
417 karl 1.12.2.1 // a call to CIMResponseData::getInstances, which
418 // resolves the binary data as it is passed to the next interface.
|
419 r.kieninger 1.9 // This allows an alternate client implementation to gain direct access
420 // to the binary data and pass this for example to the JNI implementation
421 // of the JSR48 CIM Client for Java.
|
422 thilo.boehm 1.10 CIMResponseData& responseData = msg->getResponseData();
|
423 karl 1.12.2.3
424 // [PROPERTY-LIST]
425 CIMPropertyList propertyList;
426 if (!in.getPropertyList(propertyList))
427 {
428 return 0;
429 }
430 responseData.setPropertyList(propertyList);
431
|
432 karl 1.12 responseData.setRemainingBinaryData(in);
|
433 r.kieninger 1.9
434 msg->binaryRequest=true;
|
435 mike 1.1 return msg;
436 }
437
438 //==============================================================================
439 //
440 // EnumerateInstanceNames
441 //
442 //==============================================================================
443
|
444 kumpf 1.6 static CIMEnumerateInstanceNamesRequestMessage*
|
445 mike 1.1 _decodeEnumerateInstanceNamesRequest(
446 CIMBuffer& in,
447 Uint32 queueId,
448 Uint32 returnQueueId,
449 const String& messageId)
450 {
451 STAT_GETSTARTTIME
452
453 // [NAMESPACE]
454 CIMNamespaceName nameSpace;
455
456 if (!in.getNamespaceName(nameSpace))
457 return 0;
458
459 // [CLASSNAME]
460 CIMName className;
461
462 if (!in.getName(className))
463 return 0;
464
465 AutoPtr<CIMEnumerateInstanceNamesRequestMessage> request(
466 mike 1.1 new CIMEnumerateInstanceNamesRequestMessage(
467 messageId,
468 nameSpace,
469 className,
470 QueueIdStack(queueId, returnQueueId)));
471
472 request->binaryRequest = true;
473
474 STAT_SERVERSTART
475
476 return request.release();
477 }
478
|
479 kumpf 1.6 static CIMEnumerateInstanceNamesResponseMessage*
|
480 mike 1.1 _decodeEnumerateInstanceNamesResponse(
481 CIMBuffer& in,
482 const String& messageId)
483 {
484 CIMEnumerateInstanceNamesResponseMessage* msg;
485 CIMException cimException;
486
487 msg = new CIMEnumerateInstanceNamesResponseMessage(
488 messageId,
489 cimException,
|
490 thilo.boehm 1.10 QueueIdStack());
491
|
492 karl 1.12.2.1 // Instead of resolving the binary data here, we delegate this
|
493 thilo.boehm 1.10 // to a later point in time when the data is actually retrieved through
|
494 karl 1.12.2.1 // a call to CIMResponseData::getInstanceNames, which
495 // resolves the binary data as it is passed to the next interface.
|
496 thilo.boehm 1.10 // This allows an alternate client implementation to gain direct access
497 // to the binary data and pass this for example to the JNI implementation
498 // of the JSR48 CIM Client for Java.
499 CIMResponseData& responseData = msg->getResponseData();
|
500 karl 1.12 responseData.setRemainingBinaryData(in);
|
501 mike 1.1
502 msg->binaryRequest = true;
503 return msg;
504 }
505
506 static void _encodeEnumerateInstanceNamesRequest(
507 CIMBuffer& buf,
508 CIMEnumerateInstanceNamesRequestMessage* msg,
509 CIMName& name)
510 {
511 static const CIMName NAME("EnumerateInstanceNames");
512 name = NAME;
513
514 // [HEADER]
515
516 _putHeader(buf, 0, msg->messageId, OP_EnumerateInstanceNames);
517
518 // [NAMESPACE]
519 buf.putNamespaceName(msg->nameSpace);
520
521 // [CLASSNAME]
522 mike 1.1 buf.putName(msg->className);
523 }
524
525 static void _encodeEnumerateInstanceNamesResponseBody(
526 CIMBuffer& out,
|
527 thilo.boehm 1.10 CIMResponseData& data,
|
528 mike 1.1 CIMName& name)
529 {
530 static const CIMName NAME("EnumerateInstanceNames");
531 name = NAME;
532
|
533 thilo.boehm 1.10 data.encodeBinaryResponse(out);
|
534 mike 1.1 }
535
536 //==============================================================================
537 //
538 // GetInstance
539 //
540 //==============================================================================
541
542 static CIMGetInstanceRequestMessage* _decodeGetInstanceRequest(
543 CIMBuffer& in,
544 Uint32 queueId,
545 Uint32 returnQueueId,
546 Uint32 flags,
547 const String& messageId)
548 {
549 STAT_GETSTARTTIME
550
551 // [FLAGS]
|
552 karl 1.12.2.5 #ifndef PEGASUS_DISABLE_INSTANCE_QUALIFIERS
|
553 mike 1.1 Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;
|
554 karl 1.12.2.5 #endif
|
555 mike 1.1 Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
556
557 // [NAMESPACE]
558 CIMNamespaceName nameSpace;
559
560 if (!in.getNamespaceName(nameSpace))
561 return 0;
562
563 // [INSTANCE-NAME]
564 CIMObjectPath instanceName;
565
566 if (!in.getObjectPath(instanceName))
567 return 0;
568
569 // [PROPERTY-LIST]
570 CIMPropertyList propertyList;
571 if (!in.getPropertyList(propertyList))
572 return 0;
573
574 AutoPtr<CIMGetInstanceRequestMessage> request(
575 new CIMGetInstanceRequestMessage(
576 mike 1.1 messageId,
577 nameSpace,
578 instanceName,
579 #ifdef PEGASUS_DISABLE_INSTANCE_QUALIFIERS
580 false,
581 #else
582 includeQualifiers,
583 #endif
584 includeClassOrigin,
585 propertyList,
586 QueueIdStack(queueId, returnQueueId)));
587
588 request->binaryRequest = true;
589
590 STAT_SERVERSTART
591
592 return request.release();
593 }
594
595 static CIMGetInstanceResponseMessage* _decodeGetInstanceResponse(
596 CIMBuffer& in,
597 mike 1.1 const String& messageId)
598 {
599 CIMGetInstanceResponseMessage* msg;
600 CIMException cimException;
601
602 msg = new CIMGetInstanceResponseMessage(
603 messageId,
604 cimException,
605 QueueIdStack());
606
|
607 karl 1.12.2.1 // Instead of resolving the binary data here, we delegate this
|
608 r.kieninger 1.9 // to a later point in time when the data is actually retrieved through
|
609 karl 1.12.2.1 // a call to CIMResponseData::getInstances, which
610 // resolves the binary data as it is passed to the next interface.
|
611 r.kieninger 1.9 // This allows an alternate client implementation to gain direct access
612 // to the binary data and pass this for example to the JNI implementation
613 // of the JSR48 CIM Client for Java.
|
614 thilo.boehm 1.10 CIMResponseData& responseData = msg->getResponseData();
|
615 karl 1.12 responseData.setRemainingBinaryData(in);
|
616 r.kieninger 1.9
|
617 mike 1.1 msg->binaryRequest = true;
618 return msg;
619 }
620
621 static void _encodeGetInstanceRequest(
622 CIMBuffer& buf,
623 CIMGetInstanceRequestMessage* msg,
624 CIMName& name)
625 {
626 static const CIMName NAME("GetInstance");
627 name = NAME;
628
629 // [HEADER]
630
631 Uint32 flags = 0;
632
633 if (msg->includeQualifiers)
634 flags |= INCLUDE_QUALIFIERS;
635
636 if (msg->includeClassOrigin)
637 flags |= INCLUDE_CLASS_ORIGIN;
638 mike 1.1
639 _putHeader(buf, flags, msg->messageId, OP_GetInstance);
640
641 // [NAMESPACE]
642 buf.putNamespaceName(msg->nameSpace);
643
644 // [INSTANCE-NAME]
645 buf.putObjectPath(msg->instanceName);
646
647 // [PROPERTY-LIST]
648 buf.putPropertyList(msg->propertyList);
649 }
650
651 static void _encodeGetInstanceResponseBody(
652 CIMBuffer& out,
|
653 thilo.boehm 1.10 CIMResponseData& data,
|
654 mike 1.1 CIMName& name)
655 {
656 static const CIMName NAME("GetInstance");
657 name = NAME;
658
|
659 r.kieninger 1.8 data.encodeBinaryResponse(out);
|
660 mike 1.1 }
661
662 //==============================================================================
663 //
664 // CreateInstance
665 //
666 //==============================================================================
667
668 static void _encodeCreateInstanceRequest(
669 CIMBuffer& buf,
670 CIMCreateInstanceRequestMessage* msg,
671 CIMName& name)
672 {
673 static const CIMName NAME("CreateInstance");
674 name = NAME;
675
676 // [HEADER]
677 _putHeader(buf, 0, msg->messageId, OP_CreateInstance);
678
679 // [NAMESPACE]
680 buf.putNamespaceName(msg->nameSpace);
681 mike 1.1
682 // [NEW-INSTANCE]
683 buf.putInstance(msg->newInstance, false);
684 }
685
686 static CIMCreateInstanceRequestMessage* _decodeCreateInstanceRequest(
687 CIMBuffer& in,
688 Uint32 queueId,
689 Uint32 returnQueueId,
690 const String& messageId)
691 {
692 STAT_GETSTARTTIME
693
694 // [NAMESPACE]
695
696 CIMNamespaceName nameSpace;
697
698 if (!in.getNamespaceName(nameSpace))
699 return 0;
700
701 // [NEW-INSTANCE]
702 mike 1.1
703 CIMInstance newInstance;
704
705 if (!in.getInstance(newInstance))
706 return 0;
707
708 AutoPtr<CIMCreateInstanceRequestMessage> request(
709 new CIMCreateInstanceRequestMessage(
710 messageId,
711 nameSpace,
712 newInstance,
713 QueueIdStack(queueId, returnQueueId)));
714
715 request->binaryRequest = true;
716
717 STAT_SERVERSTART
718
719 return request.release();
720 }
721
722 static void _encodeCreateInstanceResponseBody(
723 mike 1.1 CIMBuffer& out,
724 CIMCreateInstanceResponseMessage* msg,
725 CIMName& name)
726 {
727 static const CIMName NAME("CreateInstance");
728 name = NAME;
729
730 out.putObjectPath(msg->instanceName, false);
731 }
732
733 static CIMCreateInstanceResponseMessage* _decodeCreateInstanceResponse(
734 CIMBuffer& in,
735 const String& messageId)
736 {
737 CIMObjectPath instanceName;
738
739 if (!in.getObjectPath(instanceName))
740 return 0;
741
742 CIMCreateInstanceResponseMessage* msg;
743 CIMException cimException;
744 mike 1.1
745 msg = new CIMCreateInstanceResponseMessage(
746 messageId,
747 cimException,
748 QueueIdStack(),
749 instanceName);
750
751 msg->binaryRequest = true;
752
753 return msg;
754 }
755
756 //==============================================================================
757 //
758 // ModifyInstance
759 //
760 //==============================================================================
761
762 static void _encodeModifyInstanceRequest(
763 CIMBuffer& buf,
764 CIMModifyInstanceRequestMessage* msg,
765 mike 1.1 CIMName& name)
766 {
767 /* See ../Client/CIMOperationRequestEncoder.cpp */
768
769 static const CIMName NAME("ModifyInstance");
770 name = NAME;
771
772 // [HEADER]
773
774 Uint32 flags = 0;
775
776 if (msg->includeQualifiers)
777 flags |= INCLUDE_QUALIFIERS;
778
779 _putHeader(buf, flags, msg->messageId, OP_ModifyInstance);
780
781 // [NAMESPACE]
782 buf.putNamespaceName(msg->nameSpace);
783
784 // [MODIFIED-INSTANCE]
785 buf.putInstance(msg->modifiedInstance, false);
786 mike 1.1
787 // [PROPERTY-LIST]
788 buf.putPropertyList(msg->propertyList);
789 }
790
791 static CIMModifyInstanceRequestMessage* _decodeModifyInstanceRequest(
792 CIMBuffer& in,
793 Uint32 queueId,
794 Uint32 returnQueueId,
795 Uint32 flags,
796 const String& messageId)
797 {
798 /* See ../Server/CIMOperationRequestDecoder.cpp */
799
800 STAT_GETSTARTTIME
801
802 Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;
803
804 // [NAMESPACE]
805
806 CIMNamespaceName nameSpace;
807 mike 1.1
808 if (!in.getNamespaceName(nameSpace))
809 return 0;
810
811 // [MODIFIED-INSTANCE]
812 CIMInstance modifiedInstance;
813
814 if (!in.getInstance(modifiedInstance))
815 return 0;
816
817 // [PROPERTY-LIST]
818 CIMPropertyList propertyList;
819 if (!in.getPropertyList(propertyList))
820 return 0;
821
822 AutoPtr<CIMModifyInstanceRequestMessage> request(
823 new CIMModifyInstanceRequestMessage(
824 messageId,
825 nameSpace,
826 modifiedInstance,
827 includeQualifiers,
828 mike 1.1 propertyList,
829 QueueIdStack(queueId, returnQueueId)));
830
831 request->binaryRequest = true;
832
833 STAT_SERVERSTART
834
835 return request.release();
836 }
837
838 static void _encodeModifyInstanceResponseBody(
839 CIMName& name)
840 {
841 /* See ../Server/CIMOperationResponseEncoder.cpp */
842
843 static const CIMName NAME("ModifyInstance");
844 name = NAME;
845 }
846
847 static CIMModifyInstanceResponseMessage* _decodeModifyInstanceResponse(
848 CIMBuffer& in,
849 mike 1.1 const String& messageId)
850 {
851 /* See ../Client/CIMOperationResponseDecoder.cpp */
852
853 Array<CIMInstance> instances;
854
855 while (in.more())
856 {
857 Array<CIMInstance> tmp;
858
859 if (!in.getInstanceA(tmp))
860 return 0;
861
862 instances.append(tmp.getData(), tmp.size());
863 }
864
865 CIMModifyInstanceResponseMessage* msg;
866 CIMException cimException;
867
868 msg = new CIMModifyInstanceResponseMessage(
869 messageId,
870 mike 1.1 cimException,
871 QueueIdStack());
872
873 msg->binaryRequest = true;
874 return msg;
875 }
876
877 //==============================================================================
878 //
879 // DeleteInstance
880 //
881 //==============================================================================
882
883 static void _encodeDeleteInstanceRequest(
884 CIMBuffer& buf,
885 CIMDeleteInstanceRequestMessage* msg,
886 CIMName& name)
887 {
888 /* See ../Client/CIMOperationRequestEncoder.cpp */
889
890 static const CIMName NAME("DeleteInstance");
891 mike 1.1 name = NAME;
892
893 // [HEADER]
894 _putHeader(buf, 0, msg->messageId, OP_DeleteInstance);
895
896 // [NAMESPACE]
897 buf.putNamespaceName(msg->nameSpace);
898
899 // [INSTANCE-NAME]
900 buf.putObjectPath(msg->instanceName, false);
901 }
902
903 static CIMDeleteInstanceRequestMessage* _decodeDeleteInstanceRequest(
904 CIMBuffer& in,
905 Uint32 queueId,
906 Uint32 returnQueueId,
907 const String& messageId)
908 {
909 /* See ../Server/CIMOperationRequestDecoder.cpp */
910
911 STAT_GETSTARTTIME
912 mike 1.1
913 // [NAMESPACE]
914 CIMNamespaceName nameSpace;
915
916 if (!in.getNamespaceName(nameSpace))
917 return 0;
918
919 // [INSTANCE-NAME]
920 CIMObjectPath instanceName;
921
922 if (!in.getObjectPath(instanceName))
923 return 0;
924
925 AutoPtr<CIMDeleteInstanceRequestMessage> request(
926 new CIMDeleteInstanceRequestMessage(
927 messageId,
928 nameSpace,
929 instanceName,
930 QueueIdStack(queueId, returnQueueId)));
931
932 request->binaryRequest = true;
933 mike 1.1
934 STAT_SERVERSTART
935
936 return request.release();
937 }
938
939 static void _encodeDeleteInstanceResponseBody(
940 CIMName& name)
941 {
942 /* See ../Server/CIMOperationResponseEncoder.cpp */
943
944 static const CIMName NAME("DeleteInstance");
945 name = NAME;
946 }
947
948 static CIMDeleteInstanceResponseMessage* _decodeDeleteInstanceResponse(
949 const String& messageId)
950 {
951 /* See ../Client/CIMOperationResponseDecoder.cpp */
952
953 CIMDeleteInstanceResponseMessage* msg;
954 mike 1.1 CIMException cimException;
955
956 msg = new CIMDeleteInstanceResponseMessage(
957 messageId,
958 cimException,
959 QueueIdStack());
960
961 msg->binaryRequest = true;
962 return msg;
963 }
964
965 //==============================================================================
966 //
967 // Associators
968 //
969 //==============================================================================
970
971 static void _encodeAssociatorsRequest(
972 CIMBuffer& buf,
973 CIMAssociatorsRequestMessage* msg,
974 CIMName& name)
975 mike 1.1 {
976 /* See ../Client/CIMOperationRequestEncoder.cpp */
977
978 static const CIMName NAME("Associators");
979 name = NAME;
980
981 // [HEADER]
982
983 Uint32 flags = 0;
984
985 if (msg->includeQualifiers)
986 flags |= INCLUDE_QUALIFIERS;
987
988 if (msg->includeClassOrigin)
989 flags |= INCLUDE_CLASS_ORIGIN;
990
991 _putHeader(buf, flags, msg->messageId, OP_Associators);
992
993 // [NAMESPACE]
994 buf.putNamespaceName(msg->nameSpace);
995
996 mike 1.1 // [OBJECT-NAME]
997 buf.putObjectPath(msg->objectName);
998
999 // [ASSOC-CLASS]
1000 buf.putName(msg->assocClass);
1001
1002 // [RESULT-CLASS]
1003 buf.putName(msg->resultClass);
1004
1005 // [ROLE]
1006 buf.putString(msg->role);
1007
1008 // [RESULT-ROLE]
1009 buf.putString(msg->resultRole);
1010
1011 // [PROPERTY-LIST]
1012 buf.putPropertyList(msg->propertyList);
1013 }
1014
1015 static CIMAssociatorsRequestMessage* _decodeAssociatorsRequest(
1016 CIMBuffer& in,
1017 mike 1.1 Uint32 queueId,
1018 Uint32 returnQueueId,
1019 Uint32 flags,
1020 const String& messageId)
1021 {
1022 /* See ../Server/CIMOperationRequestDecoder.cpp */
1023
1024 STAT_GETSTARTTIME
1025
1026 Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;
1027 Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
1028
1029 // [NAMESPACE]
1030
1031 CIMNamespaceName nameSpace;
1032
1033 if (!in.getNamespaceName(nameSpace))
1034 return 0;
1035
1036 // [OBJECT-NAME]
1037 CIMObjectPath objectName;
1038 mike 1.1
1039 if (!in.getObjectPath(objectName))
1040 return 0;
1041
1042 // [ASSOC-CLASS]
1043
1044 CIMName assocClass;
1045
1046 if (!in.getName(assocClass))
1047 return 0;
1048
1049 // [RESULT-CLASS]
1050
1051 CIMName resultClass;
1052
1053 if (!in.getName(resultClass))
1054 return 0;
1055
1056 // [ROLE]
1057
1058 String role;
1059 mike 1.1
1060 if (!in.getString(role))
1061 return 0;
1062
1063 // [RESULT-ROLE]
1064
1065 String resultRole;
1066
1067 if (!in.getString(resultRole))
1068 return 0;
1069
1070 // [PROPERTY-LIST]
1071
1072 CIMPropertyList propertyList;
1073
1074 if (!in.getPropertyList(propertyList))
1075 return 0;
1076
1077 AutoPtr<CIMAssociatorsRequestMessage> request(
1078 new CIMAssociatorsRequestMessage(
1079 messageId,
1080 mike 1.1 nameSpace,
1081 objectName,
1082 assocClass,
1083 resultClass,
1084 role,
1085 resultRole,
1086 includeQualifiers,
1087 includeClassOrigin,
1088 propertyList,
1089 QueueIdStack(queueId, returnQueueId)));
1090
1091 request->binaryRequest = true;
1092
1093 STAT_SERVERSTART
1094
1095 return request.release();
1096 }
1097
1098 static void _encodeAssociatorsResponseBody(
1099 CIMBuffer& out,
|
1100 thilo.boehm 1.10 CIMResponseData& data,
|
1101 mike 1.1 CIMName& name)
1102 {
1103 /* See ../Server/CIMOperationResponseEncoder.cpp */
1104
1105 static const CIMName NAME("Associators");
1106 name = NAME;
1107
|
1108 r.kieninger 1.8
1109 data.encodeBinaryResponse(out);
|
1110 mike 1.1 }
1111
1112 static CIMAssociatorsResponseMessage* _decodeAssociatorsResponse(
1113 CIMBuffer& in,
1114 const String& messageId)
1115 {
1116 CIMAssociatorsResponseMessage* msg;
1117 CIMException cimException;
1118
1119 msg = new CIMAssociatorsResponseMessage(
1120 messageId,
1121 cimException,
|
1122 r.kieninger 1.8 QueueIdStack());
|
1123 mike 1.1
|
1124 karl 1.12.2.1 // Instead of resolving the binary data here, we delegate this
|
1125 r.kieninger 1.9 // to a later point in time when the data is actually retrieved through
|
1126 karl 1.12.2.1 // a call to CIMResponseData::getObjects, which
1127 // resolves the binary data as it is passed to the next interface.
|
1128 r.kieninger 1.9 // This allows an alternate client implementation to gain direct access
1129 // to the binary data and pass this for example to the JNI implementation
1130 // of the JSR48 CIM Client for Java.
|
1131 thilo.boehm 1.10 CIMResponseData& responseData = msg->getResponseData();
|
1132 karl 1.12 responseData.setRemainingBinaryData(in);
|
1133 r.kieninger 1.9
|
1134 mike 1.1 msg->binaryRequest = true;
1135 return msg;
1136 }
1137
1138 //==============================================================================
1139 //
1140 // AssociatorNames
1141 //
1142 //==============================================================================
1143
1144 static void _encodeAssociatorNamesRequest(
1145 CIMBuffer& buf,
1146 CIMAssociatorNamesRequestMessage* msg,
1147 CIMName& name)
1148 {
1149 /* See ../Client/CIMOperationRequestEncoder.cpp */
1150
1151 static const CIMName NAME("AssociatorNames");
1152 name = NAME;
1153
1154 // [HEADER]
1155 mike 1.1 Uint32 flags = 0;
1156
1157 _putHeader(buf, flags, msg->messageId, OP_AssociatorNames);
1158
1159 // [NAMESPACE]
1160 buf.putNamespaceName(msg->nameSpace);
1161
1162 // [OBJECT-NAME]
1163 buf.putObjectPath(msg->objectName);
1164
1165 // [ASSOC-CLASS]
1166 buf.putName(msg->assocClass);
1167
1168 // [RESULT-CLASS]
1169 buf.putName(msg->resultClass);
1170
1171 // [ROLE]
1172 buf.putString(msg->role);
1173
1174 // [RESULT-ROLE]
1175 buf.putString(msg->resultRole);
1176 mike 1.1 }
1177
1178 static CIMAssociatorNamesRequestMessage* _decodeAssociatorNamesRequest(
1179 CIMBuffer& in,
1180 Uint32 queueId,
1181 Uint32 returnQueueId,
1182 const String& messageId)
1183 {
1184 /* See ../Server/CIMOperationRequestDecoder.cpp */
1185
1186 STAT_GETSTARTTIME
1187
1188 // [NAMESPACE]
1189
1190 CIMNamespaceName nameSpace;
1191
1192 if (!in.getNamespaceName(nameSpace))
1193 return 0;
1194
1195 // [OBJECT-NAME]
1196 CIMObjectPath objectName;
1197 mike 1.1
1198 if (!in.getObjectPath(objectName))
1199 return 0;
1200
1201 // [ASSOC-CLASS]
1202
1203 CIMName assocClass;
1204
1205 if (!in.getName(assocClass))
1206 return 0;
1207
1208 // [RESULT-CLASS]
1209
1210 CIMName resultClass;
1211
1212 if (!in.getName(resultClass))
1213 return 0;
1214
1215 // [ROLE]
1216
1217 String role;
1218 mike 1.1
1219 if (!in.getString(role))
1220 return 0;
1221
1222 // [RESULT-ROLE]
1223
1224 String resultRole;
1225
1226 if (!in.getString(resultRole))
1227 return 0;
1228
1229 AutoPtr<CIMAssociatorNamesRequestMessage> request(
1230 new CIMAssociatorNamesRequestMessage(
1231 messageId,
1232 nameSpace,
1233 objectName,
1234 assocClass,
1235 resultClass,
1236 role,
1237 resultRole,
1238 QueueIdStack(queueId, returnQueueId)));
1239 mike 1.1
1240 request->binaryRequest = true;
1241
1242 STAT_SERVERSTART
1243
1244 return request.release();
1245 }
1246
1247 static void _encodeAssociatorNamesResponseBody(
1248 CIMBuffer& out,
|
1249 thilo.boehm 1.10 CIMResponseData& data,
|
1250 mike 1.1 CIMName& name)
1251 {
1252 /* See ../Server/CIMOperationResponseEncoder.cpp */
1253
1254 static const CIMName NAME("AssociatorNames");
1255 name = NAME;
|
1256 thilo.boehm 1.10 data.encodeBinaryResponse(out);
|
1257 mike 1.1 }
1258
1259 static CIMAssociatorNamesResponseMessage* _decodeAssociatorNamesResponse(
1260 CIMBuffer& in,
1261 const String& messageId)
1262 {
1263 CIMAssociatorNamesResponseMessage* msg;
1264 CIMException cimException;
1265
1266 msg = new CIMAssociatorNamesResponseMessage(
1267 messageId,
1268 cimException,
|
1269 thilo.boehm 1.10 QueueIdStack());
1270
|
1271 karl 1.12.2.1 // Instead of resolving the binary data here, we delegate this
|
1272 thilo.boehm 1.10 // to a later point in time when the data is actually retrieved through
|
1273 karl 1.12.2.1 // a call to CIMResponseData::getInstanceNames, which
1274 // resolves the binary data as it is passed to the next interface.
|
1275 thilo.boehm 1.10 // This allows an alternate client implementation to gain direct access
1276 // to the binary data and pass this for example to the JNI implementation
1277 // of the JSR48 CIM Client for Java.
1278 CIMResponseData& responseData = msg->getResponseData();
|
1279 karl 1.12 responseData.setRemainingBinaryData(in);
|
1280 mike 1.1
1281 msg->binaryRequest = true;
1282 return msg;
1283 }
1284
1285 //==============================================================================
1286 //
1287 // References
1288 //
1289 //==============================================================================
1290
1291 static void _encodeReferencesRequest(
1292 CIMBuffer& buf,
1293 CIMReferencesRequestMessage* msg,
1294 CIMName& name)
1295 {
1296 /* See ../Client/CIMOperationRequestEncoder.cpp */
1297
1298 static const CIMName NAME("References");
1299 name = NAME;
1300
1301 mike 1.1 // [HEADER]
1302
1303 Uint32 flags = 0;
1304
1305 if (msg->includeQualifiers)
1306 flags |= INCLUDE_QUALIFIERS;
1307
1308 if (msg->includeClassOrigin)
1309 flags |= INCLUDE_CLASS_ORIGIN;
1310
1311 _putHeader(buf, flags, msg->messageId, OP_References);
1312
1313 // [NAMESPACE]
1314 buf.putNamespaceName(msg->nameSpace);
1315
1316 // [OBJECT-NAME]
1317 buf.putObjectPath(msg->objectName);
1318
1319 // [RESULT-CLASS]
1320 buf.putName(msg->resultClass);
1321
1322 mike 1.1 // [ROLE]
1323 buf.putString(msg->role);
1324
1325 // [PROPERTY-LIST]
1326 buf.putPropertyList(msg->propertyList);
1327 }
1328
1329 static CIMReferencesRequestMessage* _decodeReferencesRequest(
1330 CIMBuffer& in,
1331 Uint32 queueId,
1332 Uint32 returnQueueId,
1333 Uint32 flags,
1334 const String& messageId)
1335 {
1336 /* See ../Server/CIMOperationRequestDecoder.cpp */
1337
1338 STAT_GETSTARTTIME
1339
1340 Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;
1341 Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
1342
1343 mike 1.1 // [NAMESPACE]
1344
1345 CIMNamespaceName nameSpace;
1346
1347 if (!in.getNamespaceName(nameSpace))
1348 return 0;
1349
1350 // [OBJECT-NAME]
1351
1352 CIMObjectPath objectName;
1353
1354 if (!in.getObjectPath(objectName))
1355 return 0;
1356
1357 // [RESULT-CLASS]
1358
1359 CIMName resultClass;
1360
1361 if (!in.getName(resultClass))
1362 return 0;
1363
1364 mike 1.1 // [ROLE]
1365
1366 String role;
1367
1368 if (!in.getString(role))
1369 return 0;
1370
1371 // [PROPERTY-LIST]
1372
1373 CIMPropertyList propertyList;
1374
1375 if (!in.getPropertyList(propertyList))
1376 return 0;
1377
1378 AutoPtr<CIMReferencesRequestMessage> request(
1379 new CIMReferencesRequestMessage(
1380 messageId,
1381 nameSpace,
1382 objectName,
1383 resultClass,
1384 role,
1385 mike 1.1 includeQualifiers,
1386 includeClassOrigin,
1387 propertyList,
1388 QueueIdStack(queueId, returnQueueId)));
1389
1390 request->binaryRequest = true;
1391
1392 STAT_SERVERSTART
1393
1394 return request.release();
1395 }
1396
1397 static void _encodeReferencesResponseBody(
1398 CIMBuffer& out,
|
1399 thilo.boehm 1.10 CIMResponseData& data,
|
1400 mike 1.1 CIMName& name)
1401 {
1402 /* See ../Server/CIMOperationResponseEncoder.cpp */
1403
1404 static const CIMName NAME("References");
1405 name = NAME;
1406
|
1407 thilo.boehm 1.10 data.encodeBinaryResponse(out);
|
1408 mike 1.1 }
1409
1410 static CIMReferencesResponseMessage* _decodeReferencesResponse(
1411 CIMBuffer& in,
1412 const String& messageId)
1413 {
1414 CIMReferencesResponseMessage* msg;
1415 CIMException cimException;
1416
1417 msg = new CIMReferencesResponseMessage(
1418 messageId,
1419 cimException,
|
1420 thilo.boehm 1.10 QueueIdStack());
1421
1422 // Instead of resolving the binary data right here, we delegate this
1423 // to a later point in time when the data is actually retrieved through
1424 // a call to getNamedInstances, which is going to resolve the binary
1425 // data when the callback function is registered.
1426 // This allows an alternate client implementation to gain direct access
1427 // to the binary data and pass this for example to the JNI implementation
1428 // of the JSR48 CIM Client for Java.
1429 CIMResponseData& responseData = msg->getResponseData();
|
1430 karl 1.12 responseData.setRemainingBinaryData(in);
|
1431 mike 1.1
1432 msg->binaryRequest = true;
1433 return msg;
1434 }
1435
1436 //==============================================================================
1437 //
1438 // ReferenceNames
1439 //
1440 //==============================================================================
1441
1442 static void _encodeReferenceNamesRequest(
1443 CIMBuffer& buf,
1444 CIMReferenceNamesRequestMessage* msg,
1445 CIMName& name)
1446 {
1447 /* See ../Client/CIMOperationRequestEncoder.cpp */
1448
1449 static const CIMName NAME("ReferenceNames");
1450 name = NAME;
1451
1452 mike 1.1 // [HEADER]
1453 Uint32 flags = 0;
1454
1455 _putHeader(buf, flags, msg->messageId, OP_ReferenceNames);
1456
1457 // [NAMESPACE]
1458 buf.putNamespaceName(msg->nameSpace);
1459
1460 // [OBJECT-NAME]
1461 buf.putObjectPath(msg->objectName);
1462
1463 // [RESULT-CLASS]
1464 buf.putName(msg->resultClass);
1465
1466 // [ROLE]
1467 buf.putString(msg->role);
1468 }
1469
1470 static CIMReferenceNamesRequestMessage* _decodeReferenceNamesRequest(
1471 CIMBuffer& in,
1472 Uint32 queueId,
1473 mike 1.1 Uint32 returnQueueId,
1474 const String& messageId)
1475 {
1476 /* See ../Server/CIMOperationRequestDecoder.cpp */
1477
1478 STAT_GETSTARTTIME
1479
1480 // [NAMESPACE]
1481
1482 CIMNamespaceName nameSpace;
1483
1484 if (!in.getNamespaceName(nameSpace))
1485 return 0;
1486
1487 // [OBJECT-NAME]
1488 CIMObjectPath objectName;
1489
1490 if (!in.getObjectPath(objectName))
1491 return 0;
1492
1493 // [RESULT-CLASS]
1494 mike 1.1
1495 CIMName resultClass;
1496
1497 if (!in.getName(resultClass))
1498 return 0;
1499
1500 // [ROLE]
1501
1502 String role;
1503
1504 if (!in.getString(role))
1505 return 0;
1506
1507 AutoPtr<CIMReferenceNamesRequestMessage> request(
1508 new CIMReferenceNamesRequestMessage(
1509 messageId,
1510 nameSpace,
1511 objectName,
1512 resultClass,
1513 role,
1514 QueueIdStack(queueId, returnQueueId)));
1515 mike 1.1
1516 request->binaryRequest = true;
1517
1518 STAT_SERVERSTART
1519
1520 return request.release();
1521 }
1522
1523 static void _encodeReferenceNamesResponseBody(
1524 CIMBuffer& out,
|
1525 thilo.boehm 1.10 CIMResponseData& data,
|
1526 mike 1.1 CIMName& name)
1527 {
1528 /* See ../Server/CIMOperationResponseEncoder.cpp */
1529
1530 static const CIMName NAME("ReferenceNames");
1531 name = NAME;
|
1532 thilo.boehm 1.10 data.encodeBinaryResponse(out);
|
1533 mike 1.1 }
1534
1535 static CIMReferenceNamesResponseMessage* _decodeReferenceNamesResponse(
1536 CIMBuffer& in,
1537 const String& messageId)
1538 {
1539 /* See ../Client/CIMOperationResponseDecoder.cpp */
1540
1541 CIMReferenceNamesResponseMessage* msg;
1542 CIMException cimException;
1543
1544 msg = new CIMReferenceNamesResponseMessage(
1545 messageId,
1546 cimException,
|
1547 thilo.boehm 1.10 QueueIdStack());
1548
|
1549 karl 1.12.2.1 // Instead of resolving the binary data here, we delegate this
|
1550 thilo.boehm 1.10 // to a later point in time when the data is actually retrieved through
|
1551 karl 1.12.2.1 // a call to CIMResponseData::getInstanceNames, which
1552 // resolves the binary data as it is passed to the next interface.
|
1553 thilo.boehm 1.10 // This allows an alternate client implementation to gain direct access
1554 // to the binary data and pass this for example to the JNI implementation
1555 // of the JSR48 CIM Client for Java.
1556 CIMResponseData& responseData = msg->getResponseData();
|
1557 karl 1.12 responseData.setRemainingBinaryData(in);
|
1558 mike 1.1
1559 msg->binaryRequest = true;
|
1560 thilo.boehm 1.10
|
1561 mike 1.1 return msg;
1562 }
1563
1564 //==============================================================================
1565 //
1566 // GetClass
1567 //
1568 //==============================================================================
1569
1570 static void _encodeGetClassRequest(
1571 CIMBuffer& buf,
1572 CIMGetClassRequestMessage* msg,
1573 CIMName& name)
1574 {
1575 /* See ../Client/CIMOperationRequestEncoder.cpp */
1576
1577 static const CIMName NAME("GetClass");
1578 name = NAME;
1579
1580 // [HEADER]
1581
1582 mike 1.1 Uint32 flags = 0;
1583
1584 if (msg->localOnly)
1585 flags |= LOCAL_ONLY;
1586
1587 if (msg->includeQualifiers)
1588 flags |= INCLUDE_QUALIFIERS;
1589
1590 if (msg->includeClassOrigin)
1591 flags |= INCLUDE_CLASS_ORIGIN;
1592
1593 _putHeader(buf, flags, msg->messageId, OP_GetClass);
1594
1595 // [NAMESPACE]
1596 buf.putNamespaceName(msg->nameSpace);
1597
1598 // [CLASSNAME]
1599 buf.putName(msg->className);
1600
1601 // [PROPERTY-LIST]
1602 buf.putPropertyList(msg->propertyList);
1603 mike 1.1 }
1604
1605 static CIMGetClassRequestMessage* _decodeGetClassRequest(
1606 CIMBuffer& in,
1607 Uint32 queueId,
1608 Uint32 returnQueueId,
1609 Uint32 flags,
1610 const String& messageId)
1611 {
1612 /* See ../Server/CIMOperationRequestDecoder.cpp */
1613
1614 STAT_GETSTARTTIME
1615
1616 Boolean localOnly = flags & LOCAL_ONLY;
1617 Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;
1618 Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
1619
1620 // [NAMESPACE]
1621
1622 CIMNamespaceName nameSpace;
1623
1624 mike 1.1 if (!in.getNamespaceName(nameSpace))
1625 return 0;
1626
1627 // [CLASSNAME]
1628 CIMName className;
1629
1630 if (!in.getName(className))
1631 return 0;
1632
1633 // [PROPERTY-LIST]
1634 CIMPropertyList propertyList;
1635 if (!in.getPropertyList(propertyList))
1636 return 0;
1637
1638 AutoPtr<CIMGetClassRequestMessage> request(new CIMGetClassRequestMessage(
1639 messageId,
1640 nameSpace,
1641 className,
1642 localOnly,
1643 includeQualifiers,
1644 includeClassOrigin,
1645 mike 1.1 propertyList,
1646 QueueIdStack(queueId, returnQueueId)));
1647
1648 request->binaryRequest = true;
1649
1650 STAT_SERVERSTART
1651
1652 return request.release();
1653 }
1654
1655 static void _encodeGetClassResponseBody(
1656 CIMBuffer& out,
1657 CIMGetClassResponseMessage* msg,
1658 CIMName& name)
1659 {
1660 /* See ../Server/CIMOperationResponseEncoder.cpp */
1661
1662 static const CIMName NAME("GetClass");
1663 name = NAME;
1664
1665 out.putClass(msg->cimClass);
1666 mike 1.1 }
1667
1668 static CIMGetClassResponseMessage* _decodeGetClassResponse(
1669 CIMBuffer& in,
1670 const String& messageId)
1671 {
1672 /* See ../Client/CIMOperationResponseDecoder.cpp */
1673
1674 CIMClass cimClass;
1675
1676 if (!in.getClass(cimClass))
1677 return 0;
1678
1679 CIMGetClassResponseMessage* msg;
1680 CIMException cimException;
1681
1682 msg = new CIMGetClassResponseMessage(
1683 messageId,
1684 cimException,
1685 QueueIdStack(),
1686 cimClass);
1687 mike 1.1
1688 msg->binaryRequest = true;
1689 return msg;
1690 }
1691
1692 //==============================================================================
1693 //
1694 // EnumerateClasses
1695 //
1696 //==============================================================================
1697
1698 static void _encodeEnumerateClassesRequest(
1699 CIMBuffer& buf,
1700 CIMEnumerateClassesRequestMessage* msg,
1701 CIMName& name)
1702 {
1703 /* See ../Client/CIMOperationRequestEncoder.cpp */
1704
1705 static const CIMName NAME("EnumerateClasses");
1706 name = NAME;
1707
1708 mike 1.1 // [HEADER]
1709
1710 Uint32 flags = 0;
1711
1712 if (msg->localOnly)
1713 flags |= LOCAL_ONLY;
1714
1715 if (msg->deepInheritance)
1716 flags |= DEEP_INHERITANCE;
1717
1718 if (msg->includeQualifiers)
1719 flags |= INCLUDE_QUALIFIERS;
1720
1721 if (msg->includeClassOrigin)
1722 flags |= INCLUDE_CLASS_ORIGIN;
1723
1724 _putHeader(buf, flags, msg->messageId, OP_EnumerateClasses);
1725
1726 // [NAMESPACE]
1727 buf.putNamespaceName(msg->nameSpace);
1728
1729 mike 1.1 // [CLASSNAME]
1730 buf.putName(msg->className);
1731 }
1732
1733 static CIMEnumerateClassesRequestMessage* _decodeEnumerateClassesRequest(
1734 CIMBuffer& in,
1735 Uint32 queueId,
1736 Uint32 returnQueueId,
1737 Uint32 flags,
1738 const String& messageId)
1739 {
1740 /* See ../Server/CIMOperationRequestDecoder.cpp */
1741
1742 STAT_GETSTARTTIME
1743
1744 Boolean localOnly = flags & LOCAL_ONLY;
1745 Boolean deepInheritance = flags & DEEP_INHERITANCE;
1746 Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;
1747 Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
1748
1749 // [NAMESPACE]
1750 mike 1.1
1751 CIMNamespaceName nameSpace;
1752
1753 if (!in.getNamespaceName(nameSpace))
1754 return 0;
1755
1756 // [CLASSNAME]
1757 CIMName className;
1758
1759 if (!in.getName(className))
1760 return 0;
1761
1762 AutoPtr<CIMEnumerateClassesRequestMessage> request(
1763 new CIMEnumerateClassesRequestMessage(
1764 messageId,
1765 nameSpace,
1766 className,
1767 deepInheritance,
1768 localOnly,
1769 includeQualifiers,
1770 includeClassOrigin,
1771 mike 1.1 QueueIdStack(queueId, returnQueueId)));
1772
1773 request->binaryRequest = true;
1774
1775 STAT_SERVERSTART
1776
1777 return request.release();
1778 }
1779
1780 static void _encodeEnumerateClassesResponseBody(
1781 CIMBuffer& out,
1782 CIMEnumerateClassesResponseMessage* msg,
1783 CIMName& name)
1784 {
1785 /* See ../Server/CIMOperationResponseEncoder.cpp */
1786
1787 static const CIMName NAME("EnumerateClasses");
1788 name = NAME;
1789
1790 out.putClassA(msg->cimClasses);
1791 }
1792 mike 1.1
1793 static CIMEnumerateClassesResponseMessage* _decodeEnumerateClassesResponse(
1794 CIMBuffer& in,
1795 const String& messageId)
1796 {
1797 /* See ../Client/CIMOperationResponseDecoder.cpp */
1798
1799 Array<CIMClass> cimClasses;
1800
1801 while (in.more())
1802 {
1803 Array<CIMClass> tmp;
1804
1805 if (!in.getClassA(tmp))
1806 return 0;
1807
1808 cimClasses.append(tmp.getData(), tmp.size());
1809 }
1810
1811 CIMEnumerateClassesResponseMessage* msg;
1812 CIMException cimException;
1813 mike 1.1
1814 msg = new CIMEnumerateClassesResponseMessage(
1815 messageId,
1816 cimException,
1817 QueueIdStack(),
1818 cimClasses);
1819
1820 msg->binaryRequest = true;
1821 return msg;
1822 }
1823
1824 //==============================================================================
1825 //
1826 // EnumerateClassNames
1827 //
1828 //==============================================================================
1829
1830 static void _encodeEnumerateClassNamesRequest(
1831 CIMBuffer& buf,
1832 CIMEnumerateClassNamesRequestMessage* msg,
1833 CIMName& name)
1834 mike 1.1 {
1835 /* See ../Client/CIMOperationRequestEncoder.cpp */
1836
1837 static const CIMName NAME("EnumerateClassNames");
1838 name = NAME;
1839
1840 // [HEADER]
1841
1842 Uint32 flags = 0;
1843
1844 if (msg->deepInheritance)
1845 flags |= DEEP_INHERITANCE;
1846
1847 _putHeader(buf, flags, msg->messageId, OP_EnumerateClassNames);
1848
1849 // [NAMESPACE]
1850 buf.putNamespaceName(msg->nameSpace);
1851
1852 // [CLASSNAME]
1853 buf.putName(msg->className);
1854 }
1855 mike 1.1
1856 static CIMEnumerateClassNamesRequestMessage* _decodeEnumerateClassNamesRequest(
1857 CIMBuffer& in,
1858 Uint32 queueId,
1859 Uint32 returnQueueId,
1860 Uint32 flags,
1861 const String& messageId)
1862 {
1863 /* See ../Server/CIMOperationRequestDecoder.cpp */
1864
1865 STAT_GETSTARTTIME
1866
1867 Boolean deepInheritance = flags & DEEP_INHERITANCE;
1868
1869 // [NAMESPACE]
1870
1871 CIMNamespaceName nameSpace;
1872
1873 if (!in.getNamespaceName(nameSpace))
1874 return 0;
1875
1876 mike 1.1 // [CLASSNAME]
1877 CIMName className;
1878
1879 if (!in.getName(className))
1880 return 0;
1881
1882 AutoPtr<CIMEnumerateClassNamesRequestMessage> request(
1883 new CIMEnumerateClassNamesRequestMessage(
1884 messageId,
1885 nameSpace,
1886 className,
1887 deepInheritance,
1888 QueueIdStack(queueId, returnQueueId)));
1889
1890 request->binaryRequest = true;
1891
1892 STAT_SERVERSTART
1893
1894 return request.release();
1895 }
1896
1897 mike 1.1 static void _encodeEnumerateClassNamesResponseBody(
1898 CIMBuffer& out,
1899 CIMEnumerateClassNamesResponseMessage* msg,
1900 CIMName& name)
1901 {
1902 /* See ../Server/CIMOperationResponseEncoder.cpp */
1903
1904 static const CIMName NAME("EnumerateClassNames");
1905 name = NAME;
1906
1907 out.putNameA(msg->classNames);
1908 }
1909
|
1910 kumpf 1.6 static CIMEnumerateClassNamesResponseMessage*
|
1911 mike 1.1 _decodeEnumerateClassNamesResponse(
1912 CIMBuffer& in,
1913 const String& messageId)
1914 {
1915 /* See ../Client/CIMOperationResponseDecoder.cpp */
1916
1917 Array<CIMName> classNames;
1918
1919 while (in.more())
1920 {
1921 Array<CIMName> tmp;
1922
1923 if (!in.getNameA(tmp))
1924 return 0;
1925
1926 classNames.append(tmp.getData(), tmp.size());
1927 }
1928
1929 CIMEnumerateClassNamesResponseMessage* msg;
1930 CIMException cimException;
1931
1932 mike 1.1 msg = new CIMEnumerateClassNamesResponseMessage(
1933 messageId,
1934 cimException,
1935 QueueIdStack(),
1936 classNames);
1937
1938 msg->binaryRequest = true;
1939 return msg;
1940 }
1941
1942 //==============================================================================
1943 //
1944 // CreateClass
1945 //
1946 //==============================================================================
1947
1948 static void _encodeCreateClassRequest(
1949 CIMBuffer& buf,
1950 CIMCreateClassRequestMessage* msg,
1951 CIMName& name)
1952 {
1953 mike 1.1 /* See ../Client/CIMOperationRequestEncoder.cpp */
1954
1955 static const CIMName NAME("CreateClass");
1956 name = NAME;
1957
1958 // [HEADER]
1959 _putHeader(buf, 0, msg->messageId, OP_CreateClass);
1960
1961 // [NAMESPACE]
1962 buf.putNamespaceName(msg->nameSpace);
1963
1964 // [NEW-CLASS]
1965 buf.putClass(msg->newClass);
1966 }
1967
1968 static CIMCreateClassRequestMessage* _decodeCreateClassRequest(
1969 CIMBuffer& in,
1970 Uint32 queueId,
1971 Uint32 returnQueueId,
1972 const String& messageId)
1973 {
1974 mike 1.1 /* See ../Server/CIMOperationRequestDecoder.cpp */
1975
1976 STAT_GETSTARTTIME
1977
1978 // [NAMESPACE]
1979
1980 CIMNamespaceName nameSpace;
1981
1982 if (!in.getNamespaceName(nameSpace))
1983 return 0;
1984
1985 // [NEW-CLASS]
1986 CIMClass newClass;
1987
1988 if (!in.getClass(newClass))
1989 return 0;
1990
1991 AutoPtr<CIMCreateClassRequestMessage> request(
1992 new CIMCreateClassRequestMessage(
1993 messageId,
1994 nameSpace,
1995 mike 1.1 newClass,
1996 QueueIdStack(queueId, returnQueueId)));
1997
1998 request->binaryRequest = true;
1999
2000 STAT_SERVERSTART
2001
2002 return request.release();
2003 }
2004
2005 static void _encodeCreateClassResponseBody(
2006 CIMName& name)
2007 {
2008 /* See ../Server/CIMOperationResponseEncoder.cpp */
2009
2010 static const CIMName NAME("CreateClass");
2011 name = NAME;
2012 }
2013
2014 static CIMCreateClassResponseMessage* _decodeCreateClassResponse(
2015 const String& messageId)
2016 mike 1.1 {
2017 /* See ../Client/CIMOperationResponseDecoder.cpp */
2018
2019 CIMCreateClassResponseMessage* msg;
2020 CIMException cimException;
2021
2022 msg = new CIMCreateClassResponseMessage(
2023 messageId,
2024 cimException,
2025 QueueIdStack());
2026
2027 msg->binaryRequest = true;
2028 return msg;
2029 }
2030
2031 //==============================================================================
2032 //
2033 // DeleteClass
2034 //
2035 //==============================================================================
2036
2037 mike 1.1 static void _encodeDeleteClassRequest(
2038 CIMBuffer& buf,
2039 CIMDeleteClassRequestMessage* msg,
2040 CIMName& name)
2041 {
2042 /* See ../Client/CIMOperationRequestEncoder.cpp */
2043
2044 static const CIMName NAME("DeleteClass");
2045 name = NAME;
2046
2047 // [HEADER]
2048 _putHeader(buf, 0, msg->messageId, OP_DeleteClass);
2049
2050 // [NAMESPACE]
2051 buf.putNamespaceName(msg->nameSpace);
2052
2053 // [CLASSNAME]
2054 buf.putName(msg->className);
2055 }
2056
2057 static CIMDeleteClassRequestMessage* _decodeDeleteClassRequest(
2058 mike 1.1 CIMBuffer& in,
2059 Uint32 queueId,
2060 Uint32 returnQueueId,
2061 const String& messageId)
2062 {
2063 /* See ../Server/CIMOperationRequestDecoder.cpp */
2064
2065 STAT_GETSTARTTIME
2066
2067 // [NAMESPACE]
2068
2069 CIMNamespaceName nameSpace;
2070
2071 if (!in.getNamespaceName(nameSpace))
2072 return 0;
2073
2074 // [CLASSNAME]
2075 CIMName className;
2076
2077 if (!in.getName(className))
2078 return 0;
2079 mike 1.1
2080 AutoPtr<CIMDeleteClassRequestMessage> request(
2081 new CIMDeleteClassRequestMessage(
2082 messageId,
2083 nameSpace,
2084 className,
2085 QueueIdStack(queueId, returnQueueId)));
2086
2087 request->binaryRequest = true;
2088
2089 STAT_SERVERSTART
2090
2091 return request.release();
2092 }
2093
2094 static void _encodeDeleteClassResponseBody(
2095 CIMName& name)
2096 {
2097 /* See ../Server/CIMOperationResponseEncoder.cpp */
2098
2099 static const CIMName NAME("DeleteClass");
2100 mike 1.1 name = NAME;
2101 }
2102
2103 static CIMDeleteClassResponseMessage* _decodeDeleteClassResponse(
2104 const String& messageId)
2105 {
2106 /* See ../Client/CIMOperationResponseDecoder.cpp */
2107
2108 CIMDeleteClassResponseMessage* msg;
2109 CIMException cimException;
2110
2111 msg = new CIMDeleteClassResponseMessage(
2112 messageId,
2113 cimException,
2114 QueueIdStack());
2115
2116 msg->binaryRequest = true;
2117 return msg;
2118 }
2119
2120 //==============================================================================
2121 mike 1.1 //
2122 // ModifyClass
2123 //
2124 //==============================================================================
2125
2126 static void _encodeModifyClassRequest(
2127 CIMBuffer& buf,
2128 CIMModifyClassRequestMessage* msg,
2129 CIMName& name)
2130 {
2131 /* See ../Client/CIMOperationRequestEncoder.cpp */
2132
2133 static const CIMName NAME("ModifyClass");
2134 name = NAME;
2135
2136 // [HEADER]
2137 _putHeader(buf, 0, msg->messageId, OP_ModifyClass);
2138
2139 // [NAMESPACE]
2140 buf.putNamespaceName(msg->nameSpace);
2141
2142 mike 1.1 // [NEW-CLASS]
2143 buf.putClass(msg->modifiedClass);
2144 }
2145
2146 static CIMModifyClassRequestMessage* _decodeModifyClassRequest(
2147 CIMBuffer& in,
2148 Uint32 queueId,
2149 Uint32 returnQueueId,
2150 const String& messageId)
2151 {
2152 /* See ../Server/CIMOperationRequestDecoder.cpp */
2153
2154 STAT_GETSTARTTIME
2155
2156 // [NAMESPACE]
2157
2158 CIMNamespaceName nameSpace;
2159
2160 if (!in.getNamespaceName(nameSpace))
2161 return 0;
2162
2163 mike 1.1 // [MODIFIED-CLASS]
2164 CIMClass modifiedClass;
2165
2166 if (!in.getClass(modifiedClass))
2167 return 0;
2168
2169 AutoPtr<CIMModifyClassRequestMessage> request(
2170 new CIMModifyClassRequestMessage(
2171 messageId,
2172 nameSpace,
2173 modifiedClass,
2174 QueueIdStack(queueId, returnQueueId)));
2175
2176 request->binaryRequest = true;
2177
2178 STAT_SERVERSTART
2179
2180 return request.release();
2181 }
2182
2183 static void _encodeModifyClassResponseBody(
2184 mike 1.1 CIMName& name)
2185 {
2186 /* See ../Server/CIMOperationResponseEncoder.cpp */
2187
2188 static const CIMName NAME("ModifyClass");
2189 name = NAME;
2190 }
2191
2192 static CIMModifyClassResponseMessage* _decodeModifyClassResponse(
2193 const String& messageId)
2194 {
2195 /* See ../Client/CIMOperationResponseDecoder.cpp */
2196
2197 CIMModifyClassResponseMessage* msg;
2198 CIMException cimException;
2199
2200 msg = new CIMModifyClassResponseMessage(
2201 messageId,
2202 cimException,
2203 QueueIdStack());
2204
2205 mike 1.1 msg->binaryRequest = true;
2206 return msg;
2207 }
2208
2209 //==============================================================================
2210 //
2211 // SetQualifier
2212 //
2213 //==============================================================================
2214
2215 static void _encodeSetQualifierRequest(
2216 CIMBuffer& buf,
2217 CIMSetQualifierRequestMessage* msg,
2218 CIMName& name)
2219 {
2220 /* See ../Client/CIMOperationRequestEncoder.cpp */
2221
2222 static const CIMName NAME("SetQualifier");
2223 name = NAME;
2224
2225 // [HEADER]
2226 mike 1.1 _putHeader(buf, 0, msg->messageId, OP_SetQualifier);
2227
2228 // [NAMESPACE]
2229 buf.putNamespaceName(msg->nameSpace);
2230
2231 // [QUALIFIER-DECLARATION]
2232 buf.putQualifierDecl(msg->qualifierDeclaration);
2233 }
2234
2235 static CIMSetQualifierRequestMessage* _decodeSetQualifierRequest(
2236 CIMBuffer& in,
2237 Uint32 queueId,
2238 Uint32 returnQueueId,
2239 const String& messageId)
2240 {
2241 /* See ../Server/CIMOperationRequestDecoder.cpp */
2242
2243 STAT_GETSTARTTIME
2244
2245 // [NAMESPACE]
2246
2247 mike 1.1 CIMNamespaceName nameSpace;
2248
2249 if (!in.getNamespaceName(nameSpace))
2250 return 0;
2251
2252 // [QUALIFIER.DECLARATION]
2253
2254 CIMQualifierDecl qualifierDeclaration;
2255
2256 if (!in.getQualifierDecl(qualifierDeclaration))
2257 return 0;
2258
2259 AutoPtr<CIMSetQualifierRequestMessage> request(
2260 new CIMSetQualifierRequestMessage(
2261 messageId,
2262 nameSpace,
2263 qualifierDeclaration,
2264 QueueIdStack(queueId, returnQueueId)));
2265
2266 request->binaryRequest = true;
2267
2268 mike 1.1 STAT_SERVERSTART
2269
2270 return request.release();
2271 }
2272
2273 static void _encodeSetQualifierResponseBody(
2274 CIMName& name)
2275 {
2276 /* See ../Server/CIMOperationResponseEncoder.cpp */
2277
2278 static const CIMName NAME("SetQualifier");
2279 name = NAME;
2280 }
2281
2282 static CIMSetQualifierResponseMessage* _decodeSetQualifierResponse(
2283 const String& messageId)
2284 {
2285 /* See ../Client/CIMOperationResponseDecoder.cpp */
2286
2287 CIMSetQualifierResponseMessage* msg;
2288 CIMException cimException;
2289 mike 1.1
2290 msg = new CIMSetQualifierResponseMessage(
2291 messageId,
2292 cimException,
2293 QueueIdStack());
2294
2295 msg->binaryRequest = true;
2296 return msg;
2297 }
2298
2299 //==============================================================================
2300 //
2301 // GetQualifier
2302 //
2303 //==============================================================================
2304
2305 static void _encodeGetQualifierRequest(
2306 CIMBuffer& buf,
2307 CIMGetQualifierRequestMessage* msg,
2308 CIMName& name)
2309 {
2310 mike 1.1 /* See ../Client/CIMOperationRequestEncoder.cpp */
2311
2312 static const CIMName NAME("GetQualifier");
2313 name = NAME;
2314
2315 // [HEADER]
2316 _putHeader(buf, 0, msg->messageId, OP_GetQualifier);
2317
2318 // [NAMESPACE]
2319 buf.putNamespaceName(msg->nameSpace);
2320
2321 // [QUALIFIER-NAME]
2322 buf.putName(msg->qualifierName);
2323 }
2324
2325 static CIMGetQualifierRequestMessage* _decodeGetQualifierRequest(
2326 CIMBuffer& in,
2327 Uint32 queueId,
2328 Uint32 returnQueueId,
2329 const String& messageId)
2330 {
2331 mike 1.1 /* See ../Server/CIMOperationRequestDecoder.cpp */
2332
2333 STAT_GETSTARTTIME
2334
2335 // [NAMESPACE]
2336
2337 CIMNamespaceName nameSpace;
2338
2339 if (!in.getNamespaceName(nameSpace))
2340 return 0;
2341
2342 // [QUALIFIER-NAME]
2343 CIMName qualifierName;
2344
2345 if (!in.getName(qualifierName))
2346 return 0;
2347
2348 AutoPtr<CIMGetQualifierRequestMessage> request(
2349 new CIMGetQualifierRequestMessage(
2350 messageId,
2351 nameSpace,
2352 mike 1.1 qualifierName,
2353 QueueIdStack(queueId, returnQueueId)));
2354
2355 request->binaryRequest = true;
2356
2357 STAT_SERVERSTART
2358
2359 return request.release();
2360 }
2361
2362 static void _encodeGetQualifierResponseBody(
2363 CIMBuffer& out,
2364 CIMGetQualifierResponseMessage* msg,
2365 CIMName& name)
2366 {
2367 /* See ../Server/CIMOperationResponseEncoder.cpp */
2368
2369 static const CIMName NAME("GetQualifier");
2370 name = NAME;
2371
2372 out.putQualifierDecl(msg->cimQualifierDecl);
2373 mike 1.1 }
2374
2375 static CIMGetQualifierResponseMessage* _decodeGetQualifierResponse(
2376 CIMBuffer& in,
2377 const String& messageId)
2378 {
2379 /* See ../Client/CIMOperationResponseDecoder.cpp */
2380
2381 CIMQualifierDecl cimQualifierDecl;
2382
2383 if (!in.getQualifierDecl(cimQualifierDecl))
2384 return 0;
2385
2386 CIMGetQualifierResponseMessage* msg;
2387 CIMException cimException;
2388
2389 msg = new CIMGetQualifierResponseMessage(
2390 messageId,
2391 cimException,
2392 QueueIdStack(),
2393 cimQualifierDecl);
2394 mike 1.1
2395 msg->binaryRequest = true;
2396 return msg;
2397 }
2398
2399 //==============================================================================
2400 //
2401 // DeleteQualifier
2402 //
2403 //==============================================================================
2404
2405 static void _encodeDeleteQualifierRequest(
2406 CIMBuffer& buf,
2407 CIMDeleteQualifierRequestMessage* msg,
2408 CIMName& name)
2409 {
2410 /* See ../Client/CIMOperationRequestEncoder.cpp */
2411
2412 static const CIMName NAME("DeleteQualifier");
2413 name = NAME;
2414
2415 mike 1.1 // [HEADER]
2416 _putHeader(buf, 0, msg->messageId, OP_DeleteQualifier);
2417
2418 // [NAMESPACE]
2419 buf.putNamespaceName(msg->nameSpace);
2420
2421 // [QUALIFIER-NAME]
2422 buf.putName(msg->qualifierName);
2423 }
2424
2425 static CIMDeleteQualifierRequestMessage* _decodeDeleteQualifierRequest(
2426 CIMBuffer& in,
2427 Uint32 queueId,
2428 Uint32 returnQueueId,
2429 const String& messageId)
2430 {
2431 /* See ../Server/CIMOperationRequestDecoder.cpp */
2432
2433 STAT_GETSTARTTIME
2434
2435 // [NAMESPACE]
2436 mike 1.1
2437 CIMNamespaceName nameSpace;
2438
2439 if (!in.getNamespaceName(nameSpace))
2440 return 0;
2441
2442 // [QUALIFIER-NAME]
2443 CIMName qualifierName;
2444
2445 if (!in.getName(qualifierName))
2446 return 0;
2447
2448 AutoPtr<CIMDeleteQualifierRequestMessage> request(
2449 new CIMDeleteQualifierRequestMessage(
2450 messageId,
2451 nameSpace,
2452 qualifierName,
2453 QueueIdStack(queueId, returnQueueId)));
2454
2455 request->binaryRequest = true;
2456
2457 mike 1.1 STAT_SERVERSTART
2458
2459 return request.release();
2460 }
2461
2462 static void _encodeDeleteQualifierResponseBody(
2463 CIMName& name)
2464 {
2465 /* See ../Server/CIMOperationResponseEncoder.cpp */
2466
2467 static const CIMName NAME("DeleteQualifier");
2468 name = NAME;
2469 }
2470
2471 static CIMDeleteQualifierResponseMessage* _decodeDeleteQualifierResponse(
2472 const String& messageId)
2473 {
2474 /* See ../Client/CIMOperationResponseDecoder.cpp */
2475
2476 CIMDeleteQualifierResponseMessage* msg;
2477 CIMException cimException;
2478 mike 1.1
2479 msg = new CIMDeleteQualifierResponseMessage(
2480 messageId,
2481 cimException,
2482 QueueIdStack());
2483
2484 msg->binaryRequest = true;
2485 return msg;
2486 }
2487
2488 //==============================================================================
2489 //
2490 // EnumerateQualifiers
2491 //
2492 //==============================================================================
2493
2494 static void _encodeEnumerateQualifiersRequest(
2495 CIMBuffer& buf,
2496 CIMEnumerateQualifiersRequestMessage* msg,
2497 CIMName& name)
2498 {
2499 mike 1.1 /* See ../Client/CIMOperationRequestEncoder.cpp */
2500
2501 static const CIMName NAME("EnumerateQualifiers");
2502 name = NAME;
2503
2504 // [HEADER]
2505 _putHeader(buf, 0, msg->messageId, OP_EnumerateQualifiers);
2506
2507 // [NAMESPACE]
2508 buf.putNamespaceName(msg->nameSpace);
2509 }
2510
2511 static CIMEnumerateQualifiersRequestMessage* _decodeEnumerateQualifiersRequest(
2512 CIMBuffer& in,
2513 Uint32 queueId,
2514 Uint32 returnQueueId,
2515 const String& messageId)
2516 {
2517 /* See ../Server/CIMOperationRequestDecoder.cpp */
2518
2519 STAT_GETSTARTTIME
2520 mike 1.1
2521 // [NAMESPACE]
2522
2523 CIMNamespaceName nameSpace;
2524
2525 if (!in.getNamespaceName(nameSpace))
2526 return 0;
2527
2528 AutoPtr<CIMEnumerateQualifiersRequestMessage> request(
2529 new CIMEnumerateQualifiersRequestMessage(
2530 messageId,
2531 nameSpace,
2532 QueueIdStack(queueId, returnQueueId)));
2533
2534 request->binaryRequest = true;
2535
2536 STAT_SERVERSTART
2537
2538 return request.release();
2539 }
2540
2541 mike 1.1 static void _encodeEnumerateQualifiersResponseBody(
2542 CIMBuffer& out,
2543 CIMEnumerateQualifiersResponseMessage* msg,
2544 CIMName& name)
2545 {
2546 /* See ../Server/CIMOperationResponseEncoder.cpp */
2547
2548 static const CIMName NAME("EnumerateQualifiers");
2549 name = NAME;
2550
2551 out.putQualifierDeclA(msg->qualifierDeclarations);
2552 }
2553
|
2554 kumpf 1.6 static CIMEnumerateQualifiersResponseMessage*
|
2555 mike 1.1 _decodeEnumerateQualifiersResponse(
2556 CIMBuffer& in,
2557 const String& messageId)
2558 {
2559 /* See ../Client/CIMOperationResponseDecoder.cpp */
2560
2561 Array<CIMQualifierDecl> qualifierDecls;
2562
2563 while (in.more())
2564 {
2565 Array<CIMQualifierDecl> tmp;
2566
2567 if (!in.getQualifierDeclA(tmp))
2568 return 0;
2569
2570 qualifierDecls.append(tmp.getData(), tmp.size());
2571 }
2572
2573 CIMEnumerateQualifiersResponseMessage* msg;
2574 CIMException cimException;
2575
2576 mike 1.1 msg = new CIMEnumerateQualifiersResponseMessage(
2577 messageId,
2578 cimException,
2579 QueueIdStack(),
2580 qualifierDecls);
2581
2582 msg->binaryRequest = true;
2583 return msg;
2584 }
2585
2586 //==============================================================================
2587 //
2588 // GetProperty
2589 //
2590 //==============================================================================
2591
2592 static void _encodeGetPropertyRequest(
2593 CIMBuffer& buf,
2594 CIMGetPropertyRequestMessage* msg,
2595 CIMName& name)
2596 {
2597 mike 1.1 /* See ../Client/CIMOperationRequestEncoder.cpp */
2598
2599 static const CIMName NAME("GetProperty");
2600 name = NAME;
2601
2602 // [HEADER]
2603 _putHeader(buf, 0, msg->messageId, OP_GetProperty);
2604
2605 // [NAMESPACE]
2606 buf.putNamespaceName(msg->nameSpace);
2607
2608 // [INSTANCE-NAME]
2609 buf.putObjectPath(msg->instanceName);
2610
2611 // [PROPERTY-NAME]
2612 buf.putName(msg->propertyName);
2613 }
2614
2615 static CIMGetPropertyRequestMessage* _decodeGetPropertyRequest(
2616 CIMBuffer& in,
2617 Uint32 queueId,
2618 mike 1.1 Uint32 returnQueueId,
2619 const String& messageId)
2620 {
2621 /* See ../Server/CIMOperationRequestDecoder.cpp */
2622
2623 STAT_GETSTARTTIME
2624
2625 // [NAMESPACE]
2626
2627 CIMNamespaceName nameSpace;
2628
2629 if (!in.getNamespaceName(nameSpace))
2630 return 0;
2631
2632 // [INSTANCE-NAME]
2633 CIMObjectPath instanceName;
2634
2635 if (!in.getObjectPath(instanceName))
2636 return 0;
2637
2638 // [PROPERTY-NAME]
2639 mike 1.1 CIMName propertyName;
2640
2641 if (!in.getName(propertyName))
2642 return 0;
2643
2644 AutoPtr<CIMGetPropertyRequestMessage> request(
2645 new CIMGetPropertyRequestMessage(
2646 messageId,
2647 nameSpace,
2648 instanceName,
2649 propertyName,
2650 QueueIdStack(queueId, returnQueueId)));
2651
2652 request->binaryRequest = true;
2653
2654 STAT_SERVERSTART
2655
2656 return request.release();
2657 }
2658
2659 static void _encodeGetPropertyResponseBody(
2660 mike 1.1 CIMBuffer& out,
2661 CIMGetPropertyResponseMessage* msg,
2662 CIMName& name)
2663 {
2664 /* See ../Server/CIMOperationResponseEncoder.cpp */
2665
2666 static const CIMName NAME("GetProperty");
2667 name = NAME;
2668
2669 // [VALUE]
2670 out.putValue(msg->value);
2671 }
2672
2673 static CIMGetPropertyResponseMessage* _decodeGetPropertyResponse(
2674 CIMBuffer& in,
2675 const String& messageId)
2676 {
2677 /* See ../Client/CIMOperationResponseDecoder.cpp */
2678
2679 // [VALUE]
2680 CIMValue value;
2681 mike 1.1
2682 if (!in.getValue(value))
2683 return 0;
2684
2685 // Unfortunately the CIM GetProperty() method is only able to return
2686 // a string since there is no containing element that specifies its
2687 // type. So even though the binary protocol properly transmits the type,
2688 // we are force to convert that type to string to match the XML protocol
2689 // behavior.
2690
2691 if (value.isNull())
2692 value.setNullValue(CIMTYPE_STRING, false);
2693 else
2694 value.set(value.toString());
2695
2696 CIMGetPropertyResponseMessage* msg;
2697 CIMException cimException;
2698
2699 msg = new CIMGetPropertyResponseMessage(
2700 messageId,
2701 cimException,
2702 mike 1.1 QueueIdStack(),
2703 value);
2704
2705 msg->binaryRequest = true;
2706 return msg;
2707 }
2708
2709 //==============================================================================
2710 //
2711 // SetProperty
2712 //
2713 //==============================================================================
2714
2715 static void _encodeSetPropertyRequest(
2716 CIMBuffer& buf,
2717 CIMSetPropertyRequestMessage* msg,
2718 CIMName& name)
2719 {
2720 /* See ../Client/CIMOperationRequestEncoder.cpp */
2721
2722 static const CIMName NAME("SetProperty");
2723 mike 1.1 name = NAME;
2724
2725 // [HEADER]
2726 _putHeader(buf, 0, msg->messageId, OP_SetProperty);
2727
2728 // [NAMESPACE]
2729 buf.putNamespaceName(msg->nameSpace);
2730
2731 // [INSTANCE-NAME]
2732 buf.putObjectPath(msg->instanceName);
2733
2734 // [PROPERTY-NAME]
2735 buf.putName(msg->propertyName);
2736
2737 // [VALUE]
2738 buf.putValue(msg->newValue);
2739 }
2740
2741 static CIMSetPropertyRequestMessage* _decodeSetPropertyRequest(
2742 CIMBuffer& in,
2743 Uint32 queueId,
2744 mike 1.1 Uint32 returnQueueId,
2745 const String& messageId)
2746 {
2747 /* See ../Server/CIMOperationRequestDecoder.cpp */
2748
2749 STAT_GETSTARTTIME
2750
2751 // [NAMESPACE]
2752
2753 CIMNamespaceName nameSpace;
2754
2755 if (!in.getNamespaceName(nameSpace))
2756 return 0;
2757
2758 // [INSTANCE-NAME]
2759
2760 CIMObjectPath instanceName;
2761
2762 if (!in.getObjectPath(instanceName))
2763 return 0;
2764
2765 mike 1.1 // [PROPERTY-NAME]
2766
2767 CIMName propertyName;
2768
2769 if (!in.getName(propertyName))
2770 return 0;
2771
2772 // [PROPERTY-VALUE]
2773
2774 CIMValue propertyValue;
2775
2776 if (!in.getValue(propertyValue))
2777 return 0;
2778
2779 AutoPtr<CIMSetPropertyRequestMessage> request(
2780 new CIMSetPropertyRequestMessage(
2781 messageId,
2782 nameSpace,
2783 instanceName,
2784 propertyName,
2785 propertyValue,
2786 mike 1.1 QueueIdStack(queueId, returnQueueId)));
2787
2788 request->binaryRequest = true;
2789
2790 STAT_SERVERSTART
2791
2792 return request.release();
2793 }
2794
2795 static void _encodeSetPropertyResponseBody(
2796 CIMName& name)
2797 {
2798 /* See ../Server/CIMOperationResponseEncoder.cpp */
2799
2800 static const CIMName NAME("SetProperty");
2801 name = NAME;
2802 }
2803
2804 static CIMSetPropertyResponseMessage* _decodeSetPropertyResponse(
2805 const String& messageId)
2806 {
2807 mike 1.1 /* See ../Client/CIMOperationResponseDecoder.cpp */
2808
2809 CIMSetPropertyResponseMessage* msg;
2810 CIMException cimException;
2811
2812 msg = new CIMSetPropertyResponseMessage(
2813 messageId,
2814 cimException,
2815 QueueIdStack());
2816
2817 msg->binaryRequest = true;
2818 return msg;
2819 }
2820
2821 //==============================================================================
2822 //
2823 // InvokeMethod
2824 //
2825 //==============================================================================
2826
2827 static void _encodeInvokeMethodRequest(
2828 mike 1.1 CIMBuffer& buf,
2829 CIMInvokeMethodRequestMessage* msg,
2830 CIMName& name)
2831 {
2832 /* See ../Client/CIMOperationRequestEncoder.cpp */
2833
2834 name = msg->methodName;
2835
2836 // [HEADER]
2837 _putHeader(buf, 0, msg->messageId, OP_InvokeMethod);
2838
2839 // [NAMESPACE]
2840 buf.putNamespaceName(msg->nameSpace);
2841
2842 // [INSTANCE-NAME]
2843 buf.putObjectPath(msg->instanceName);
2844
2845 // [METHOD-NAME]
2846 buf.putName(msg->methodName);
2847
2848 // [IN-PARAMETERS]
2849 mike 1.1 buf.putParamValueA(msg->inParameters);
2850 }
2851
2852 static CIMInvokeMethodRequestMessage* _decodeInvokeMethodRequest(
2853 CIMBuffer& in,
2854 Uint32 queueId,
2855 Uint32 returnQueueId,
2856 const String& messageId)
2857 {
2858 /* See ../Server/CIMOperationRequestDecoder.cpp */
2859
2860 STAT_GETSTARTTIME
2861
2862 // [NAMESPACE]
2863
2864 CIMNamespaceName nameSpace;
2865
2866 if (!in.getNamespaceName(nameSpace))
2867 return 0;
2868
2869 // [INSTANCE-NAME]
2870 mike 1.1
2871 CIMObjectPath instanceName;
2872
2873 if (!in.getObjectPath(instanceName))
2874 return 0;
2875
2876 // [METHOD-NAME]
2877
2878 CIMName methodName;
2879
2880 if (!in.getName(methodName))
2881 return 0;
2882
2883 // [IN-PARAMETERS]
2884
2885 Array<CIMParamValue> inParameters;
2886
2887 if (!in.getParamValueA(inParameters))
2888 return 0;
2889
2890 AutoPtr<CIMInvokeMethodRequestMessage> request(
2891 mike 1.1 new CIMInvokeMethodRequestMessage(
2892 messageId,
2893 nameSpace,
2894 instanceName,
2895 methodName,
2896 inParameters,
2897 QueueIdStack(queueId, returnQueueId)));
2898
2899 request->binaryRequest = true;
2900
2901 STAT_SERVERSTART
2902
2903 return request.release();
2904 }
2905
2906 static void _encodeInvokeMethodResponseBody(
2907 CIMBuffer& out,
2908 CIMInvokeMethodResponseMessage* msg,
2909 CIMName& name)
2910 {
2911 /* See ../Server/CIMOperationResponseEncoder.cpp */
2912 mike 1.1
2913 name = msg->methodName;
2914
2915 // [METHOD-NAME]
2916 out.putName(msg->methodName);
2917
2918 // [RETURN-VALUE]
2919 out.putValue(msg->retValue);
2920
2921 // [OUT-PARAMETERS]
2922 out.putParamValueA(msg->outParameters);
2923 }
2924
2925 static CIMInvokeMethodResponseMessage* _decodeInvokeMethodResponse(
2926 CIMBuffer& in,
2927 const String& messageId)
2928 {
2929 /* See ../Client/CIMOperationResponseDecoder.cpp */
2930
2931 // [METHOD-NAME]
2932
2933 mike 1.1 CIMName methodName;
2934
2935 if (!in.getName(methodName))
2936 return 0;
2937
2938 // [RETURN-VALUE]
2939
2940 CIMValue returnValue;
2941
2942 if (!in.getValue(returnValue))
2943 return 0;
2944
2945 // [OUT-PARAMETERS]
2946
2947 Array<CIMParamValue> outParameters;
2948
2949 if (!in.getParamValueA(outParameters))
2950 return 0;
2951
2952 CIMInvokeMethodResponseMessage* msg;
2953 CIMException cimException;
2954 mike 1.1
2955 msg = new CIMInvokeMethodResponseMessage(
2956 messageId,
2957 cimException,
2958 QueueIdStack(),
2959 returnValue,
2960 outParameters,
2961 methodName);
2962
2963 msg->binaryRequest = true;
2964
2965 return msg;
2966 }
2967
2968 //==============================================================================
2969 //
2970 // ExecQuery
2971 //
2972 //==============================================================================
2973
2974 static void _encodeExecQueryRequest(
2975 mike 1.1 CIMBuffer& buf,
2976 CIMExecQueryRequestMessage* msg,
2977 CIMName& name)
2978 {
2979 /* See ../Client/CIMOperationRequestEncoder.cpp */
2980
2981 static const CIMName NAME("ExecQuery");
2982 name = NAME;
2983
2984 // [HEADER]
2985 _putHeader(buf, 0, msg->messageId, OP_ExecQuery);
2986
2987 // [NAMESPACE]
2988 buf.putNamespaceName(msg->nameSpace);
2989
2990 // [QUERY-LANGUAGE]
2991 buf.putString(msg->queryLanguage);
2992
2993 // [QUERY]
2994 buf.putString(msg->query);
2995 }
2996 mike 1.1
2997 static CIMExecQueryRequestMessage* _decodeExecQueryRequest(
2998 CIMBuffer& in,
2999 Uint32 queueId,
3000 Uint32 returnQueueId,
3001 const String& messageId)
3002 {
3003 /* See ../Server/CIMOperationRequestDecoder.cpp */
3004
3005 STAT_GETSTARTTIME
3006
3007 // [NAMESPACE]
3008
3009 CIMNamespaceName nameSpace;
3010
3011 if (!in.getNamespaceName(nameSpace))
3012 return 0;
3013
3014 // [QUERY-LANGUAGE]]
3015 String queryLanguage;
3016
3017 mike 1.1 if (!in.getString(queryLanguage))
3018 return 0;
3019
3020 // [QUERY]]
3021 String query;
3022
3023 if (!in.getString(query))
3024 return 0;
3025
3026 AutoPtr<CIMExecQueryRequestMessage> request(
3027 new CIMExecQueryRequestMessage(
3028 messageId,
3029 nameSpace,
3030 queryLanguage,
3031 query,
3032 QueueIdStack(queueId, returnQueueId)));
3033
3034 request->binaryRequest = true;
3035
3036 STAT_SERVERSTART
3037
3038 mike 1.1 return request.release();
3039 }
3040
3041 static void _encodeExecQueryResponseBody(
3042 CIMBuffer& out,
|
3043 thilo.boehm 1.10 CIMResponseData& data,
|
3044 mike 1.1 CIMName& name)
3045 {
3046 /* See ../Server/CIMOperationResponseEncoder.cpp */
3047
3048 static const CIMName NAME("ExecQuery");
3049 name = NAME;
3050
|
3051 r.kieninger 1.8 data.encodeBinaryResponse(out);
|
3052 mike 1.1 }
3053
3054 static CIMExecQueryResponseMessage* _decodeExecQueryResponse(
3055 CIMBuffer& in,
3056 const String& messageId)
3057 {
3058 CIMExecQueryResponseMessage* msg;
3059 CIMException cimException;
3060
3061 msg = new CIMExecQueryResponseMessage(
3062 messageId,
3063 cimException,
|
3064 r.kieninger 1.8 QueueIdStack());
|
3065 mike 1.1
|
3066 r.kieninger 1.9 // Instead of resolving the binary data right here, we delegate this
3067 // to a later point in time when the data is actually retrieved through
3068 // a call to getNamedInstances, which is going to resolve the binary
3069 // data when the callback function is registered.
3070 // This allows an alternate client implementation to gain direct access
3071 // to the binary data and pass this for example to the JNI implementation
3072 // of the JSR48 CIM Client for Java.
|
3073 thilo.boehm 1.10 CIMResponseData& responseData = msg->getResponseData();
|
3074 karl 1.12 responseData.setRemainingBinaryData(in);
|
3075 r.kieninger 1.9
|
3076 mike 1.1 msg->binaryRequest = true;
3077 return msg;
3078 }
|
3079 karl 1.12.2.4 // EXP_PULL_BEGIN
|
3080 mike 1.1 //==============================================================================
3081 //
|
3082 karl 1.12.2.1 // OpenEnumerateInstances
|
3083 mike 1.1 //
3084 //==============================================================================
3085
|
3086 karl 1.12.2.1 static void _encodeOpenEnumerateInstancesRequest(
3087 CIMBuffer& buf,
3088 CIMOpenEnumerateInstancesRequestMessage* msg,
3089 CIMName& name)
|
3090 mike 1.1 {
|
3091 karl 1.12.2.1 /* See ../Client/CIMOperationRequestEncoder.cpp */
|
3092 mike 1.1
|
3093 karl 1.12.2.1 static const CIMName NAME("OpenEnumerateInstances");
3094 name = NAME;
|
3095 mike 1.1
|
3096 karl 1.12.2.1 // [HEADER]
|
3097 mike 1.1
|
3098 karl 1.12.2.1 Uint32 flags = 0;
|
3099 mike 1.1
|
3100 karl 1.12.2.1 if (msg->deepInheritance)
3101 flags |= DEEP_INHERITANCE;
|
3102 mike 1.1
|
3103 karl 1.12.2.1 if (msg->includeClassOrigin)
3104 flags |= INCLUDE_CLASS_ORIGIN;
|
3105 mike 1.1
|
3106 karl 1.12.2.1 if (msg->continueOnError)
3107 flags |= CONTINUE_ON_ERROR;
|
3108 mike 1.1
|
3109 karl 1.12.2.1 _putHeader(buf, flags, msg->messageId, OP_OpenEnumerateInstances);
|
3110 mike 1.1
|
3111 karl 1.12.2.1 // [NAMESPACE]
3112 buf.putNamespaceName(msg->nameSpace);
|
3113 mike 1.1
|
3114 karl 1.12.2.1 // [CLASSNAME]
3115 buf.putName(msg->className);
|
3116 mike 1.1
|
3117 karl 1.12.2.1 // [PROPERTY-LIST]
3118 buf.putPropertyList(msg->propertyList);
|
3119 mike 1.1
|
3120 karl 1.12.2.5 buf.putUint32(msg->maxObjectCount);
|
3121 karl 1.12.2.1 buf.putUint32Arg(msg->operationTimeout);
3122 buf.putString(msg->filterQueryLanguage);
3123 buf.putString(msg->filterQuery);
3124 }
|
3125 mike 1.1
|
3126 karl 1.12.2.1 static CIMOpenEnumerateInstancesRequestMessage*
3127 _decodeOpenEnumerateInstancesRequest(
3128 CIMBuffer& in,
|
3129 mike 1.1 Uint32 queueId,
|
3130 karl 1.12.2.1 Uint32 returnQueueId,
3131 Uint32 flags,
3132 const String& messageId)
|
3133 mike 1.1 {
|
3134 karl 1.12.2.1 /* See ../Server/CIMOperationRequestDecoder.cpp */
|
3135 mike 1.1
|
3136 karl 1.12.2.1 STAT_GETSTARTTIME
|
3137 mike 1.1
|
3138 karl 1.12.2.1 Boolean deepInheritance = flags & DEEP_INHERITANCE;
3139 Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
3140 Boolean continueOnError = flags & CONTINUE_ON_ERROR;
|
3141 mike 1.1
|
3142 karl 1.12.2.1 // [NAMESPACE]
3143 CIMNamespaceName nameSpace;
3144 if (!in.getNamespaceName(nameSpace))
|
3145 mike 1.1 return 0;
3146
|
3147 karl 1.12.2.1 // [CLASSNAME]
3148 CIMName className;
3149 if (!in.getName(className))
3150 return 0;
|
3151 mike 1.1
|
3152 karl 1.12.2.1 // [PROPERTY-LIST]
3153 CIMPropertyList propertyList;
3154 if (!in.getPropertyList(propertyList))
3155 return 0;
|
3156 mike 1.1
|
3157 karl 1.12.2.1 // These can all be one common function.
|
3158 karl 1.12.2.5 Uint32 maxObjectCount;
3159 if (!in.getUint32(maxObjectCount))
|
3160 karl 1.12.2.1 return 0;
3161 Uint32Arg operationTimeout;
3162 if (!in.getUint32Arg(operationTimeout))
3163 return 0;
3164 String filterQueryLanguage;
3165 if (!in.getString(filterQueryLanguage))
3166 return 0;
3167 String filterQuery;
3168 if (!in.getString(filterQuery))
3169 return 0;
3170
3171 AutoPtr<CIMOpenEnumerateInstancesRequestMessage> request(
3172 new CIMOpenEnumerateInstancesRequestMessage(
3173 messageId,
3174 nameSpace,
3175 className,
3176 deepInheritance,
3177 includeClassOrigin,
3178 propertyList,
3179 filterQueryLanguage,
3180 filterQuery,
3181 karl 1.12.2.1 operationTimeout,
3182 continueOnError,
3183 maxObjectCount,
3184 QueueIdStack(queueId, returnQueueId)));
3185
3186 request->binaryRequest = true;
3187
3188 STAT_SERVERSTART
3189
3190 return request.release();
3191 }
|
3192 karl 1.12.2.4
|
3193 karl 1.12.2.1 // For the pull Response messages the interface is the message and the,
3194 // not just the responseData.
3195 static void _encodeOpenEnumerateInstancesResponseBody(
3196 CIMBuffer& out,
3197 CIMOpenEnumerateInstancesResponseMessage* msg,
3198 CIMResponseData& data,
3199 CIMName& name)
|
3200 mike 1.1 {
|
3201 karl 1.12.2.1 /* See ../Server/CIMOperationResponseEncoder.cpp */
|
3202 mike 1.1
|
3203 karl 1.12.2.1 static const CIMName NAME("OpenEnumerateInstances");
3204 name = NAME;
3205
3206 // [endOfSequence]
3207 out.putBoolean(msg->endOfSequence);
3208
3209 // [enumerationContext]
3210 out.putString(msg->enumerationContext);
3211
3212 data.encodeBinaryResponse(out);
|
3213 r.kieninger 1.9 }
3214
|
3215 karl 1.12.2.1 static CIMOpenEnumerateInstancesResponseMessage*
3216 _decodeOpenEnumerateInstancesResponse(
3217 CIMBuffer& in,
3218 const String& messageId)
|
3219 r.kieninger 1.9 {
|
3220 karl 1.12.2.1 CIMException cimException;
3221
3222 // KS_TODO Should we set validation???
|
3223 karl 1.12 // Turn on validation: This is a debugging tool
|
3224 karl 1.12.2.1 //#if defined(ENABLE_VALIDATION)
3225 // buf.setValidate(true);
3226 //#endif
|
3227 mike 1.1
|
3228 karl 1.12.2.1 Boolean endOfSequence;
3229 if (!in.getBoolean(endOfSequence))
3230 return 0;
|
3231 mike 1.1
|
3232 karl 1.12.2.1 String enumerationContext;
3233 if (!in.getString(enumerationContext))
|
3234 mike 1.1 return 0;
3235
|
3236 karl 1.12.2.1 CIMOpenEnumerateInstancesResponseMessage* msg =
3237 new CIMOpenEnumerateInstancesResponseMessage(
3238 messageId,
3239 cimException,
3240 endOfSequence,
3241 enumerationContext,
3242 QueueIdStack());
|
3243 mike 1.1
|
3244 karl 1.12.2.1 // Instead of resolving the binary data here, we delegate this
3245 // to a later point in time when the data is actually retrieved through
3246 // a call to CIMResponseData::getInstances, which
3247 // resolves the binary data as it is passed to the next interface.
3248 // This allows an alternate client implementation to gain direct access
3249 // to the binary data and pass this for example to the JNI implementation
3250 // of the JSR48 CIM Client for Java.
3251 CIMResponseData& responseData = msg->getResponseData();
3252 responseData.setRemainingBinaryData(in);
3253
3254 msg->binaryRequest=true;
3255 return msg;
3256 }
|
3257 karl 1.12.2.4
|
3258 karl 1.12.2.1 //==============================================================================
3259 //
3260 // OpenEnumerateInstancesPaths
3261 //
3262 //==============================================================================
3263
3264 static void _encodeOpenEnumerateInstancePathsRequest(
3265 CIMBuffer& buf,
3266 CIMOpenEnumerateInstancePathsRequestMessage* msg,
3267 CIMName& name)
3268 {
3269 /* See ../Client/CIMOperationRequestEncoder.cpp */
3270
3271 static const CIMName NAME("OpenEnumerateInstancePaths");
3272 name = NAME;
3273
3274 // [HEADER]
3275
3276 Uint32 flags = 0;
3277
3278 if (msg->continueOnError)
3279 karl 1.12.2.1 flags |= CONTINUE_ON_ERROR;
3280
3281 _putHeader(buf, flags, msg->messageId, OP_OpenEnumerateInstancePaths);
3282
3283 // [NAMESPACE]
3284 buf.putNamespaceName(msg->nameSpace);
3285
3286 // [CLASSNAME]
3287 buf.putName(msg->className);
3288
|
3289 karl 1.12.2.5 buf.putUint32(msg->maxObjectCount);
|
3290 karl 1.12.2.1 buf.putUint32Arg(msg->operationTimeout);
3291 buf.putString(msg->filterQueryLanguage);
3292 buf.putString(msg->filterQuery);
3293 }
3294
3295 static CIMOpenEnumerateInstancePathsRequestMessage*
3296 _decodeOpenEnumerateInstancePathsRequest(
3297 CIMBuffer& in,
3298 Uint32 queueId,
3299 Uint32 returnQueueId,
3300 Uint32 flags,
3301 const String& messageId)
3302 {
3303 /* See ../Server/CIMOperationRequestDecoder.cpp */
3304
3305 STAT_GETSTARTTIME
3306
3307 Boolean continueOnError = flags & CONTINUE_ON_ERROR;
3308
3309 // [NAMESPACE]
3310
3311 karl 1.12.2.1 CIMNamespaceName nameSpace;
3312 if (!in.getNamespaceName(nameSpace))
3313 return 0;
3314
3315 // [CLASSNAME]
3316 CIMName className;
3317 if (!in.getName(className))
3318 return 0;
3319
3320 // These can all be one common function.
3321
|
3322 karl 1.12.2.5 Uint32 maxObjectCount;
3323 if (!in.getUint32(maxObjectCount))
|
3324 karl 1.12.2.1 return 0;
3325 Uint32Arg operationTimeout;
3326 if (!in.getUint32Arg(operationTimeout))
3327 return 0;
3328 String filterQueryLanguage;
3329 if (!in.getString(filterQueryLanguage))
3330 return 0;
3331 String filterQuery;
3332 if (!in.getString(filterQuery))
3333 return 0;
3334
3335 AutoPtr<CIMOpenEnumerateInstancePathsRequestMessage> request(
3336 new CIMOpenEnumerateInstancePathsRequestMessage(
3337 messageId,
3338 nameSpace,
3339 className,
3340 filterQueryLanguage,
3341 filterQuery,
3342 operationTimeout,
3343 continueOnError,
3344 maxObjectCount,
3345 karl 1.12.2.1 QueueIdStack(queueId, returnQueueId)));
3346
3347 request->binaryRequest = true;
3348
3349 STAT_SERVERSTART
3350
3351 return request.release();
3352 }
3353
3354 // For the pull Response messages the interface is the message and the,
3355 // not just the responseData.
3356 static void _encodeOpenEnumerateInstancePathsResponseBody(
3357 CIMBuffer& out,
3358 CIMOpenEnumerateInstancePathsResponseMessage* msg,
3359 CIMResponseData& data,
3360 CIMName& name)
3361 {
3362 /* See ../Server/CIMOperationResponseEncoder.cpp */
3363
3364 static const CIMName NAME("OpenEnumerateInstancePaths");
3365 name = NAME;
3366 karl 1.12.2.1
3367 // [endOfSequence]
3368 out.putBoolean(msg->endOfSequence);
3369
3370 // [enumerationContext]
3371 out.putString(msg->enumerationContext);
3372
3373 data.encodeBinaryResponse(out);
3374 }
3375
3376 static CIMOpenEnumerateInstancePathsResponseMessage*
3377 _decodeOpenEnumerateInstancePathsResponse(
3378 CIMBuffer& in,
3379 const String& messageId)
3380 {
3381 CIMException cimException;
3382
3383 Boolean endOfSequence;
3384 if (!in.getBoolean(endOfSequence))
3385 return 0;
3386
3387 karl 1.12.2.1 String enumerationContext;
3388 if (!in.getString(enumerationContext))
3389 {
3390 return 0;
3391 }
3392 CIMOpenEnumerateInstancePathsResponseMessage* msg =
3393 new CIMOpenEnumerateInstancePathsResponseMessage(
3394 messageId,
3395 cimException,
3396 endOfSequence,
3397 enumerationContext,
3398 QueueIdStack());
3399
3400 // Instead of resolving the binary data here, we delegate this
3401 // to a later point in time when the data is actually retrieved through
3402 // a call to CIMResponseData::getInstanceNames, which
3403 // resolves the binary data as it is passed to the next interface.
3404 // This allows an alternate client implementation to gain direct access
3405 // to the binary data and pass this for example to the JNI implementation
3406 // of the JSR48 CIM Client for Java.
3407 CIMResponseData& responseData = msg->getResponseData();
3408 karl 1.12.2.1 responseData.setRemainingBinaryData(in);
3409
3410 msg->binaryRequest=true;
3411 return msg;
3412 }
3413 //==============================================================================
3414 //
3415 // OpenReferenceInstances
3416 //
3417 //==============================================================================
3418
3419 static void _encodeOpenReferenceInstancesRequest(
3420 CIMBuffer& buf,
3421 CIMOpenReferenceInstancesRequestMessage* msg,
3422 CIMName& name)
3423 {
3424 /* See ../Client/CIMOperationRequestEncoder.cpp */
3425
3426 static const CIMName NAME("OpenReferenceInstances");
3427 name = NAME;
3428
3429 karl 1.12.2.1 // [HEADER]
3430
3431 Uint32 flags = 0;
3432
3433 if (msg->includeClassOrigin)
3434 flags |= INCLUDE_CLASS_ORIGIN;
3435
3436 if (msg->continueOnError)
3437 flags |= CONTINUE_ON_ERROR;
3438
3439 _putHeader(buf, flags, msg->messageId, OP_OpenReferenceInstances);
3440
3441 // [NAMESPACE]
3442 buf.putNamespaceName(msg->nameSpace);
3443
3444 // [OBJECT-NAME]
3445 buf.putObjectPath(msg->objectName);
3446
3447 // [RESULT-CLASS]
3448 buf.putName(msg->resultClass);
3449
3450 karl 1.12.2.1 // [ROLE]
3451 buf.putString(msg->role);
3452
3453 // [PROPERTY-LIST]
3454 buf.putPropertyList(msg->propertyList);
3455
|
3456 karl 1.12.2.5 buf.putUint32(msg->maxObjectCount);
|
3457 karl 1.12.2.1 buf.putUint32Arg(msg->operationTimeout);
3458 buf.putString(msg->filterQueryLanguage);
3459 buf.putString(msg->filterQuery);
3460 }
3461
3462 static CIMOpenReferenceInstancesRequestMessage*
3463 _decodeOpenReferenceInstancesRequest(
3464 CIMBuffer& in,
3465 Uint32 queueId,
3466 Uint32 returnQueueId,
3467 Uint32 flags,
3468 const String& messageId)
3469 {
3470 /* See ../Server/CIMOperationRequestDecoder.cpp */
3471
3472 STAT_GETSTARTTIME
3473
3474 Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
3475 Boolean continueOnError = flags & CONTINUE_ON_ERROR;
3476
3477 // [NAMESPACE]
3478 karl 1.12.2.1
3479 CIMNamespaceName nameSpace;
3480 if (!in.getNamespaceName(nameSpace))
3481 return 0;
3482
3483 // [OBJECT-NAME]
3484
3485 CIMObjectPath objectName;
3486
3487 if (!in.getObjectPath(objectName))
3488 return 0;
3489
3490 // [RESULT-CLASS]
3491
3492 CIMName resultClass;
3493
3494 if (!in.getName(resultClass))
3495 return 0;
3496
3497 // [ROLE]
3498
3499 karl 1.12.2.1 String role;
3500
3501 if (!in.getString(role))
3502 return 0;
3503
3504 // [PROPERTY-LIST]
3505 CIMPropertyList propertyList;
3506 if (!in.getPropertyList(propertyList))
3507 return 0;
3508
3509 // These can all be one common function.
|
3510 karl 1.12.2.5 Uint32 maxObjectCount;
3511 if (!in.getUint32(maxObjectCount))
|
3512 karl 1.12.2.1 return 0;
3513 Uint32Arg operationTimeout;
3514 if (!in.getUint32Arg(operationTimeout))
3515 return 0;
3516 String filterQueryLanguage;
3517 if (!in.getString(filterQueryLanguage))
3518 return 0;
3519 String filterQuery;
3520 if (!in.getString(filterQuery))
3521 return 0;
3522
3523 AutoPtr<CIMOpenReferenceInstancesRequestMessage> request(
3524 new CIMOpenReferenceInstancesRequestMessage(
3525 messageId,
3526 nameSpace,
3527 objectName,
3528 resultClass,
3529 role,
3530 includeClassOrigin,
3531 propertyList,
3532 filterQueryLanguage,
3533 karl 1.12.2.1 filterQuery,
3534 operationTimeout,
3535 continueOnError,
3536 maxObjectCount,
3537 QueueIdStack(queueId, returnQueueId)));
3538
3539 request->binaryRequest = true;
3540
3541 STAT_SERVERSTART
3542
3543 return request.release();
3544 }
3545 // For the pull Response messages the interface is the message and the,
3546 // not just the responseData.
3547 static void _encodeOpenReferenceInstancesResponseBody(
3548 CIMBuffer& out,
3549 CIMOpenReferenceInstancesResponseMessage* msg,
3550 CIMResponseData& data,
3551 CIMName& name)
3552 {
3553 /* See ../Server/CIMOperationResponseEncoder.cpp */
3554 karl 1.12.2.1
3555 static const CIMName NAME("OpenReferenceInstances");
3556 name = NAME;
3557
3558 // [endOfSequence]
3559 out.putBoolean(msg->endOfSequence);
3560
3561 // [enumerationContext]
3562 out.putString(msg->enumerationContext);
3563
3564 data.encodeBinaryResponse(out);
3565 }
3566
3567 static CIMOpenReferenceInstancesResponseMessage*
3568 _decodeOpenReferenceInstancesResponse(
3569 CIMBuffer& in,
3570 const String& messageId)
3571 {
3572 CIMException cimException;
3573
3574 Boolean endOfSequence;
3575 karl 1.12.2.1 if (!in.getBoolean(endOfSequence))
3576 return 0;
3577
3578 String enumerationContext;
3579 if (!in.getString(enumerationContext))
3580 return 0;
3581
3582 CIMOpenReferenceInstancesResponseMessage* msg =
|
3583 karl 1.12.2.3 new CIMOpenReferenceInstancesResponseMessage(
|
3584 karl 1.12.2.1 messageId,
3585 cimException,
3586 endOfSequence,
3587 enumerationContext,
3588 QueueIdStack());
3589
3590 // Instead of resolving the binary data here, we delegate this
3591 // to a later point in time when the data is actually retrieved through
3592 // a call to CIMResponseData::getInstances, which
3593 // resolves the binary data is passed to the next interface.
3594 // This allows an alternate client implementation to gain direct access
3595 // to the binary data and pass this for example to the JNI implementation
3596 // of the JSR48 CIM Client for Java.
3597 CIMResponseData& responseData = msg->getResponseData();
3598 responseData.setRemainingBinaryData(in);
3599
3600 msg->binaryRequest=true;
3601 return msg;
3602 }
3603 //==============================================================================
3604 //
3605 karl 1.12.2.1 // OpenReferenceInstancePaths
3606 //
3607 //==============================================================================
3608
3609 static void _encodeOpenReferenceInstancePathsRequest(
3610 CIMBuffer& buf,
3611 CIMOpenReferenceInstancePathsRequestMessage* msg,
3612 CIMName& name)
3613 {
3614 /* See ../Client/CIMOperationRequestEncoder.cpp */
3615
3616 static const CIMName NAME("OpenReferenceInstancePaths");
3617 name = NAME;
3618
3619 // [HEADER]
3620
3621 Uint32 flags = 0;
3622 if (msg->continueOnError)
3623 flags |= CONTINUE_ON_ERROR;
3624
3625 _putHeader(buf, flags, msg->messageId, OP_OpenReferenceInstancePaths);
3626 karl 1.12.2.1
3627 // [NAMESPACE]
3628 buf.putNamespaceName(msg->nameSpace);
3629
3630 // [OBJECT-NAME]
3631 buf.putObjectPath(msg->objectName);
3632
3633 // [RESULT-CLASS]
3634 buf.putName(msg->resultClass);
3635
3636 // [ROLE]
3637 buf.putString(msg->role);
3638
|
3639 karl 1.12.2.5 buf.putUint32(msg->maxObjectCount);
|
3640 karl 1.12.2.1 buf.putUint32Arg(msg->operationTimeout);
3641 buf.putString(msg->filterQueryLanguage);
3642 buf.putString(msg->filterQuery);
3643 }
3644
3645 static CIMOpenReferenceInstancePathsRequestMessage*
3646 _decodeOpenReferenceInstancePathsRequest(
3647 CIMBuffer& in,
3648 Uint32 queueId,
3649 Uint32 returnQueueId,
3650 Uint32 flags,
3651 const String& messageId)
3652 {
|
3653 karl 1.12.2.4 /* See ../
3654 Server/CIMOperationRequestDecoder.cpp */
|
3655 karl 1.12.2.1
3656 STAT_GETSTARTTIME
3657
3658 Boolean continueOnError = flags & CONTINUE_ON_ERROR;
3659
3660 // [NAMESPACE]
3661
3662 CIMNamespaceName nameSpace;
3663 if (!in.getNamespaceName(nameSpace))
3664 return 0;
3665
3666 // [OBJECT-NAME]
3667
3668 CIMObjectPath objectName;
3669 if (!in.getObjectPath(objectName))
3670 return 0;
3671
3672 // [RESULT-CLASS]
3673
3674 CIMName resultClass;
3675 if (!in.getName(resultClass))
3676 karl 1.12.2.1 return 0;
3677
3678 // [ROLE]
3679
3680 String role;
3681 if (!in.getString(role))
3682 return 0;
3683
3684 // These can all be one common function.
|
3685 karl 1.12.2.5 Uint32 maxObjectCount;
3686 if (!in.getUint32(maxObjectCount))
|
3687 karl 1.12.2.1 return 0;
3688 Uint32Arg operationTimeout;
3689 if (!in.getUint32Arg(operationTimeout))
3690 return 0;
3691 String filterQueryLanguage;
3692 if (!in.getString(filterQueryLanguage))
3693 return 0;
3694 String filterQuery;
3695 if (!in.getString(filterQuery))
3696 return 0;
3697
3698 AutoPtr<CIMOpenReferenceInstancePathsRequestMessage> request(
3699 new CIMOpenReferenceInstancePathsRequestMessage(
3700 messageId,
3701 nameSpace,
3702 objectName,
3703 resultClass,
3704 role,
3705 filterQueryLanguage,
3706 filterQuery,
3707 operationTimeout,
3708 karl 1.12.2.1 continueOnError,
3709 maxObjectCount,
3710 QueueIdStack(queueId, returnQueueId)));
3711
3712 request->binaryRequest = true;
3713
3714 STAT_SERVERSTART
3715
3716 return request.release();
3717 }
3718 // For the pull Response messages the interface is the message and the,
3719 // not just the responseData.
3720 static void _encodeOpenReferenceInstancePathsResponseBody(
3721 CIMBuffer& out,
3722 CIMOpenReferenceInstancePathsResponseMessage* msg,
3723 CIMResponseData& data,
3724 CIMName& name)
3725 {
3726 /* See ../Server/CIMOperationResponseEncoder.cpp */
3727
3728 static const CIMName NAME("OpenReferenceInstancePaths");
3729 karl 1.12.2.1 name = NAME;
3730
3731 // [endOfSequence]
3732 out.putBoolean(msg->endOfSequence);
3733
3734 // [enumerationContext]
3735 out.putString(msg->enumerationContext);
3736
3737 data.encodeBinaryResponse(out);
3738 }
3739
3740 static CIMOpenReferenceInstancePathsResponseMessage*
3741 _decodeOpenReferenceInstancePathsResponse(
3742 CIMBuffer& in,
3743 const String& messageId)
3744 {
3745 CIMException cimException;
3746
3747 Boolean endOfSequence;
3748 if (!in.getBoolean(endOfSequence))
3749 return 0;
3750 karl 1.12.2.1
3751 String enumerationContext;
3752 if (!in.getString(enumerationContext))
3753 return 0;
3754
3755 CIMOpenReferenceInstancePathsResponseMessage* msg =
3756 new CIMOpenReferenceInstancePathsResponseMessage(
3757 messageId,
3758 cimException,
3759 endOfSequence,
3760 enumerationContext,
3761 QueueIdStack());
3762
3763 // Instead of resolving the binary data right here, we delegate this
3764 // to a later point in time when the data is actually retrieved through
3765 // a call to getNamedInstances, which is going to resolve the binary
3766 // data when the callback function is registered.
3767 // This allows an alternate client implementation to gain direct access
3768 // to the binary data and pass this for example to the JNI implementation
3769 // of the JSR48 CIM Client for Java.
3770 CIMResponseData& responseData = msg->getResponseData();
3771 karl 1.12.2.1 responseData.setRemainingBinaryData(in);
3772
3773 msg->binaryRequest=true;
3774 return msg;
3775 }
3776
3777 //==============================================================================
3778 //
3779 // OpenAssociatorInstances
3780 //
3781 //==============================================================================
3782
3783 static void _encodeOpenAssociatorInstancesRequest(
3784 CIMBuffer& buf,
3785 CIMOpenAssociatorInstancesRequestMessage* msg,
3786 CIMName& name)
3787 {
3788 /* See ../Client/CIMOperationRequestEncoder.cpp */
3789
3790 static const CIMName NAME("OpenAssociatorInstances");
3791 name = NAME;
3792 karl 1.12.2.1
3793 // [HEADER]
3794
3795 Uint32 flags = 0;
3796
3797 if (msg->includeClassOrigin)
3798 flags |= INCLUDE_CLASS_ORIGIN;
3799
3800 if (msg->continueOnError)
3801 flags |= CONTINUE_ON_ERROR;
3802
3803 _putHeader(buf, flags, msg->messageId, OP_OpenAssociatorInstances);
3804
3805 // [NAMESPACE]
3806 buf.putNamespaceName(msg->nameSpace);
3807
3808 // [OBJECT-NAME]
3809 buf.putObjectPath(msg->objectName);
3810
3811 // [ASSOC-CLASS]
3812 buf.putName(msg->assocClass);
3813 karl 1.12.2.1
3814 // [RESULT-CLASS]
3815 buf.putName(msg->resultClass);
3816
3817 // [ROLE]
3818 buf.putString(msg->role);
3819
3820 // [RESULT-ROLE]
3821 buf.putString(msg->resultRole);
3822
3823 // [PROPERTY-LIST]
3824 buf.putPropertyList(msg->propertyList);
3825
|
3826 karl 1.12.2.5 buf.putUint32(msg->maxObjectCount);
|
3827 karl 1.12.2.1 buf.putUint32Arg(msg->operationTimeout);
3828 buf.putString(msg->filterQueryLanguage);
3829 buf.putString(msg->filterQuery);
3830 }
3831
3832 static CIMOpenAssociatorInstancesRequestMessage*
3833 _decodeOpenAssociatorInstancesRequest(
3834 CIMBuffer& in,
3835 Uint32 queueId,
3836 Uint32 returnQueueId,
3837 Uint32 flags,
3838 const String& messageId)
3839 {
3840 /* See ../Server/CIMOperationRequestDecoder.cpp */
3841
3842 STAT_GETSTARTTIME
3843
3844 Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
3845 Boolean continueOnError = flags & CONTINUE_ON_ERROR;
3846
3847 // [NAMESPACE]
3848 karl 1.12.2.1
3849 CIMNamespaceName nameSpace;
3850 if (!in.getNamespaceName(nameSpace))
3851 return 0;
3852
3853 // [OBJECT-NAME]
3854
3855 CIMObjectPath objectName;
3856
3857 if (!in.getObjectPath(objectName))
3858 return 0;
3859
3860 // [ASSOC-CLASS]
3861
3862 CIMName assocClass;
3863
3864 if (!in.getName(assocClass))
3865 return 0;
3866
3867 // [RESULT-CLASS]
3868
3869 karl 1.12.2.1 CIMName resultClass;
3870
3871 if (!in.getName(resultClass))
3872 return 0;
3873
3874 // [ROLE]
3875
3876 String role;
3877
3878 if (!in.getString(role))
3879 return 0;
3880
3881 // [RESULT-ROLE]
3882
3883 String resultRole;
3884
3885 if (!in.getString(resultRole))
3886 return 0;
3887
3888 // [PROPERTY-LIST]
3889 CIMPropertyList propertyList;
3890 karl 1.12.2.1 if (!in.getPropertyList(propertyList))
3891 return 0;
3892
3893 // These can all be one common function.
|
3894 karl 1.12.2.5 Uint32 maxObjectCount;
3895 if (!in.getUint32(maxObjectCount))
|
3896 karl 1.12.2.1 return 0;
3897 Uint32Arg operationTimeout;
3898 if (!in.getUint32Arg(operationTimeout))
3899 return 0;
3900 String filterQueryLanguage;
3901 if (!in.getString(filterQueryLanguage))
3902 return 0;
3903 String filterQuery;
3904 if (!in.getString(filterQuery))
3905 return 0;
3906
3907 AutoPtr<CIMOpenAssociatorInstancesRequestMessage> request(
3908 new CIMOpenAssociatorInstancesRequestMessage(
3909 messageId,
3910 nameSpace,
3911 objectName,
3912 assocClass,
3913 resultClass,
3914 role,
3915 resultRole,
3916 includeClassOrigin,
3917 karl 1.12.2.1 propertyList,
3918 filterQueryLanguage,
3919 filterQuery,
3920 operationTimeout,
3921 continueOnError,
3922 maxObjectCount,
3923 QueueIdStack(queueId, returnQueueId)));
3924
3925 request->binaryRequest = true;
3926
3927 STAT_SERVERSTART
3928
3929 return request.release();
3930 }
3931 // For the pull Response messages the interface is the message and the,
3932 // not just the responseData.
3933 static void _encodeOpenAssociatorInstancesResponseBody(
3934 CIMBuffer& out,
3935 CIMOpenAssociatorInstancesResponseMessage* msg,
3936 CIMResponseData& data,
3937 CIMName& name)
3938 karl 1.12.2.1 {
3939 /* See ../Server/CIMOperationResponseEncoder.cpp */
3940
3941 static const CIMName NAME("OpenAssociatorInstances");
3942 name = NAME;
3943
3944 // [endOfSequence]
3945 out.putBoolean(msg->endOfSequence);
3946
3947 // [enumerationContext]
3948 out.putString(msg->enumerationContext);
3949
3950 data.encodeBinaryResponse(out);
3951 }
3952
3953 static CIMOpenAssociatorInstancesResponseMessage*
3954 _decodeOpenAssociatorInstancesResponse(
3955 CIMBuffer& in,
3956 const String& messageId)
3957 {
3958 CIMException cimException;
3959 karl 1.12.2.1
3960 Boolean endOfSequence;
3961 if (!in.getBoolean(endOfSequence))
3962 return 0;
3963
3964 String enumerationContext;
3965 if (!in.getString(enumerationContext))
3966 return 0;
3967
3968 CIMOpenAssociatorInstancesResponseMessage* msg =
3969 new CIMOpenAssociatorInstancesResponseMessage(
3970 messageId,
3971 cimException,
3972 endOfSequence,
3973 enumerationContext,
3974 QueueIdStack());
3975
3976 // Instead of resolving the binary data right here, we delegate this
3977 // to a later point in time when the data is actually retrieved through
3978 // a call to getNamedInstances, which is going to resolve the binary
3979 // data when the callback function is registered.
3980 karl 1.12.2.1 // This allows an alternate client implementation to gain direct access
3981 // to the binary data and pass this for example to the JNI implementation
3982 // of the JSR48 CIM Client for Java.
3983 CIMResponseData& responseData = msg->getResponseData();
3984 responseData.setRemainingBinaryData(in);
3985
3986 msg->binaryRequest=true;
3987 return msg;
3988 }
3989
3990 //==============================================================================
3991 //
3992 // OpenAssociatorInstancePaths
3993 //
3994 //==============================================================================
3995
3996 static void _encodeOpenAssociatorInstancePathsRequest(
3997 CIMBuffer& buf,
3998 CIMOpenAssociatorInstancePathsRequestMessage* msg,
3999 CIMName& name)
4000 {
4001 karl 1.12.2.1 /* See ../Client/CIMOperationRequestEncoder.cpp */
4002
4003 static const CIMName NAME("OpenAssociatorInstancePaths");
4004 name = NAME;
4005
4006 // [HEADER]
4007
4008 Uint32 flags = 0;
4009
4010 if (msg->continueOnError)
4011 flags |= CONTINUE_ON_ERROR;
4012
4013 _putHeader(buf, flags, msg->messageId, OP_OpenAssociatorInstancePaths);
4014
4015 // [NAMESPACE]
4016 buf.putNamespaceName(msg->nameSpace);
4017
4018 // [OBJECT-NAME]
4019 buf.putObjectPath(msg->objectName);
4020
4021 // [ASSOC-CLASS]
4022 karl 1.12.2.1 buf.putName(msg->assocClass);
4023
4024 // [RESULT-CLASS]
4025 buf.putName(msg->resultClass);
4026
4027 // [ROLE]
4028 buf.putString(msg->role);
4029
4030 // [RESULT-ROLE]
4031 buf.putString(msg->resultRole);
4032
|
4033 karl 1.12.2.5 buf.putUint32(msg->maxObjectCount);
|
4034 karl 1.12.2.1 buf.putUint32Arg(msg->operationTimeout);
4035 buf.putString(msg->filterQueryLanguage);
4036 buf.putString(msg->filterQuery);
4037 }
4038
4039 static CIMOpenAssociatorInstancePathsRequestMessage*
4040 _decodeOpenAssociatorInstancePathsRequest(
4041 CIMBuffer& in,
4042 Uint32 queueId,
4043 Uint32 returnQueueId,
4044 Uint32 flags,
4045 const String& messageId)
4046 {
4047 /* See ../Server/CIMOperationRequestDecoder.cpp */
4048
4049 STAT_GETSTARTTIME
4050
4051 Boolean continueOnError = flags & CONTINUE_ON_ERROR;
4052
4053 // [NAMESPACE]
4054
4055 karl 1.12.2.1 CIMNamespaceName nameSpace;
4056 if (!in.getNamespaceName(nameSpace))
4057 return 0;
4058
4059 // [OBJECT-NAME]
4060
4061 CIMObjectPath objectName;
4062 if (!in.getObjectPath(objectName))
4063 return 0;
4064
4065 // [ASSOC-CLASS]
4066
4067 CIMName assocClass;
4068 if (!in.getName(assocClass))
4069 return 0;
4070
4071 // [RESULT-CLASS]
4072
4073 CIMName resultClass;
4074 if (!in.getName(resultClass))
4075 return 0;
4076 karl 1.12.2.1
4077 // [ROLE]
4078
4079 String role;
4080 if (!in.getString(role))
4081 return 0;
4082
4083 // [RESULT-ROLE]
4084
4085 String resultRole;
4086 if (!in.getString(resultRole))
4087 return 0;
4088
4089 // These can all be one common function.
|
4090 karl 1.12.2.5 Uint32 maxObjectCount;
4091 if (!in.getUint32(maxObjectCount))
|
4092 karl 1.12.2.1 return 0;
4093 Uint32Arg operationTimeout;
4094 if (!in.getUint32Arg(operationTimeout))
4095 return 0;
4096 String filterQueryLanguage;
4097 if (!in.getString(filterQueryLanguage))
4098 return 0;
4099 String filterQuery;
4100 if (!in.getString(filterQuery))
4101 return 0;
4102
4103 AutoPtr<CIMOpenAssociatorInstancePathsRequestMessage> request(
4104 new CIMOpenAssociatorInstancePathsRequestMessage(
4105 messageId,
4106 nameSpace,
4107 objectName,
4108 assocClass,
4109 resultClass,
4110 role,
4111 resultRole,
4112 filterQueryLanguage,
4113 karl 1.12.2.1 filterQuery,
4114 operationTimeout,
4115 continueOnError,
4116 maxObjectCount,
4117 QueueIdStack(queueId, returnQueueId)));
4118
4119 request->binaryRequest = true;
4120
4121 STAT_SERVERSTART
4122
4123 return request.release();
4124 }
4125
4126 static void _encodeOpenAssociatorInstancePathsResponseBody(
4127 CIMBuffer& out,
4128 CIMOpenAssociatorInstancePathsResponseMessage* msg,
4129 CIMResponseData& data,
4130 CIMName& name)
4131 {
4132 /* See ../Server/CIMOperationResponseEncoder.cpp */
4133
4134 karl 1.12.2.1 static const CIMName NAME("OpenAssociatorInstancePaths");
4135 name = NAME;
4136
4137 // [endOfSequence]
4138 out.putBoolean(msg->endOfSequence);
4139
4140 // [enumerationContext]
4141 out.putString(msg->enumerationContext);
4142
4143 data.encodeBinaryResponse(out);
4144 }
4145
4146 static CIMOpenAssociatorInstancePathsResponseMessage*
4147 _decodeOpenAssociatorInstancePathsResponse(
4148 CIMBuffer& in,
4149 const String& messageId)
4150 {
4151 CIMException cimException;
4152
4153 Boolean endOfSequence;
4154 if (!in.getBoolean(endOfSequence))
4155 karl 1.12.2.1 return 0;
4156
4157 String enumerationContext;
4158 if (!in.getString(enumerationContext))
4159 return 0;
4160
4161 CIMOpenAssociatorInstancePathsResponseMessage* msg =
4162 new CIMOpenAssociatorInstancePathsResponseMessage(
4163 messageId,
4164 cimException,
4165 endOfSequence,
4166 enumerationContext,
4167 QueueIdStack());
4168
4169 // Instead of resolving the binary data right here, we delegate this
4170 // to a later point in time when the data is actually retrieved through
4171 // a call to getNamedInstances, which is going to resolve the binary
4172 // data when the callback function is registered.
4173 // This allows an alternate client implementation to gain direct access
4174 // to the binary data and pass this for example to the JNI implementation
4175 // of the JSR48 CIM Client for Java.
4176 karl 1.12.2.1 CIMResponseData& responseData = msg->getResponseData();
4177 responseData.setRemainingBinaryData(in);
4178
4179 msg->binaryRequest=true;
4180 return msg;
4181 }
4182
4183 //==============================================================================
4184 //
4185 // PullInstancesWithPath
4186 //
4187 //==============================================================================
4188
4189 static void _encodePullInstancesWithPathRequest(
4190 CIMBuffer& buf,
4191 CIMPullInstancesWithPathRequestMessage* msg,
4192 CIMName& name)
4193 {
4194 /* See ../Client/CIMOperationRequestEncoder.cpp */
4195
4196 static const CIMName NAME("PullInstancesWithPath");
4197 karl 1.12.2.1 name = NAME;
4198
4199 // [HEADER]
4200
4201 Uint32 flags = 0;
4202
4203 _putHeader(buf, flags, msg->messageId, OP_PullInstancesWithPath);
4204
4205 // [NAMESPACE]
4206 buf.putNamespaceName(msg->nameSpace);
4207
4208 // [EnumerationContext]
4209 buf.putString(msg->enumerationContext);
4210
|
4211 karl 1.12.2.5 buf.putUint32(msg->maxObjectCount);
|
4212 karl 1.12.2.1 }
4213
4214 static CIMPullInstancesWithPathRequestMessage*
4215 _decodePullInstancesWithPathRequest(
4216 CIMBuffer& in,
4217 Uint32 queueId,
4218 Uint32 returnQueueId,
4219 Uint32 flags,
4220 const String& messageId)
4221 {
4222 /* See ../Server/CIMOperationRequestDecoder.cpp */
4223
4224 STAT_GETSTARTTIME
4225
4226 // [NAMESPACE]
4227
4228 CIMNamespaceName nameSpace;
4229 if (!in.getNamespaceName(nameSpace))
4230 return 0;
4231
4232 // [EnumerationContext]
4233 karl 1.12.2.1 String enumerationContext;
4234 if (!in.getString(enumerationContext))
4235 {
4236 return 0;
4237 }
4238
4239 // [MACTCOUNT]
|
4240 karl 1.12.2.5 Uint32 maxObjectCount;
4241 if (!in.getUint32(maxObjectCount))
|
4242 karl 1.12.2.1 return 0;
4243
4244 AutoPtr<CIMPullInstancesWithPathRequestMessage> request(
4245 new CIMPullInstancesWithPathRequestMessage(
4246 messageId,
4247 nameSpace,
4248 enumerationContext,
4249 maxObjectCount,
4250 QueueIdStack(queueId, returnQueueId)));
4251
4252 request->binaryRequest = true;
4253
4254 STAT_SERVERSTART
4255
4256 return request.release();
4257 }
4258
4259 // For the pull Response messages the interface is the message and the,
4260 // not just the responseData.
4261 static void _encodePullInstancesWithPathResponseBody(
4262 CIMBuffer& out,
4263 karl 1.12.2.1 CIMPullInstancesWithPathResponseMessage* msg,
4264 CIMResponseData& data,
4265 CIMName& name)
4266 {
4267 /* See ../Server/CIMOperationResponseEncoder.cpp */
4268
4269 static const CIMName NAME("PullInstancesWithPath");
4270 name = NAME;
4271 // [endOfSequence]
4272 out.putBoolean(msg->endOfSequence);
4273
4274 // [enumerationContext]
4275 out.putString(msg->enumerationContext);
4276
4277 data.encodeBinaryResponse(out);
4278 }
4279
4280 static CIMPullInstancesWithPathResponseMessage*
4281 _decodePullInstancesWithPathResponse(
4282 CIMBuffer& in,
4283 const String& messageId)
4284 karl 1.12.2.1 {
4285 CIMException cimException;
4286
4287 Boolean endOfSequence;
4288 if (!in.getBoolean(endOfSequence))
4289 return 0;
4290
4291 String enumerationContext;
4292 if (!in.getString(enumerationContext))
4293 return 0;
4294
4295 CIMPullInstancesWithPathResponseMessage* msg =
4296 new CIMPullInstancesWithPathResponseMessage(
4297 messageId,
4298 cimException,
4299 endOfSequence,
4300 enumerationContext,
4301 QueueIdStack());
4302
4303 // Instead of resolving the binary data right here, we delegate this
4304 // to a later point in time when the data is actually retrieved through
4305 karl 1.12.2.1 // a call to getNamedInstances, which is going to resolve the binary
4306 // data when the callback function is registered.
4307 // This allows an alternate client implementation to gain direct access
4308 // to the binary data and pass this for example to the JNI implementation
4309 // of the JSR48 CIM Client for Java.
4310 CIMResponseData& responseData = msg->getResponseData();
4311 responseData.setRemainingBinaryData(in);
4312
4313 msg->binaryRequest=true;
4314 return msg;
4315 }
4316 //==============================================================================
4317 //
4318 // PullInstancePaths
4319 //
4320 //==============================================================================
4321
4322 static void _encodePullInstancePathsRequest(
4323 CIMBuffer& buf,
4324 CIMPullInstancePathsRequestMessage* msg,
4325 CIMName& name)
4326 karl 1.12.2.1 {
4327 /* See ../Client/CIMOperationRequestEncoder.cpp */
4328
4329 static const CIMName NAME("PullInstancePaths");
4330 name = NAME;
4331
4332 // [HEADER]
4333
4334 Uint32 flags = 0;
4335
4336 _putHeader(buf, flags, msg->messageId, OP_PullInstancePaths);
4337
4338 // [NAMESPACE]
4339 buf.putNamespaceName(msg->nameSpace);
4340
4341 // [EnumerationContext]
4342 buf.putString(msg->enumerationContext);
4343
|
4344 karl 1.12.2.5 buf.putUint32(msg->maxObjectCount);
|
4345 karl 1.12.2.1 }
4346
4347 static CIMPullInstancePathsRequestMessage*
4348 _decodePullInstancePathsRequest(
4349 CIMBuffer& in,
4350 Uint32 queueId,
4351 Uint32 returnQueueId,
4352 Uint32 flags,
4353 const String& messageId)
4354 {
4355 /* See ../Server/CIMOperationRequestDecoder.cpp */
4356
4357 STAT_GETSTARTTIME
4358
4359 // [NAMESPACE]
4360
4361 CIMNamespaceName nameSpace;
4362 if (!in.getNamespaceName(nameSpace))
4363 return 0;
4364
4365 // [EnumerationContext]
4366 karl 1.12.2.1 String enumerationContext;
4367 if (!in.getString(enumerationContext))
4368 {
4369 return 0;
4370 }
4371
4372 // [MAXOBJECTCOUNT]
|
4373 karl 1.12.2.5 Uint32 maxObjectCount;
4374 if (!in.getUint32(maxObjectCount))
|
4375 karl 1.12.2.1 return 0;
4376
4377 AutoPtr<CIMPullInstancePathsRequestMessage> request(
4378 new CIMPullInstancePathsRequestMessage(
4379 messageId,
4380 nameSpace,
4381 enumerationContext,
4382 maxObjectCount,
4383 QueueIdStack(queueId, returnQueueId)));
4384
4385 request->binaryRequest = true;
4386
4387 STAT_SERVERSTART
4388
4389 return request.release();
4390 }
4391
4392 // For the pull Response messages the interface is the message and the,
4393 // not just the responseData.
4394 static void _encodePullInstancePathsResponseBody(
4395 CIMBuffer& out,
4396 karl 1.12.2.1 CIMPullInstancePathsResponseMessage* msg,
4397 CIMResponseData& data,
4398 CIMName& name)
4399 {
4400 /* See ../Server/CIMOperationResponseEncoder.cpp */
4401
4402 static const CIMName NAME("PullInstancePaths");
4403 name = NAME;
4404
4405 // [endOfSequence]
4406 out.putBoolean(msg->endOfSequence);
4407
4408 // [enumerationContext]
4409 out.putString(msg->enumerationContext);
4410
4411 data.encodeBinaryResponse(out);
4412 }
4413
4414 static CIMPullInstancePathsResponseMessage*
4415 _decodePullInstancePathsResponse(
4416 CIMBuffer& in,
4417 karl 1.12.2.1 const String& messageId)
4418 {
4419 CIMException cimException;
4420
4421 Boolean endOfSequence;
4422 if (!in.getBoolean(endOfSequence))
4423 return 0;
4424
4425 String enumerationContext;
4426 if (!in.getString(enumerationContext))
4427 return 0;
4428
4429 CIMPullInstancePathsResponseMessage* msg =
4430 new CIMPullInstancePathsResponseMessage(
4431 messageId,
4432 cimException,
4433 endOfSequence,
4434 enumerationContext,
4435 QueueIdStack());
4436
4437 // Instead of resolving the binary data right here, we delegate this
4438 karl 1.12.2.1 // to a later point in time when the data is actually retrieved through
4439 // a call to getNamedInstances, which is going to resolve the binary
4440 // data when the callback function is registered.
4441 // This allows an alternate client implementation to gain direct access
4442 // to the binary data and pass this for example to the JNI implementation
4443 // of the JSR48 CIM Client for Java.
4444 CIMResponseData& responseData = msg->getResponseData();
4445 responseData.setRemainingBinaryData(in);
4446
4447 msg->binaryRequest=true;
4448 return msg;
4449 }
4450 //==============================================================================
4451 //
4452 // CloseEnumeration
4453 //
4454 //==============================================================================
4455
4456 static void _encodeCloseEnumerationRequest(
4457 CIMBuffer& buf,
4458 CIMCloseEnumerationRequestMessage* msg,
4459 karl 1.12.2.1 CIMName& name)
4460 {
4461 /* See ../Client/CIMOperationRequestEncoder.cpp */
4462
4463 static const CIMName NAME("CloseEnumeration");
4464 name = NAME;
4465
4466 // [HEADER]
4467
4468 Uint32 flags = 0;
4469
4470 _putHeader(buf, flags, msg->messageId, OP_CloseEnumeration);
4471
4472 // [NAMESPACE]
4473 buf.putNamespaceName(msg->nameSpace);
4474
4475 // [EnumerationContext]
4476 buf.putString(msg->enumerationContext);
4477 }
4478
4479 static CIMCloseEnumerationRequestMessage* _decodeCloseEnumerationRequest(
4480 karl 1.12.2.1 CIMBuffer& in,
4481 Uint32 queueId,
4482 Uint32 returnQueueId,
4483 Uint32 flags,
4484 const String& messageId)
4485 {
4486 /* See ../Server/CIMOperationRequestDecoder.cpp */
4487
4488 STAT_GETSTARTTIME
4489
4490 // [NAMESPACE]
4491
4492 CIMNamespaceName nameSpace;
4493 if (!in.getNamespaceName(nameSpace))
4494 return 0;
4495
4496 // [EnumerationContext]
4497 String enumerationContext;
4498 if (!in.getString(enumerationContext))
4499 {
4500 return 0;
4501 karl 1.12.2.1 }
4502
4503 AutoPtr<CIMCloseEnumerationRequestMessage> request(
4504 new CIMCloseEnumerationRequestMessage(
4505 messageId,
4506 nameSpace,
4507 enumerationContext,
4508 QueueIdStack(queueId, returnQueueId)));
4509
4510 request->binaryRequest = true;
4511
4512 STAT_SERVERSTART
4513
4514 return request.release();
4515 }
4516
4517 static void _encodeCloseEnumerationResponseBody(
4518 CIMBuffer& out,
4519 CIMCloseEnumerationResponseMessage* msg,
4520 CIMName& name)
4521 {
4522 karl 1.12.2.1 /* See ../Server/CIMOperationResponseEncoder.cpp */
4523
4524 static const CIMName NAME("CloseEnumeration");
4525 name = NAME;
4526 }
4527
4528 static CIMCloseEnumerationResponseMessage*
4529 _decodeCloseEnumerationResponse(
4530 CIMBuffer& in,
4531 const String& messageId)
4532 {
4533 CIMException cimException;
4534
4535 CIMCloseEnumerationResponseMessage* msg =
4536 new CIMCloseEnumerationResponseMessage(
4537 messageId,
4538 cimException,
4539 QueueIdStack());
4540
4541 msg->binaryRequest=true;
4542 return msg;
4543 karl 1.12.2.1 }
4544 //==============================================================================
4545 //
4546 // EnumerationCount
4547 //
4548 //==============================================================================
4549
4550 static void _encodeEnumerationCountRequest(
4551 CIMBuffer& buf,
4552 CIMEnumerationCountRequestMessage* msg,
4553 CIMName& name)
4554 {
4555 /* See ../Client/CIMOperationRequestEncoder.cpp */
4556
4557 static const CIMName NAME("EnumerationCount");
4558 name = NAME;
4559
4560 // [HEADER]
4561 Uint32 flags = 0;
4562
4563 _putHeader(buf, flags, msg->messageId, OP_EnumerationCount);
4564 karl 1.12.2.1
4565 // [NAMESPACE]
4566 buf.putNamespaceName(msg->nameSpace);
4567
4568 // [EnumerationContext]
4569 buf.putString(msg->enumerationContext);
4570 }
4571
4572 static CIMEnumerationCountRequestMessage* _decodeEnumerationCountRequest(
4573 CIMBuffer& in,
4574 Uint32 queueId,
4575 Uint32 returnQueueId,
4576 Uint32 flags,
4577 const String& messageId)
4578 {
4579 /* See ../Server/CIMOperationRequestDecoder.cpp */
4580
4581 STAT_GETSTARTTIME
4582
4583 // [NAMESPACE]
4584
4585 karl 1.12.2.1 CIMNamespaceName nameSpace;
4586 if (!in.getNamespaceName(nameSpace))
4587 return 0;
4588
4589 // [EnumerationContext]
4590 String enumerationContext;
4591 if (!in.getString(enumerationContext))
4592 {
4593 return 0;
4594 }
4595
4596 AutoPtr<CIMEnumerationCountRequestMessage> request(
4597 new CIMEnumerationCountRequestMessage(
4598 messageId,
4599 nameSpace,
4600 enumerationContext,
4601 QueueIdStack(queueId, returnQueueId)));
4602
4603 request->binaryRequest = true;
4604
4605 STAT_SERVERSTART
4606 karl 1.12.2.1
4607 return request.release();
4608 }
4609
4610 static void _encodeEnumerationCountResponseBody(
4611 CIMBuffer& out,
4612 CIMEnumerationCountResponseMessage* msg,
4613 CIMName& name)
4614 {
4615 /* See ../Server/CIMOperationResponseEncoder.cpp */
4616
4617 static const CIMName NAME("EnumerationCount");
4618 name = NAME;
4619
4620 // [count]
4621 out.putUint64Arg(msg->count);
4622 }
4623
4624 static CIMEnumerationCountResponseMessage*
4625 _decodeEnumerationCountResponse(
4626 CIMBuffer& in,
4627 karl 1.12.2.1 const String& messageId)
4628 {
4629 CIMException cimException;
4630 Uint64 count;
4631 if (!in.getUint64(count))
4632 return 0;
4633
4634 CIMEnumerationCountResponseMessage* msg =
4635 new CIMEnumerationCountResponseMessage(
4636 messageId,
4637 cimException,
4638 QueueIdStack(),
4639 count);
4640
4641 msg->binaryRequest=true;
4642 return msg;
4643 }
4644
|
4645 karl 1.12.2.4 // EXP_PULL_END
|
4646 karl 1.12.2.1
4647
4648 //==============================================================================
4649 //
4650 // BinaryCodec::hexDump()
4651 //
4652 //==============================================================================
4653
4654 #if defined(PEGASUS_DEBUG)
4655
4656 void BinaryCodec::hexDump(const void* data, size_t size)
4657 {
4658 unsigned char* p = (unsigned char*)data;
4659 unsigned char buf[16];
4660 size_t n = 0;
4661
4662 for (size_t i = 0, col = 0; i < size; i++)
4663 {
4664 unsigned char c = p[i];
4665 buf[n++] = c;
4666
4667 karl 1.12.2.1 if (col == 0)
4668 printf("%06X ", (unsigned int)i);
4669
4670 printf("%02X ", c);
4671
4672 if (col + 1 == sizeof(buf) || i + 1 == size)
4673 {
4674 for (size_t j = col + 1; j < sizeof(buf); j++)
4675 printf(" ");
4676
4677 for (size_t j = 0; j < n; j++)
4678 {
4679 c = buf[j];
4680
4681 if (c >= ' ' && c <= '~')
4682 printf("%c", buf[j]);
4683 else
4684 printf(".");
4685 }
4686
4687 printf("\n");
4688 karl 1.12.2.1 n = 0;
4689 }
4690
4691 if (col + 1 == sizeof(buf))
4692 col = 0;
4693 else
4694 col++;
4695 }
4696
4697 printf("\n");
4698 }
4699
4700 #endif /* defined(PEGASUS_DEBUG) */
4701
4702 //==============================================================================
4703 //
4704 // BinaryCodec::decodeRequest()
4705 //
4706 //==============================================================================
4707
4708 CIMOperationRequestMessage* BinaryCodec::decodeRequest(
|
4709 karl 1.12.2.3 CIMBuffer& in,
|
4710 karl 1.12.2.1 Uint32 queueId,
4711 Uint32 returnQueueId)
4712 {
4713
4714 // Turn on validation:
4715 #if defined(ENABLE_VALIDATION)
|
4716 karl 1.12.2.3 in.setValidate(true);
|
4717 karl 1.12.2.1 #endif
4718
4719 Uint32 flags;
4720 String messageId;
4721 Operation operation;
4722
|
4723 karl 1.12.2.3
4724 if (!_getHeader(in, flags, messageId, operation))
|
4725 karl 1.12.2.1 {
4726 return 0;
4727 }
4728
4729 switch (operation)
4730 {
4731 case OP_EnumerateInstances:
4732 return _decodeEnumerateInstancesRequest(
|
4733 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4734 karl 1.12.2.1 case OP_EnumerateInstanceNames:
4735 return _decodeEnumerateInstanceNamesRequest(
|
4736 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4737 karl 1.12.2.1 case OP_GetInstance:
4738 return _decodeGetInstanceRequest(
|
4739 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4740 karl 1.12.2.1 case OP_CreateInstance:
4741 return _decodeCreateInstanceRequest(
|
4742 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4743 karl 1.12.2.1 case OP_ModifyInstance:
4744 return _decodeModifyInstanceRequest(
|
4745 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4746 karl 1.12.2.1 case OP_DeleteInstance:
4747 return _decodeDeleteInstanceRequest(
|
4748 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4749 karl 1.12.2.1 case OP_Associators:
4750 return _decodeAssociatorsRequest(
|
4751 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4752 karl 1.12.2.1 case OP_AssociatorNames:
4753 return _decodeAssociatorNamesRequest(
|
4754 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4755 karl 1.12.2.1 case OP_References:
4756 return _decodeReferencesRequest(
|
4757 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4758 karl 1.12.2.1 case OP_ReferenceNames:
4759 return _decodeReferenceNamesRequest(
|
4760 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4761 karl 1.12.2.1 case OP_GetClass:
4762 return _decodeGetClassRequest(
|
4763 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4764 karl 1.12.2.1 case OP_EnumerateClasses:
4765 return _decodeEnumerateClassesRequest(
|
4766 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4767 karl 1.12.2.1 case OP_EnumerateClassNames:
4768 return _decodeEnumerateClassNamesRequest(
|
4769 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4770 karl 1.12.2.1 case OP_CreateClass:
4771 return _decodeCreateClassRequest(
|
4772 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4773 karl 1.12.2.1 case OP_DeleteClass:
4774 return _decodeDeleteClassRequest(
|
4775 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4776 karl 1.12.2.1 case OP_ModifyClass:
4777 return _decodeModifyClassRequest(
|
4778 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4779 karl 1.12.2.1 case OP_SetQualifier:
4780 return _decodeSetQualifierRequest(
|
4781 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4782 karl 1.12.2.1 case OP_GetQualifier:
4783 return _decodeGetQualifierRequest(
|
4784 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4785 karl 1.12.2.1 case OP_DeleteQualifier:
4786 return _decodeDeleteQualifierRequest(
|
4787 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4788 karl 1.12.2.1 case OP_EnumerateQualifiers:
4789 return _decodeEnumerateQualifiersRequest(
|
4790 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4791 karl 1.12.2.1 case OP_GetProperty:
4792 return _decodeGetPropertyRequest(
|
4793 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4794 karl 1.12.2.1 case OP_SetProperty:
4795 return _decodeSetPropertyRequest(
|
4796 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4797 karl 1.12.2.1 case OP_InvokeMethod:
4798 return _decodeInvokeMethodRequest(
|
4799 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4800 karl 1.12.2.1 case OP_ExecQuery:
4801 return _decodeExecQueryRequest(
|
4802 karl 1.12.2.3 in, queueId, returnQueueId, messageId);
|
4803 karl 1.12.2.4 //EXP_PULL_BEGIN
|
4804 karl 1.12.2.1 case OP_OpenEnumerateInstances:
4805 return _decodeOpenEnumerateInstancesRequest(
|
4806 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4807 karl 1.12.2.1 break;
4808 case OP_OpenEnumerateInstancePaths:
4809 return _decodeOpenEnumerateInstancePathsRequest(
|
4810 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4811 karl 1.12.2.1 break;
4812 case OP_OpenReferenceInstances:
4813 return _decodeOpenReferenceInstancesRequest(
|
4814 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4815 karl 1.12.2.1 break;
4816 case OP_OpenReferenceInstancePaths:
4817 return _decodeOpenReferenceInstancePathsRequest(
|
4818 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4819 karl 1.12.2.1 break;
4820 case OP_OpenAssociatorInstances:
4821 return _decodeOpenAssociatorInstancesRequest(
|
4822 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4823 karl 1.12.2.1 break;
4824 case OP_OpenAssociatorInstancePaths:
4825 return _decodeOpenAssociatorInstancePathsRequest(
|
4826 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4827 karl 1.12.2.1 break;
4828 case OP_PullInstancesWithPath:
4829 return _decodePullInstancesWithPathRequest(
|
4830 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4831 karl 1.12.2.1 break;
4832 case OP_PullInstancePaths:
4833 return _decodePullInstancePathsRequest(
|
4834 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4835 karl 1.12.2.1 break;
4836 case OP_CloseEnumeration:
4837 return _decodeCloseEnumerationRequest(
|
4838 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4839 karl 1.12.2.1 break;
4840 case OP_EnumerationCount:
4841 return _decodeEnumerationCountRequest(
|
4842 karl 1.12.2.3 in, queueId, returnQueueId, flags, messageId);
|
4843 karl 1.12.2.1 break;
|
4844 karl 1.12.2.4 //EXP_PULL_END
|
4845 karl 1.12.2.1 default:
4846 // Unexpected message type
4847 PEGASUS_ASSERT(0);
4848 return 0;
4849 }
4850 }
4851
4852 //==============================================================================
4853 //
4854 // BinaryCodec::decodeResponse()
4855 //
4856 //==============================================================================
4857
4858 CIMResponseMessage* BinaryCodec::decodeResponse(
4859 const Buffer& in)
4860 {
4861 CIMBuffer buf((char*)in.getData(), in.size());
4862 CIMBufferReleaser buf_(buf);
4863
4864 return decodeResponse(buf);
4865 }
4866 karl 1.12.2.1
4867 CIMResponseMessage* BinaryCodec::decodeResponse(
4868 CIMBuffer& buf)
4869 {
|
4870 karl 1.12.2.3 // Turn on validation: This is a debugging tool
|
4871 karl 1.12.2.1 #if defined(ENABLE_VALIDATION)
4872 buf.setValidate(true);
4873 #endif
|
4874 karl 1.12.2.4
|
4875 karl 1.12.2.1 Uint32 flags;
4876 String messageId;
4877 Operation operation;
4878
4879 if (!_getHeader(buf, flags, messageId, operation))
4880 {
4881 throw CIMException(CIM_ERR_FAILED, "Corrupt binary message header");
4882 return 0;
4883 }
4884
4885 CIMResponseMessage* msg = 0;
4886
4887 switch (operation)
4888 {
4889 case OP_EnumerateInstances:
4890 msg = _decodeEnumerateInstancesResponse(buf, messageId);
4891 break;
4892 case OP_EnumerateInstanceNames:
4893 msg = _decodeEnumerateInstanceNamesResponse(buf, messageId);
4894 break;
4895 case OP_GetInstance:
|
4896 thilo.boehm 1.11 msg = _decodeGetInstanceResponse(buf, messageId);
|
4897 mike 1.1 break;
4898 case OP_CreateInstance:
|
4899 thilo.boehm 1.11 msg = _decodeCreateInstanceResponse(buf, messageId);
|
4900 mike 1.1 break;
4901 case OP_ModifyInstance:
|
4902 thilo.boehm 1.11 msg = _decodeModifyInstanceResponse(buf, messageId);
|
4903 mike 1.1 break;
4904 case OP_DeleteInstance:
|
4905 thilo.boehm 1.11 msg = _decodeDeleteInstanceResponse(messageId);
|
4906 mike 1.1 break;
4907 case OP_Associators:
|
4908 thilo.boehm 1.11 msg = _decodeAssociatorsResponse(buf, messageId);
|
4909 mike 1.1 break;
4910 case OP_AssociatorNames:
|
4911 thilo.boehm 1.11 msg = _decodeAssociatorNamesResponse(buf, messageId);
|
4912 mike 1.1 break;
4913 case OP_References:
|
4914 thilo.boehm 1.11 msg = _decodeReferencesResponse(buf, messageId);
|
4915 mike 1.1 break;
4916 case OP_ReferenceNames:
|
4917 thilo.boehm 1.11 msg = _decodeReferenceNamesResponse(buf, messageId);
|
4918 mike 1.1 break;
4919 case OP_GetClass:
|
4920 thilo.boehm 1.11 msg = _decodeGetClassResponse(buf, messageId);
|
4921 mike 1.1 break;
4922 case OP_EnumerateClasses:
|
4923 thilo.boehm 1.11 msg = _decodeEnumerateClassesResponse(buf, messageId);
|
4924 mike 1.1 break;
4925 case OP_EnumerateClassNames:
|
4926 thilo.boehm 1.11 msg = _decodeEnumerateClassNamesResponse(buf, messageId);
|
4927 mike 1.1 break;
4928 case OP_CreateClass:
|
4929 thilo.boehm 1.11 msg = _decodeCreateClassResponse(messageId);
|
4930 mike 1.1 break;
4931 case OP_DeleteClass:
|
4932 thilo.boehm 1.11 msg = _decodeDeleteClassResponse(messageId);
|
4933 mike 1.1 break;
4934 case OP_ModifyClass:
|
4935 thilo.boehm 1.11 msg = _decodeModifyClassResponse(messageId);
|
4936 mike 1.1 break;
4937 case OP_SetQualifier:
|
4938 thilo.boehm 1.11 msg = _decodeSetQualifierResponse(messageId);
|
4939 mike 1.1 break;
4940 case OP_GetQualifier:
|
4941 thilo.boehm 1.11 msg = _decodeGetQualifierResponse(buf, messageId);
|
4942 mike 1.1 break;
4943 case OP_DeleteQualifier:
|
4944 thilo.boehm 1.11 msg = _decodeDeleteQualifierResponse(messageId);
|
4945 mike 1.1 break;
4946 case OP_EnumerateQualifiers:
|
4947 thilo.boehm 1.11 msg = _decodeEnumerateQualifiersResponse(buf, messageId);
|
4948 mike 1.1 break;
4949 case OP_GetProperty:
|
4950 thilo.boehm 1.11 msg = _decodeGetPropertyResponse(buf, messageId);
|
4951 mike 1.1 break;
4952 case OP_SetProperty:
|
4953 thilo.boehm 1.11 msg = _decodeSetPropertyResponse(messageId);
|
4954 mike 1.1 break;
4955 case OP_InvokeMethod:
|
4956 thilo.boehm 1.11 msg = _decodeInvokeMethodResponse(buf, messageId);
|
4957 mike 1.1 break;
4958 case OP_ExecQuery:
|
4959 thilo.boehm 1.11 msg = _decodeExecQueryResponse(buf, messageId);
|
4960 mike 1.1 break;
|
4961 karl 1.12.2.4 //EXP_PULL_BEGIN
|
4962 karl 1.12.2.1 case OP_OpenEnumerateInstances:
4963 msg = _decodeOpenEnumerateInstancesResponse(buf, messageId);
4964 break;
4965 case OP_OpenEnumerateInstancePaths:
4966 msg = _decodeOpenEnumerateInstancePathsResponse(buf, messageId);
4967 break;
4968 case OP_OpenReferenceInstances:
4969 msg = _decodeOpenReferenceInstancesResponse(buf, messageId);
4970 break;
4971 case OP_OpenReferenceInstancePaths:
4972 msg = _decodeOpenReferenceInstancePathsResponse(buf, messageId);
4973 break;
4974 case OP_OpenAssociatorInstances:
4975 msg = _decodeOpenAssociatorInstancesResponse(buf, messageId);
4976 break;
4977 case OP_OpenAssociatorInstancePaths:
4978 msg = _decodeOpenAssociatorInstancePathsResponse(buf, messageId);
4979 break;
4980 case OP_PullInstancesWithPath:
4981 msg = _decodePullInstancesWithPathResponse(buf, messageId);
4982 break;
4983 karl 1.12.2.1 case OP_PullInstancePaths:
4984 msg = _decodePullInstancePathsResponse(buf, messageId);
4985 break;
4986 case OP_CloseEnumeration:
4987 msg = _decodeCloseEnumerationResponse(buf, messageId);
4988 break;
|
4989 karl 1.12.2.4 //EXP_PULL_END
|
4990 mike 1.1 default:
4991 // Unexpected message type
|
4992 karl 1.12.2.5 PEGASUS_UNREACHABLE(PEGASUS_ASSERT(0);)
|
4993 mike 1.1 break;
4994 }
4995
4996 if (!msg)
|
4997 karl 1.12.2.3 throw CIMException(CIM_ERR_FAILED, "Received corrupted binary message");
|
4998 mike 1.1
4999 return msg;
5000 }
5001
5002 //==============================================================================
5003 //
5004 // BinaryCodec::formatSimpleIMethodRspMessage()
5005 //
5006 //==============================================================================
5007
5008 Buffer BinaryCodec::formatSimpleIMethodRspMessage(
5009 const CIMName& iMethodName,
5010 const String& messageId,
5011 HttpMethod httpMethod,
5012 const ContentLanguageList& httpContentLanguages,
|
5013 karl 1.12.2.1 const Buffer& rtnParams,
|
5014 mike 1.1 const Buffer& body,
5015 Uint64 serverResponseTime,
5016 Boolean isFirst,
|
5017 karl 1.12.2.5 Boolean)
|
5018 mike 1.1 {
5019 Buffer out;
|
5020 karl 1.12.2.3
|
5021 mike 1.1 if (isFirst == true)
5022 {
5023 // Write HTTP header:
|
5024 kumpf 1.6 XmlWriter::appendMethodResponseHeader(out, httpMethod,
|
5025 mike 1.1 httpContentLanguages, 0, serverResponseTime, true);
5026
|
5027 karl 1.12.2.3 for (size_t i=out.size(), k=CIMBuffer::round(i); i<k;i++)
5028 {
5029 out.append('\0');
5030 }
|
5031 mike 1.1 // Binary message header:
5032 CIMBuffer cb(128);
5033 _putHeader(cb, 0, messageId, _NameToOp(iMethodName));
5034 out.append(cb.getData(), cb.size());
5035 }
5036
5037 if (body.size() != 0)
5038 {
5039 out.append(body.getData(), body.size());
5040 }
|
5041 karl 1.12.2.1 // EXP_PULL TODO - TBD Review this.
5042 // If there are any parameters include them here.
5043 // Assumes that it is prebuilt with all components
5044 //
5045 if (rtnParams.size() != 0)
5046 {
5047 out << rtnParams;
5048 }
5049 //
5050 // //EXP_PULL_END
|
5051 mike 1.1
5052 return out;
5053 }
5054
5055 //==============================================================================
5056 //
5057 // BinaryCodec::encodeRequest()
5058 //
5059 //==============================================================================
5060
5061 bool BinaryCodec::encodeRequest(
5062 Buffer& out,
5063 const char* host,
5064 const String& authHeader,
5065 CIMOperationRequestMessage* msg,
5066 bool binaryResponse)
5067 {
5068 CIMBuffer buf;
5069 CIMName name;
5070
5071 switch (msg->getType())
5072 mike 1.1 {
5073 case CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE:
5074 {
5075 _encodeEnumerateInstancesRequest(buf,
5076 (CIMEnumerateInstancesRequestMessage*)msg, name);
5077 break;
5078 }
5079
5080 case CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE:
5081 {
5082 _encodeEnumerateInstanceNamesRequest(buf,
5083 (CIMEnumerateInstanceNamesRequestMessage*)msg, name);
5084 break;
5085 }
5086
5087 case CIM_GET_INSTANCE_REQUEST_MESSAGE:
5088 {
5089 _encodeGetInstanceRequest(buf,
5090 (CIMGetInstanceRequestMessage*)msg, name);
5091 break;
5092 }
5093 mike 1.1
5094 case CIM_CREATE_INSTANCE_REQUEST_MESSAGE:
5095 {
5096 _encodeCreateInstanceRequest(buf,
5097 (CIMCreateInstanceRequestMessage*)msg, name);
5098 break;
5099 }
5100
5101 case CIM_MODIFY_INSTANCE_REQUEST_MESSAGE:
5102 {
5103 _encodeModifyInstanceRequest(buf,
5104 (CIMModifyInstanceRequestMessage*)msg, name);
5105 break;
5106 }
5107
5108 case CIM_DELETE_INSTANCE_REQUEST_MESSAGE:
5109 {
5110 _encodeDeleteInstanceRequest(buf,
5111 (CIMDeleteInstanceRequestMessage*)msg, name);
5112 break;
5113 }
5114 mike 1.1
5115 case CIM_ASSOCIATORS_REQUEST_MESSAGE:
5116 {
5117 _encodeAssociatorsRequest(buf,
5118 (CIMAssociatorsRequestMessage*)msg, name);
5119 break;
5120 }
5121
5122 case CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE:
5123 {
5124 _encodeAssociatorNamesRequest(buf,
5125 (CIMAssociatorNamesRequestMessage*)msg, name);
5126 break;
5127 }
5128
5129 case CIM_REFERENCES_REQUEST_MESSAGE:
5130 {
5131 _encodeReferencesRequest(buf,
5132 (CIMReferencesRequestMessage*)msg, name);
5133 break;
5134 }
5135 mike 1.1
5136 case CIM_REFERENCE_NAMES_REQUEST_MESSAGE:
5137 {
5138 _encodeReferenceNamesRequest(buf,
5139 (CIMReferenceNamesRequestMessage*)msg, name);
5140 break;
5141 }
5142
5143 case CIM_GET_CLASS_REQUEST_MESSAGE:
5144 {
5145 _encodeGetClassRequest(buf,
5146 (CIMGetClassRequestMessage*)msg, name);
5147 break;
5148 }
5149
5150 case CIM_ENUMERATE_CLASSES_REQUEST_MESSAGE:
5151 {
5152 _encodeEnumerateClassesRequest(buf,
5153 (CIMEnumerateClassesRequestMessage*)msg, name);
5154 break;
5155 }
5156 mike 1.1
5157 case CIM_ENUMERATE_CLASS_NAMES_REQUEST_MESSAGE:
5158 {
5159 _encodeEnumerateClassNamesRequest(buf,
5160 (CIMEnumerateClassNamesRequestMessage*)msg, name);
5161 break;
5162 }
5163
5164 case CIM_CREATE_CLASS_REQUEST_MESSAGE:
5165 {
5166 _encodeCreateClassRequest(buf,
5167 (CIMCreateClassRequestMessage*)msg, name);
5168 break;
5169 }
5170
5171 case CIM_DELETE_CLASS_REQUEST_MESSAGE:
5172 {
5173 _encodeDeleteClassRequest(buf,
5174 (CIMDeleteClassRequestMessage*)msg, name);
5175 break;
5176 }
5177 mike 1.1
5178 case CIM_MODIFY_CLASS_REQUEST_MESSAGE:
5179 {
5180 _encodeModifyClassRequest(buf,
5181 (CIMModifyClassRequestMessage*)msg, name);
5182 break;
5183 }
5184
5185 case CIM_SET_QUALIFIER_REQUEST_MESSAGE:
5186 {
5187 _encodeSetQualifierRequest(buf,
5188 (CIMSetQualifierRequestMessage*)msg, name);
5189 break;
5190 }
5191
5192 case CIM_GET_QUALIFIER_REQUEST_MESSAGE:
5193 {
5194 _encodeGetQualifierRequest(buf,
5195 (CIMGetQualifierRequestMessage*)msg, name);
5196 break;
5197 }
5198 mike 1.1
5199 case CIM_DELETE_QUALIFIER_REQUEST_MESSAGE:
5200 {
5201 _encodeDeleteQualifierRequest(buf,
5202 (CIMDeleteQualifierRequestMessage*)msg, name);
5203 break;
5204 }
5205
5206 case CIM_ENUMERATE_QUALIFIERS_REQUEST_MESSAGE:
5207 {
5208 _encodeEnumerateQualifiersRequest(buf,
5209 (CIMEnumerateQualifiersRequestMessage*)msg, name);
5210 break;
5211 }
5212
5213 case CIM_GET_PROPERTY_REQUEST_MESSAGE:
5214 {
5215 _encodeGetPropertyRequest(buf,
5216 (CIMGetPropertyRequestMessage*)msg, name);
5217 break;
5218 }
5219 mike 1.1
5220 case CIM_SET_PROPERTY_REQUEST_MESSAGE:
5221 {
5222 _encodeSetPropertyRequest(buf,
5223 (CIMSetPropertyRequestMessage*)msg, name);
5224 break;
5225 }
5226
5227 case CIM_INVOKE_METHOD_REQUEST_MESSAGE:
5228 {
5229 _encodeInvokeMethodRequest(buf,
5230 (CIMInvokeMethodRequestMessage*)msg, name);
5231 break;
5232 }
5233
5234 case CIM_EXEC_QUERY_REQUEST_MESSAGE:
5235 {
5236 _encodeExecQueryRequest(buf,
5237 (CIMExecQueryRequestMessage*)msg, name);
5238 break;
5239 }
|
5240 karl 1.12.2.4
5241 //EXP_PULL_BEGIN
|
5242 karl 1.12.2.1 case CIM_OPEN_ENUMERATE_INSTANCES_REQUEST_MESSAGE:
5243 {
5244 _encodeOpenEnumerateInstancesRequest(buf,
5245 (CIMOpenEnumerateInstancesRequestMessage*)msg, name);
5246 break;
5247 }
5248
5249 case CIM_OPEN_ENUMERATE_INSTANCE_PATHS_REQUEST_MESSAGE:
5250 {
5251 _encodeOpenEnumerateInstancePathsRequest(buf,
5252 (CIMOpenEnumerateInstancePathsRequestMessage*)msg, name);
5253 break;
5254 }
5255 case CIM_OPEN_ASSOCIATOR_INSTANCES_REQUEST_MESSAGE:
5256 {
5257 _encodeOpenAssociatorInstancesRequest(buf,
5258 (CIMOpenAssociatorInstancesRequestMessage*)msg, name);
5259 break;
5260 }
5261 case CIM_OPEN_ASSOCIATOR_INSTANCE_PATHS_REQUEST_MESSAGE:
5262 {
5263 karl 1.12.2.1 _encodeOpenAssociatorInstancePathsRequest(buf,
5264 (CIMOpenAssociatorInstancePathsRequestMessage*)msg, name);
5265 break;
5266 }
5267 case CIM_OPEN_REFERENCE_INSTANCES_REQUEST_MESSAGE:
5268 {
5269 _encodeOpenReferenceInstancesRequest(buf,
5270 (CIMOpenReferenceInstancesRequestMessage*)msg, name);
5271 break;
5272 }
5273 case CIM_OPEN_REFERENCE_INSTANCE_PATHS_REQUEST_MESSAGE:
5274 {
5275 _encodeOpenReferenceInstancePathsRequest(buf,
5276 (CIMOpenReferenceInstancePathsRequestMessage*)msg, name);
5277 break;
5278 }
5279 case CIM_PULL_INSTANCES_WITH_PATH_REQUEST_MESSAGE:
5280 {
5281 _encodePullInstancesWithPathRequest(buf,
5282 (CIMPullInstancesWithPathRequestMessage*)msg, name);
5283 break;
5284 karl 1.12.2.1 }
5285 case CIM_PULL_INSTANCE_PATHS_REQUEST_MESSAGE:
5286 {
5287 _encodePullInstancePathsRequest(buf,
5288 (CIMPullInstancePathsRequestMessage*)msg, name);
5289 break;
5290 }
5291 case CIM_CLOSE_ENUMERATION_REQUEST_MESSAGE:
5292 {
5293 _encodeCloseEnumerationRequest(buf,
5294 (CIMCloseEnumerationRequestMessage*)msg, name);
5295 break;
5296 }
5297 case CIM_ENUMERATION_COUNT_REQUEST_MESSAGE:
5298 {
5299 _encodeEnumerationCountRequest(buf,
5300 (CIMEnumerationCountRequestMessage*)msg, name);
5301 break;
5302 }
|
5303 karl 1.12.2.4 //EXP_PULL_END
|
5304 mike 1.1
5305 default:
5306 // Unexpected message type
|
5307 karl 1.12.2.5 PEGASUS_UNREACHABLE(PEGASUS_ASSERT(0);)
|
5308 mike 1.1 return false;
5309 }
5310
5311 // [HTTP-HEADERS]
5312 XmlWriter::appendMethodCallHeader(
5313 out,
5314 host,
5315 name,
5316 msg->nameSpace.getString(),
5317 authHeader,
5318 msg->getHttpMethod(),
5319 AcceptLanguageListContainer(msg->operationContext.get(
5320 AcceptLanguageListContainer::NAME)).getLanguages(),
5321 ContentLanguageListContainer(msg->operationContext.get(
5322 ContentLanguageListContainer::NAME)).getLanguages(),
|
5323 kumpf 1.6 buf.size(),
|
5324 mike 1.1 true, /* binaryRequest */
5325 binaryResponse);
5326
|
5327 karl 1.12.2.3 // Need to pad the Buffer to the 64bit border since CIMBuffer is 64bit
5328 // aligned, but Buffer only 8bit
5329 Uint32 extraAlignBytes = CIMBuffer::round(out.size()) - out.size();
5330 for (Uint32 i=0; i < extraAlignBytes;i++)
5331 {
5332 out.append('\0');
5333 }
5334 // Need fix-up Content-length value...
5335 char * contentLengthValueStart =
5336 (char*) strstr(out.getData(), "content-length");
5337 contentLengthValueStart += sizeof("content-length: ")-1;
5338 // using sprintf to stay equal to the macro OUTPUT_CONTENTLENGTH definition
5339 // defined in XMLGenerator.h
5340 char contentLengthP[11];
5341 sprintf(contentLengthP,"%.10u", (unsigned int)buf.size()+extraAlignBytes);
5342 memcpy(contentLengthValueStart,contentLengthP,10);
5343
|
5344 mike 1.1 out.append(buf.getData(), buf.size());
5345
5346 return true;
5347 }
5348
5349 //==============================================================================
5350 //
5351 // BinaryCodec::encodeResponseBody()
5352 //
5353 //==============================================================================
5354
5355 bool BinaryCodec::encodeResponseBody(
5356 Buffer& out,
5357 const CIMResponseMessage* msg,
5358 CIMName& name)
5359 {
5360 CIMBuffer buf;
5361
5362 switch (msg->getType())
5363 {
5364 case CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE:
5365 mike 1.1 {
|
5366 r.kieninger 1.8 _encodeEnumerateInstancesResponseBody(
5367 buf,
5368 ((CIMEnumerateInstancesResponseMessage*)msg)->getResponseData(),
|
5369 karl 1.12.2.3 name,
5370 (msg->getIndex() == 0));
|
5371 mike 1.1 break;
5372 }
5373
5374 case CIM_ENUMERATE_INSTANCE_NAMES_RESPONSE_MESSAGE:
5375 {
|
5376 thilo.boehm 1.10 _encodeEnumerateInstanceNamesResponseBody(
5377 buf,
5378 ((CIMEnumerateInstanceNamesResponseMessage*)msg)->getResponseData(),
5379 name);
|
5380 mike 1.1 break;
5381 }
5382
5383 case CIM_GET_INSTANCE_RESPONSE_MESSAGE:
5384 {
|
5385 r.kieninger 1.8 _encodeGetInstanceResponseBody(
5386 buf,
|
5387 thilo.boehm 1.10 ((CIMGetInstanceResponseMessage*)msg)->getResponseData(),
|
5388 r.kieninger 1.8 name);
|
5389 mike 1.1 break;
5390 }
5391
5392 case CIM_CREATE_INSTANCE_RESPONSE_MESSAGE:
5393 {
5394 _encodeCreateInstanceResponseBody(buf,
5395 (CIMCreateInstanceResponseMessage*)msg, name);
5396 break;
5397 }
5398
5399 case CIM_MODIFY_INSTANCE_RESPONSE_MESSAGE:
5400 {
|
5401 thilo.boehm 1.11 _encodeModifyInstanceResponseBody(name);
|
5402 mike 1.1 break;
5403 }
5404
5405 case CIM_DELETE_INSTANCE_RESPONSE_MESSAGE:
5406 {
|
5407 thilo.boehm 1.11 _encodeDeleteInstanceResponseBody(name);
|
5408 mike 1.1 break;
5409 }
5410
5411 case CIM_ASSOCIATORS_RESPONSE_MESSAGE:
5412 {
|
5413 r.kieninger 1.8 _encodeAssociatorsResponseBody(
5414 buf,
|
5415 thilo.boehm 1.10 ((CIMAssociatorsResponseMessage*)msg)->getResponseData(),
|
5416 r.kieninger 1.8 name);
|
5417 mike 1.1 break;
5418 }
5419
5420 case CIM_ASSOCIATOR_NAMES_RESPONSE_MESSAGE:
5421 {
|
5422 thilo.boehm 1.10 _encodeAssociatorNamesResponseBody(
5423 buf,
5424 ((CIMAssociatorNamesResponseMessage*)msg)->getResponseData(),
5425 name);
|
5426 mike 1.1 break;
5427 }
5428
5429 case CIM_REFERENCES_RESPONSE_MESSAGE:
5430 {
|
5431 thilo.boehm 1.10 _encodeReferencesResponseBody(
5432 buf,
5433 ((CIMReferencesResponseMessage*)msg)->getResponseData(),
5434 name);
|
5435 mike 1.1 break;
5436 }
5437
5438 case CIM_REFERENCE_NAMES_RESPONSE_MESSAGE:
5439 {
|
5440 thilo.boehm 1.10 _encodeReferenceNamesResponseBody(
5441 buf,
5442 ((CIMReferenceNamesResponseMessage*)msg)->getResponseData(),
5443 name);
|
5444 mike 1.1 break;
5445 }
5446
5447 case CIM_GET_CLASS_RESPONSE_MESSAGE:
5448 {
5449 _encodeGetClassResponseBody(buf,
5450 (CIMGetClassResponseMessage*)msg, name);
5451 break;
5452 }
5453
5454 case CIM_ENUMERATE_CLASSES_RESPONSE_MESSAGE:
5455 {
5456 _encodeEnumerateClassesResponseBody(buf,
5457 (CIMEnumerateClassesResponseMessage*)msg, name);
5458 break;
5459 }
5460
5461 case CIM_ENUMERATE_CLASS_NAMES_RESPONSE_MESSAGE:
5462 {
5463 _encodeEnumerateClassNamesResponseBody(buf,
5464 (CIMEnumerateClassNamesResponseMessage*)msg, name);
5465 mike 1.1 break;
5466 }
5467
5468 case CIM_CREATE_CLASS_RESPONSE_MESSAGE:
5469 {
|
5470 thilo.boehm 1.11 _encodeCreateClassResponseBody(name);
|
5471 mike 1.1 break;
5472 }
5473
5474 case CIM_DELETE_CLASS_RESPONSE_MESSAGE:
5475 {
|
5476 thilo.boehm 1.11 _encodeDeleteClassResponseBody(name);
|
5477 mike 1.1 break;
5478 }
5479
5480 case CIM_MODIFY_CLASS_RESPONSE_MESSAGE:
5481 {
|
5482 thilo.boehm 1.11 _encodeModifyClassResponseBody(name);
|
5483 mike 1.1 break;
5484 }
5485
5486 case CIM_SET_QUALIFIER_RESPONSE_MESSAGE:
5487 {
|
5488 thilo.boehm 1.11 _encodeSetQualifierResponseBody(name);
|
5489 mike 1.1 break;
5490 }
5491
5492 case CIM_GET_QUALIFIER_RESPONSE_MESSAGE:
5493 {
5494 _encodeGetQualifierResponseBody(buf,
5495 (CIMGetQualifierResponseMessage*)msg, name);
5496 break;
5497 }
5498
5499 case CIM_DELETE_QUALIFIER_RESPONSE_MESSAGE:
5500 {
|
5501 thilo.boehm 1.11 _encodeDeleteQualifierResponseBody(name);
|
5502 mike 1.1 break;
5503 }
5504
5505 case CIM_ENUMERATE_QUALIFIERS_RESPONSE_MESSAGE:
5506 {
5507 _encodeEnumerateQualifiersResponseBody(buf,
5508 (CIMEnumerateQualifiersResponseMessage*)msg, name);
5509 break;
5510 }
5511
5512 case CIM_GET_PROPERTY_RESPONSE_MESSAGE:
5513 {
5514 _encodeGetPropertyResponseBody(buf,
5515 (CIMGetPropertyResponseMessage*)msg, name);
5516 break;
5517 }
5518
5519 case CIM_SET_PROPERTY_RESPONSE_MESSAGE:
5520 {
|
5521 thilo.boehm 1.11 _encodeSetPropertyResponseBody(name);
|
5522 mike 1.1 break;
5523 }
5524
5525 case CIM_INVOKE_METHOD_RESPONSE_MESSAGE:
5526 {
5527 _encodeInvokeMethodResponseBody(buf,
5528 (CIMInvokeMethodResponseMessage*)msg, name);
5529 break;
5530 }
5531
5532 case CIM_EXEC_QUERY_RESPONSE_MESSAGE:
5533 {
|
5534 karl 1.12.2.4 _encodeExecQueryResponseBody(
5535 buf,
|
5536 thilo.boehm 1.10 ((CIMExecQueryResponseMessage*)msg)->getResponseData(),
|
5537 r.kieninger 1.8 name);
|
5538 mike 1.1 break;
5539 }
5540
|
5541 karl 1.12.2.4 //EXP_PULL_BEGIN
|
5542 karl 1.12.2.1 case CIM_OPEN_ENUMERATE_INSTANCES_RESPONSE_MESSAGE:
5543 {
5544 _encodeOpenEnumerateInstancesResponseBody(buf,
5545 (CIMOpenEnumerateInstancesResponseMessage*)msg,
5546 ((CIMOpenEnumerateInstancesResponseMessage*)msg)->
5547 getResponseData(),
5548 name);
5549 break;
5550 }
5551
5552 case CIM_OPEN_ENUMERATE_INSTANCE_PATHS_RESPONSE_MESSAGE:
5553 {
5554 _encodeOpenEnumerateInstancePathsResponseBody(buf,
5555 (CIMOpenEnumerateInstancePathsResponseMessage*)msg,
5556 ((CIMOpenEnumerateInstancePathsResponseMessage*)msg)->
5557 getResponseData(),
5558 name);
5559 break;
5560 }
5561
5562 case CIM_OPEN_REFERENCE_INSTANCES_RESPONSE_MESSAGE:
5563 karl 1.12.2.1 {
5564 _encodeOpenReferenceInstancesResponseBody(buf,
5565 (CIMOpenReferenceInstancesResponseMessage*)msg,
5566 ((CIMOpenReferenceInstancesResponseMessage*)msg)->
5567 getResponseData(),
5568 name);
5569 break;
5570 }
5571
5572 case CIM_OPEN_REFERENCE_INSTANCE_PATHS_RESPONSE_MESSAGE:
5573 {
5574 _encodeOpenReferenceInstancePathsResponseBody(buf,
5575 (CIMOpenReferenceInstancePathsResponseMessage*)msg,
5576 ((CIMOpenReferenceInstancePathsResponseMessage*)msg)->
5577 getResponseData(),
5578 name);
5579 break;
5580 }
5581 case CIM_OPEN_ASSOCIATOR_INSTANCES_RESPONSE_MESSAGE:
5582 {
5583 _encodeOpenAssociatorInstancesResponseBody(buf,
5584 karl 1.12.2.1 (CIMOpenAssociatorInstancesResponseMessage*)msg,
5585 ((CIMOpenAssociatorInstancesResponseMessage*)msg)->
5586 getResponseData(),
5587 name);
5588 break;
5589 }
5590
5591 case CIM_OPEN_ASSOCIATOR_INSTANCE_PATHS_RESPONSE_MESSAGE:
5592 {
5593 _encodeOpenAssociatorInstancePathsResponseBody(buf,
5594 (CIMOpenAssociatorInstancePathsResponseMessage*)msg,
5595 ((CIMOpenAssociatorInstancePathsResponseMessage*)msg)->
5596 getResponseData(),
5597 name);
5598 break;
5599 }
5600
5601 case CIM_PULL_INSTANCES_WITH_PATH_RESPONSE_MESSAGE:
5602 {
5603 _encodePullInstancesWithPathResponseBody(buf,
5604 (CIMPullInstancesWithPathResponseMessage*)msg,
5605 karl 1.12.2.1 ((CIMPullInstancesWithPathResponseMessage*)msg)->
5606 getResponseData(),
5607 name);
5608 break;
5609 }
5610
5611 case CIM_PULL_INSTANCE_PATHS_RESPONSE_MESSAGE:
5612 {
5613 _encodePullInstancePathsResponseBody(buf,
5614 (CIMPullInstancePathsResponseMessage*)msg,
5615 ((CIMPullInstancePathsResponseMessage*)msg)->
5616 getResponseData(),
5617 name);
5618 break;
5619 }
5620 case CIM_CLOSE_ENUMERATION_RESPONSE_MESSAGE:
5621 {
5622 _encodeCloseEnumerationResponseBody(buf,
5623 (CIMCloseEnumerationResponseMessage*)msg,
5624 name);
5625 break;
5626 karl 1.12.2.1 }
5627 case CIM_ENUMERATION_COUNT_RESPONSE_MESSAGE:
5628 {
5629 _encodeEnumerationCountResponseBody(buf,
5630 (CIMEnumerationCountResponseMessage*)msg,
5631 name);
5632 break;
5633 }
|
5634 karl 1.12.2.4 //EXP_PULL_END
|
5635 karl 1.12.2.1
|
5636 mike 1.1 default:
5637 // Unexpected message type
|
5638 karl 1.12.2.5 PEGASUS_UNREACHABLE(PEGASUS_ASSERT(0);)
|
5639 mike 1.1 return false;
5640 }
5641
5642 out.append(buf.getData(), buf.size());
5643 return true;
5644 }
5645
5646 PEGASUS_NAMESPACE_END
|