1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 package org.metricshub.wbem.sblim.cimclient.internal.cimxml;
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78 import java.io.IOException;
79 import java.io.OutputStream;
80 import java.util.Iterator;
81 import java.util.Random;
82 import java.util.Vector;
83 import javax.xml.parsers.DocumentBuilder;
84 import javax.xml.parsers.DocumentBuilderFactory;
85 import javax.xml.parsers.ParserConfigurationException;
86 import org.metricshub.wbem.javax.cim.CIMArgument;
87 import org.metricshub.wbem.javax.cim.CIMClass;
88 import org.metricshub.wbem.javax.cim.CIMDataType;
89 import org.metricshub.wbem.javax.cim.CIMInstance;
90 import org.metricshub.wbem.javax.cim.CIMNamedElementInterface;
91 import org.metricshub.wbem.javax.cim.CIMObjectPath;
92 import org.metricshub.wbem.javax.cim.CIMProperty;
93 import org.metricshub.wbem.javax.cim.CIMQualifierType;
94 import org.metricshub.wbem.javax.cim.CIMValuedElement;
95 import org.metricshub.wbem.javax.cim.UnsignedInteger32;
96 import org.metricshub.wbem.javax.wbem.WBEMException;
97 import org.metricshub.wbem.sblim.cimclient.internal.logging.TimeStamp;
98 import org.metricshub.wbem.sblim.cimclient.internal.util.MOF;
99 import org.metricshub.wbem.sblim.cimclient.internal.wbem.CIMError;
100 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMAssociatorNamesOp;
101 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMAssociatorsOp;
102 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateClassOp;
103 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateInstanceOp;
104 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateNameSpaceOp;
105 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateQualifierTypeOp;
106 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMDeleteClassOp;
107 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMDeleteInstanceOp;
108 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMDeleteQualifierTypeOp;
109 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumClassNamesOp;
110 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumClassesOp;
111 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumInstanceNamesOp;
112 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumInstancesOp;
113 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumNameSpaceOp;
114 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumQualifierTypesOp;
115 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMExecQueryOp;
116 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMGetClassOp;
117 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMGetInstanceOp;
118 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMGetPropertyOp;
119 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMGetQualifierTypeOp;
120 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMInvokeMethodOp;
121 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMOperation;
122 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMReferenceNamesOp;
123 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMReferencesOp;
124 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMSetClassOp;
125 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMSetInstanceOp;
126 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMSetPropertyOp;
127 import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMSetQualifierTypeOp;
128 import org.w3c.dom.Document;
129 import org.w3c.dom.Element;
130 import org.xml.sax.InputSource;
131 import org.xml.sax.SAXException;
132
133
134
135
136
137 public class CIMClientXML_HelperImpl {
138
139 private static class Counter {
140 private int iCounter;
141
142 protected Counter(int pCounter) {
143 this.iCounter = pCounter;
144 }
145
146 protected int incrementAndGet() {
147 return ++this.iCounter;
148 }
149 }
150
151 private static final String VERSION = "1.0";
152
153 private static final String ASSOCIATOR_NAMES = "AssociatorNames";
154
155
156 private static final String ASSOC_CLASS = "AssocClass";
157
158 private static final String CLASS_NAME = "ClassName";
159
160 private static final String CONTINUE_ON_ERROR = "ContinueOnError";
161
162 private static final String DEEP_INHERITANCE = "DeepInheritance";
163
164 private static final String ENUMERATION_CONTEXT = "EnumerationContext";
165
166 private static final String FILTER_QUERY_LANGUAGE = "FilterQueryLanguage";
167
168 private static final String FILTER_QUERY = "FilterQuery";
169
170 private static final String INCLUDE_CLASS_ORIGIN = "IncludeClassOrigin";
171
172 private static final String INSTANCE_NAME = "InstanceName";
173
174 private static final String MAX_OBJECT_COUNT = "MaxObjectCount";
175
176 private static final String PROPERTY_LIST = "PropertyList";
177
178 private static final String OPERATION_TIMEOUT = "OperationTimeout";
179
180 private static final String RESULT_CLASS = "ResultClass";
181
182 private static final String RETURN_QUERY_RESULT_CLASS = "ReturnQueryResultClass";
183
184 private static final String QUERY_RESULT_CLASS = "QueryResultClass";
185
186 private static final String ROLE = "Role";
187
188 private static final String RESULT_ROLE = "ResultRole";
189
190 private static final Random RANDOM = new Random();
191
192 private static final int MAX_ID = 1 << 20;
193
194 private final ThreadLocal<Counter> iCurrentId = new ThreadLocal<Counter>();
195
196 private final DocumentBuilder iBuilder;
197
198 private static String valueStr(CIMValuedElement<?> pE) {
199 Object o = pE.getValue();
200 return o == null ? MOF.NULL : o.toString();
201 }
202
203
204
205
206
207
208 public CIMClientXML_HelperImpl() throws ParserConfigurationException {
209 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
210 this.iBuilder = factory.newDocumentBuilder();
211 }
212
213
214
215
216
217
218 public DocumentBuilder getDocumentBuilder() {
219 return this.iBuilder;
220 }
221
222
223
224
225
226
227 public Document newDocument() {
228 return this.iBuilder.newDocument();
229 }
230
231
232
233
234
235
236
237
238
239 public Document parse(InputSource pIS) throws IOException, SAXException {
240 if (pIS == null) throw new IllegalArgumentException("null input stream argument");
241 return this.iBuilder.parse(pIS);
242 }
243
244
245
246
247
248
249
250
251
252
253
254 public static void serialize(OutputStream pOS, Document pDoc) throws IOException {
255 CimXmlSerializer.serialize(pOS, pDoc, false);
256 }
257
258
259
260
261
262
263
264
265
266
267
268
269 public static void dumpDocument(OutputStream pOS, Document pDoc) throws IOException {
270 dumpDocument(pOS, pDoc, null);
271 }
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287 public static void dumpDocument(OutputStream pOS, Document pDoc, String pOrigin) throws IOException {
288
289 if (pOS == null) {
290 return;
291 }
292 if (pOrigin == null) pOrigin = "unknown";
293 pOS.write("<--- ".getBytes());
294 pOS.write(pOrigin.getBytes());
295 pOS.write(" begin ".getBytes());
296 pOS.write(TimeStamp.formatWithMillis(System.currentTimeMillis()).getBytes());
297 pOS.write(" -----\n".getBytes());
298 CimXmlSerializer.serialize(pOS, pDoc, true);
299 pOS.write("\n---- ".getBytes());
300 pOS.write(pOrigin.getBytes());
301 pOS.write(" end ------>\n".getBytes());
302 }
303
304
305
306
307
308
309
310
311 public Element createCIMMessage(Document pDoc, Element pRequestE) {
312 Element cimE = CIMXMLBuilderImpl.createCIM(pDoc);
313 Element messageE = CIMXMLBuilderImpl.createMESSAGE(pDoc, cimE, String.valueOf(getNextId()), VERSION);
314 if (pRequestE != null) {
315 messageE.appendChild(pRequestE);
316 }
317 return messageE;
318 }
319
320
321
322
323
324
325
326 public Element createMultiReq(Document pDoc) {
327 Element multireqE = CIMXMLBuilderImpl.createMULTIREQ(pDoc);
328 return multireqE;
329 }
330
331
332
333
334
335
336
337
338
339
340
341
342
343 public Element associatorNames_request(
344 Document pDoc,
345 CIMObjectPath pObjectName,
346 String pAssocClass,
347 String pResultClass,
348 String pRole,
349 String pResultRole
350 )
351 throws WBEMException {
352
353 String className = pObjectName.getObjectName();
354 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
355 CIMProperty<?>[] keysA = pObjectName.getKeys();
356
357 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
358 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, ASSOCIATOR_NAMES);
359 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
360
361 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
362 Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
363 for (int i = 0; i < keysA.length; i++) {
364 CIMProperty<?> prop = keysA[i];
365 String propName = prop.getName();
366
367 String propTypeStr = prop.getDataType().toString();
368 String propValueStr = valueStr(prop);
369 Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
370 CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
371 }
372 if (pAssocClass != null) {
373 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
374 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
375 }
376 if (pResultClass != null) {
377 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
378 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
379 }
380 if (pRole != null) {
381 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
382 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
383 }
384 if (pResultRole != null) {
385 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
386 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
387 }
388
389 return simplereqE;
390 }
391
392
393
394
395
396
397
398
399 public static Element associatorNames_response(Document pDoc, CIMObjectPath[] pPathA) {
400 Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
401 Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE, "associatorNames");
402 Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
403 try {
404 for (int i = 0; i < pPathA.length; i++) {
405 CIMXMLBuilderImpl.createOBJECTPATH(pDoc, iRetValE, pPathA[i]);
406 }
407 } catch (WBEMException e) {
408 throw new RuntimeException(e);
409 }
410 return simpRspE;
411 }
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427 public Element associatorInstances_request(
428 Document pDoc,
429 CIMObjectPath pObjectName,
430 String pAssocClass,
431 String pResultClass,
432 String pRole,
433 String pResultRole,
434 boolean pIncludeClassOrigin,
435 String[] pPropertyList
436 )
437 throws WBEMException {
438 String className = pObjectName.getObjectName();
439 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
440 CIMProperty<?>[] keysA = pObjectName.getKeys();
441
442
443 if (keysA.length == 0) throw new WBEMException(
444 WBEMException.CIM_ERR_INVALID_PARAMETER,
445 "associatorInstances requires keys for the instance to be populated"
446 );
447
448 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
449 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
450 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
451 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
452 Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
453 for (int i = 0; i < keysA.length; i++) {
454 CIMProperty<?> prop = keysA[i];
455 String propName = prop.getName();
456 String propTypeStr = prop.getDataType().toString();
457 String propValueStr = valueStr(prop);
458
459 Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
460 CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
461 }
462 if (pAssocClass != null) {
463 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
464 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
465 }
466 if (pResultClass != null) {
467 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
468 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
469 }
470 if (pRole != null) {
471 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
472 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
473 }
474 if (pResultRole != null) {
475 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
476 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
477 }
478
479 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
480 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
481
482 if (pPropertyList != null) {
483 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
484 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
485 for (int i = 0; i < pPropertyList.length; i++) {
486 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
487 }
488 }
489
490 return simplereqE;
491 }
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508 public Element associatorClasses_request(
509 Document pDoc,
510 CIMObjectPath pObjectName,
511 String pAssocClass,
512 String pResultClass,
513 String pRole,
514 String pResultRole,
515 boolean pIncludeQualifiers,
516 boolean pIncludeClassOrigin,
517 String[] pPropertyList
518 )
519 throws WBEMException {
520 String className = pObjectName.getObjectName();
521 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
522
523
524 if (pObjectName.getKeys().length != 0) throw new WBEMException(
525 WBEMException.CIM_ERR_INVALID_PARAMETER,
526 "Keys should not be populated for associatorClasses"
527 );
528
529 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
530 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
531 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
532 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
533
534 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
535
536 if (pAssocClass != null) {
537 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
538 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
539 }
540 if (pResultClass != null) {
541 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
542 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
543 }
544 if (pRole != null) {
545 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
546 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
547 }
548 if (pResultRole != null) {
549 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
550 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
551 }
552 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
553 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
554
555 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
556 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
557
558 if (pPropertyList != null) {
559 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
560 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
561 for (int i = 0; i < pPropertyList.length; i++) {
562 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
563 }
564 }
565
566 return simplereqE;
567 }
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584 public Element associators_request(
585 Document pDoc,
586 CIMObjectPath pObjectName,
587 String pAssocClass,
588 String pResultClass,
589 String pRole,
590 String pResultRole,
591 boolean pIncludeQualifiers,
592 boolean pIncludeClassOrigin,
593 String[] pPropertyList
594 )
595 throws WBEMException {
596
597 String className = pObjectName.getObjectName();
598 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
599 CIMProperty<?>[] keysA = pObjectName.getKeys();
600
601 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
602 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
603 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
604 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
605 Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
606 for (int i = 0; i < keysA.length; i++) {
607 CIMProperty<?> prop = keysA[i];
608 String propName = prop.getName();
609
610 String propTypeStr = prop.getDataType().toString();
611
612 String propValueStr = valueStr(prop);
613
614 Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
615 CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
616 }
617 if (pAssocClass != null) {
618 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
619 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
620 }
621 if (pResultClass != null) {
622 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
623 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
624 }
625 if (pRole != null) {
626 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
627 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
628 }
629 if (pResultRole != null) {
630 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
631 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
632 }
633 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
634 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
635
636 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
637 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
638
639 if (pPropertyList != null) {
640 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
641
642 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
643 for (int i = 0; i < pPropertyList.length; i++) {
644 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
645 }
646 }
647
648 return simplereqE;
649 }
650
651
652
653
654
655
656
657
658 public static Element associators_response(Document pDoc, CIMNamedElementInterface[] pNamedElementA) {
659 Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
660 Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE, "associators");
661 Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
662 try {
663 for (int i = 0; i < pNamedElementA.length; i++) {
664 CIMNamedElementInterface namedElement = pNamedElementA[i];
665 CIMObjectPath op = namedElement.getObjectPath();
666 String nameSpace = op == null ? null : op.getNamespace();
667 CIMXMLBuilderImpl.createVALUEOBJECTWITHPATH(pDoc, iRetValE, namedElement, nameSpace);
668
669
670
671
672
673
674 }
675 } catch (WBEMException e) {
676 throw new RuntimeException(e);
677 }
678 return simpRspE;
679 }
680
681
682
683
684
685
686
687
688
689 public Element enumerateInstanceNames_request(Document pDoc, CIMObjectPath pPath) throws WBEMException {
690
691 String className = pPath.getObjectName();
692 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
693
694 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
695 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "EnumerateInstanceNames");
696 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
697
698 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
699 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
700
701 return simplereqE;
702 }
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717 public Element enumerateInstances_request(
718 Document pDoc,
719 CIMObjectPath pPath,
720 boolean pDeepInheritance,
721 boolean pLocalOnly,
722 boolean pIncludeQualifiers,
723 boolean pIncludeClassOrigin,
724 String[] pPropertyList
725 )
726 throws WBEMException {
727
728 String className = pPath.getObjectName();
729 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
730
731 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
732 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "EnumerateInstances");
733 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
734
735 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
736 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
737 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
738 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
739
740 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
741 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
742
743 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
744 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
745
746 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
747 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
748
749 if (pPropertyList != null) {
750 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
751 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
752 for (int i = 0; i < pPropertyList.length; i++) {
753 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
754 }
755 }
756 return simplereqE;
757 }
758
759
760
761
762
763
764
765
766
767
768
769
770
771 public Element getInstance_request(
772 Document pDoc,
773 CIMObjectPath pName,
774 boolean pLocalOnly,
775 boolean pIncludeQualifiers,
776 boolean pIncludeClassOrigin,
777 String[] pPropertyList
778 )
779 throws WBEMException {
780
781 String className = pName.getObjectName();
782 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
783
784 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
785 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetInstance");
786 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
787
788 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "InstanceName");
789 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pName);
790
791 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
792 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
793
794 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
795 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
796
797 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
798 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
799
800 if (pPropertyList != null) {
801 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
802 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
803 for (int i = 0; i < pPropertyList.length; i++) {
804 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
805 }
806 }
807
808 return simplereqE;
809 }
810
811
812
813
814
815
816
817
818
819 public Element deleteInstance_request(Document pDoc, CIMObjectPath pName) throws WBEMException {
820
821 String className = pName.getObjectName();
822 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
823
824 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
825 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "DeleteInstance");
826 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
827
828 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "InstanceName");
829 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pName);
830
831 return simplereqE;
832 }
833
834
835
836
837
838
839
840
841
842
843
844
845
846 public Element getClass_request(
847 Document pDoc,
848 CIMObjectPath pName,
849 boolean pLocalOnly,
850 boolean pIncludeQualifiers,
851 boolean pIncludeClassOrigin,
852 String[] pPropertyList
853 )
854 throws WBEMException {
855
856 String className = pName.getObjectName();
857 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
858
859 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
860 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetClass");
861 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
862
863 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
864 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
865 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
866 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
867
868 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
869 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
870
871 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
872 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
873
874 if (pPropertyList != null) {
875 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
876 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
877 for (int i = 0; i < pPropertyList.length; i++) {
878 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
879 }
880 }
881
882 return simplereqE;
883 }
884
885
886
887
888
889
890
891
892
893
894 public Element createInstance_request(Document pDoc, CIMObjectPath pName, CIMInstance pInstance)
895 throws WBEMException {
896 String className = pInstance.getObjectPath().getObjectName();
897 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
898
899 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
900 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "CreateInstance");
901 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
902 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "NewInstance");
903
904 CIMXMLBuilderImpl.createINSTANCE(pDoc, iparamvalueE, pInstance);
905
906 return simplereqE;
907 }
908
909
910
911
912
913
914
915
916
917
918
919 public Element invokeMethod_request(
920 Document pDoc,
921 CIMObjectPath pLocalPath,
922 String pMethodName,
923 CIMArgument<?>[] pInArgs
924 )
925 throws WBEMException {
926
927 String className = pLocalPath.getObjectName();
928 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
929 CIMProperty<?>[] keysA = pLocalPath.getKeys();
930
931 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
932 Element methodcallE = CIMXMLBuilderImpl.createMETHODCALL(pDoc, simplereqE, pMethodName);
933
934
935 if (keysA.length > 0) {
936 Element localpathE = CIMXMLBuilderImpl.createLOCALINSTANCEPATH(pDoc, methodcallE);
937 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, localpathE, pLocalPath);
938 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, localpathE, pLocalPath);
939 } else {
940 CIMXMLBuilderImpl.createLOCALCLASSPATH(pDoc, methodcallE, pLocalPath);
941 }
942
943 buildParamValues(pDoc, methodcallE, pLocalPath, pInArgs);
944
945 return simplereqE;
946 }
947
948
949
950
951
952
953
954
955
956
957
958
959 public static Element invokeMethod_response(
960 Document pDoc,
961 String pMethodName,
962 CIMObjectPath pLocalPath,
963 Object pRetVal,
964 CIMArgument<?>[] pOutArgA
965 )
966 throws WBEMException {
967 if (pMethodName == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null method name");
968 Element simpleRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
969 Element methodRspE = CIMXMLBuilderImpl.createMETHODRESPONSE(pDoc, simpleRspE, pMethodName);
970
971 CIMXMLBuilderImpl.createRETURNVALUE(pDoc, methodRspE, pRetVal);
972
973 buildParamValues(pDoc, methodRspE, pLocalPath, pOutArgA);
974 return simpleRspE;
975 }
976
977
978
979
980 private static void buildParamValues(
981 Document pDoc,
982 Element pParentE,
983 CIMObjectPath pLocalPath,
984 CIMArgument<?>[] pArgA
985 )
986 throws WBEMException {
987 if (pArgA == null) return;
988 for (int i = 0; i < pArgA.length; i++) {
989 CIMArgument<?> arg = pArgA[i];
990 if (arg == null) continue;
991 CIMXMLBuilderImpl.createPARAMVALUE(pDoc, pParentE, arg);
992 }
993 }
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018 public Document createIndication_response(CIMError error) {
1019
1020 Document doc = this.iBuilder.newDocument();
1021 Element cimE = CIMXMLBuilderImpl.createCIM(doc);
1022 Element messageE = CIMXMLBuilderImpl.createMESSAGE(doc, cimE, String.valueOf(getNextId()), "1.0");
1023 Element simpleexprspE = CIMXMLBuilderImpl.createSIMPLEEXPRSP(doc, messageE);
1024 Element expmethodresponseE = CIMXMLBuilderImpl.createEXPMETHODRESPONSE(doc, simpleexprspE, "ExportIndication");
1025 if (error == null) {
1026 CIMXMLBuilderImpl.createIRETURNVALUE(doc, expmethodresponseE);
1027 } else {
1028 CIMXMLBuilderImpl.createERROR(doc, expmethodresponseE, error);
1029 }
1030
1031 return doc;
1032 }
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043 public Element createClass_request(Document pDoc, CIMObjectPath pPath, CIMClass pClass) throws WBEMException {
1044 String className = pPath.getObjectName();
1045 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1046
1047 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1048 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "CreateClass");
1049 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1050
1051 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "NewClass");
1052
1053 CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pClass);
1054
1055 return simplereqE;
1056 }
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067 public Element getQualifier_request(Document pDoc, CIMObjectPath pPath, String pQt) throws WBEMException {
1068
1069 String className = pPath.getObjectName();
1070 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1071
1072 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1073 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetQualifier");
1074 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1075
1076 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "QualifierName");
1077 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPath.getObjectName());
1078
1079 return simplereqE;
1080 }
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092 public Element createQualifierType_request(Document pDoc, CIMObjectPath pPath, CIMQualifierType<?> pQt)
1093 throws WBEMException {
1094 String className = pPath.getObjectName();
1095 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1096
1097 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1098 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "SetQualifier");
1099 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1100
1101 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "QualifierDeclaration");
1102 CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iparamvalueE, pQt);
1103
1104 return simplereqE;
1105 }
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115 public Element deleteClass_request(Document pDoc, CIMObjectPath pPath) throws WBEMException {
1116 String className = pPath.getObjectName();
1117 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1118
1119 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1120 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "DeleteClass");
1121 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1122
1123 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
1124
1125 CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
1126
1127 return simplereqE;
1128 }
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138 public Element deleteQualifierType_request(Document pDoc, CIMObjectPath pPath) throws WBEMException {
1139
1140 String className = pPath.getObjectName();
1141 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1142
1143 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1144 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "DeleteQualifier");
1145 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1146
1147 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "QualifierName");
1148 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPath.getObjectName());
1149 return simplereqE;
1150 }
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163 public Element enumerateClasses_request(
1164 Document pDoc,
1165 CIMObjectPath pPath,
1166 boolean pDeepInheritance,
1167 boolean pLocalOnly,
1168 boolean pIncludeQualifiers,
1169 boolean pIncludeClassOrigin
1170 ) {
1171 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1172 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "EnumerateClasses");
1173 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1174
1175 Element iparamvalueE;
1176 if (pPath != null && pPath.getObjectName() != null && pPath.getObjectName().trim().length() != 0) {
1177 String className = pPath.getObjectName();
1178 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
1179 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
1180 }
1181 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
1182 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
1183
1184 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
1185 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
1186
1187 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
1188 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
1189
1190 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
1191 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
1192 return simplereqE;
1193 }
1194
1195
1196
1197
1198
1199
1200
1201
1202 public static Element enumerateClasses_response(Document pDoc, CIMClass[] pClA) {
1203 Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
1204 Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE, "enumerateClasses");
1205 Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
1206 try {
1207 for (int i = 0; i < pClA.length; i++) {
1208 CIMXMLBuilderImpl.createCLASS(pDoc, iRetValE, pClA[i]);
1209 }
1210 } catch (WBEMException e) {
1211 throw new RuntimeException(e);
1212 }
1213 return simpRspE;
1214 }
1215
1216
1217
1218
1219
1220
1221
1222
1223 public static Element enumerateInstances_response(Document pDoc, CIMInstance[] pInstA) {
1224 Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
1225 Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE, "enumerateInstances");
1226 Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
1227 try {
1228 for (int i = 0; i < pInstA.length; i++) {
1229 CIMXMLBuilderImpl.createINSTANCE(pDoc, iRetValE, pInstA[i]);
1230 }
1231 } catch (WBEMException e) {
1232 throw new RuntimeException(e);
1233 }
1234 return simpRspE;
1235 }
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245 public Element enumerateClassNames_request(Document pDoc, CIMObjectPath pPath, boolean pDeepInheritance) {
1246 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1247 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "EnumerateClassNames");
1248 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1249
1250 Element iparamvalueE;
1251
1252 if (pPath != null && pPath.getObjectName() != null && pPath.getObjectName().trim().length() != 0) {
1253 String className = pPath.getObjectName();
1254 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
1255 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
1256 }
1257
1258 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
1259 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
1260
1261 return simplereqE;
1262 }
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273 public Element getProperty_request(Document pDoc, CIMObjectPath pPath, String pPropertyName) throws WBEMException {
1274
1275 String className = pPath.getObjectName();
1276 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1277
1278 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1279 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetProperty");
1280 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1281
1282 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "InstanceName");
1283 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
1284
1285 if (pPropertyName != null) {
1286 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyName");
1287 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPropertyName);
1288 }
1289
1290 return simplereqE;
1291 }
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303 public Element referenceNames_request(Document pDoc, CIMObjectPath pPath, String pResultClass, String pRole)
1304 throws WBEMException {
1305 String className = pPath.getObjectName();
1306 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1307
1308 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1309 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ReferenceNames");
1310 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1311
1312 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
1313 CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
1314
1315 if (pResultClass != null) {
1316 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
1317 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
1318 }
1319 if (pRole != null) {
1320 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
1321 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
1322 }
1323
1324 return simplereqE;
1325 }
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340 public Element referenceClasses_request(
1341 Document pDoc,
1342 CIMObjectPath pPath,
1343 String pResultClass,
1344 String pRole,
1345 boolean pIncludeQualifiers,
1346 boolean pIncludeClassOrigin,
1347 String[] pPropertyList
1348 )
1349 throws WBEMException {
1350 String className = pPath.getObjectName();
1351 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1352
1353
1354 if (pPath.getKeys().length != 0) throw new WBEMException(
1355 WBEMException.CIM_ERR_INVALID_PARAMETER,
1356 "Keys should not be populated for referenceClasses"
1357 );
1358
1359 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1360 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
1361 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1362
1363 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
1364
1365
1366 CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
1367
1368 if (pResultClass != null) {
1369 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
1370 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
1371 }
1372 if (pRole != null) {
1373 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
1374 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
1375 }
1376
1377 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
1378 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
1379
1380 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
1381 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
1382
1383 if (pPropertyList != null) {
1384 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
1385 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
1386 for (int i = 0; i < pPropertyList.length; i++) {
1387 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
1388 }
1389 }
1390 return simplereqE;
1391 }
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405 public Element referenceInstances_request(
1406 Document pDoc,
1407 CIMObjectPath pPath,
1408 String pResultClass,
1409 String pRole,
1410 boolean pIncludeClassOrigin,
1411 String[] pPropertyList
1412 )
1413 throws WBEMException {
1414 String className = pPath.getObjectName();
1415 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1416
1417
1418 if (pPath.getKeys().length == 0) throw new WBEMException(
1419 WBEMException.CIM_ERR_INVALID_PARAMETER,
1420 "refrenceInstances requires keys for the instance to be populated"
1421 );
1422
1423 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1424 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
1425 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1426
1427 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
1428
1429
1430 CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
1431
1432 if (pResultClass != null) {
1433 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
1434 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
1435 }
1436 if (pRole != null) {
1437 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
1438 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
1439 }
1440
1441 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
1442 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
1443
1444 if (pPropertyList != null) {
1445 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
1446 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
1447 for (int i = 0; i < pPropertyList.length; i++) {
1448 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
1449 }
1450 }
1451 return simplereqE;
1452 }
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467 public Element references_request(
1468 Document pDoc,
1469 CIMObjectPath pPath,
1470 String pResultClass,
1471 String pRole,
1472 boolean pIncludeQualifiers,
1473 boolean pIncludeClassOrigin,
1474 String[] pPropertyList
1475 )
1476 throws WBEMException {
1477 String className = pPath.getObjectName();
1478 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1479
1480 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1481 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
1482 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1483
1484 Element iparamvalueE;
1485
1486 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
1487 CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
1488
1489 if (pResultClass != null) {
1490 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
1491 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
1492 }
1493 if (pRole != null) {
1494 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
1495 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
1496 }
1497
1498 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
1499 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
1500
1501 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
1502 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
1503
1504 if (pPropertyList != null) {
1505 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
1506 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
1507 for (int i = 0; i < pPropertyList.length; i++) {
1508 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
1509 }
1510 }
1511
1512 return simplereqE;
1513 }
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524 public Element setClass_request(Document pDoc, CIMObjectPath pPath, CIMClass pClass) throws WBEMException {
1525 String className = pPath.getObjectName();
1526 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1527
1528 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1529 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ModifyClass");
1530 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1531
1532 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ModifiedClass");
1533 CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pClass);
1534
1535 return simplereqE;
1536 }
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549 public Element setInstance_request(
1550 Document pDoc,
1551 CIMObjectPath pPath,
1552 CIMInstance pInstance,
1553 boolean pIncludeQualifiers,
1554 String[] pPropertyList
1555 )
1556 throws WBEMException {
1557 String className = pPath.getObjectName();
1558 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1559
1560 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1561 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ModifyInstance");
1562 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1563
1564 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ModifiedInstance");
1565 CIMXMLBuilderImpl.createVALUENAMEDINSTANCE(pDoc, iparamvalueE, pPath, pInstance);
1566
1567 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
1568 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
1569
1570 if (pPropertyList != null) {
1571 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
1572 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
1573 for (int i = 0; i < pPropertyList.length; i++) {
1574 CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
1575 }
1576 }
1577
1578 return simplereqE;
1579 }
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591 public Element setProperty_request(Document pDoc, CIMObjectPath pPath, String pPropertyName, Object pNewValue)
1592 throws WBEMException {
1593 String className = pPath.getObjectName();
1594 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1595
1596 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1597 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "SetProperty");
1598 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1599
1600 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "InstanceName");
1601 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
1602
1603 if (pPropertyName != null) {
1604 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyName");
1605 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPropertyName);
1606 }
1607
1608 if (pNewValue != null) {
1609 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "NewValue");
1610 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pNewValue);
1611 }
1612
1613 return simplereqE;
1614 }
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625 public Element setQualifierType_request(Document pDoc, CIMObjectPath pPath, CIMQualifierType<?> pQt)
1626 throws WBEMException {
1627
1628
1629 String className = pPath.getObjectName();
1630 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
1631
1632 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1633 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "SetQualifier");
1634 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1635
1636 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "QualifierDeclaration");
1637 CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iparamvalueE, pQt);
1638
1639 return simplereqE;
1640 }
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650 public Element enumQualifierTypes_request(Document pDoc, CIMObjectPath pPath) throws WBEMException {
1651 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1652 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "EnumerateQualifiers");
1653 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1654
1655 return simplereqE;
1656 }
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666 public static Element enumQualifierTypes_response(Document pDoc, CIMQualifierType<?>[] pQualiTypeA)
1667 throws WBEMException {
1668 Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
1669 Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE, "associatorNames");
1670 Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
1671 for (int i = 0; i < pQualiTypeA.length; i++) {
1672 CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iRetValE, pQualiTypeA[i]);
1673 }
1674 return simpRspE;
1675 }
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686 public Element execQuery_request(Document pDoc, CIMObjectPath pPath, String pQuery, String pQueryLanguage) {
1687 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
1688 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ExecQuery");
1689 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
1690
1691 Element querylanguageE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "QueryLanguage");
1692 CIMXMLBuilderImpl.createVALUE(pDoc, querylanguageE, pQueryLanguage);
1693
1694 Element queryE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Query");
1695 CIMXMLBuilderImpl.createVALUE(pDoc, queryE, pQuery);
1696
1697 return simplereqE;
1698 }
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708 public Element performBatchOperation_request(Document pDoc, Vector<CIMOperation> pOperations) throws WBEMException {
1709 Element messageE = createCIMMessage(pDoc, null);
1710 if (pOperations.size() > 1) {
1711 Element multireqE = createMultiReq(pDoc);
1712 messageE.appendChild(multireqE);
1713 messageE = multireqE;
1714 }
1715 int i = 0;
1716 Iterator<CIMOperation> iter = pOperations.iterator();
1717 while (iter.hasNext()) {
1718 CIMOperation op = iter.next();
1719 try {
1720 Element requestE = null;
1721
1722 if (op instanceof CIMAssociatorsOp) {
1723 CIMAssociatorsOp associatorsOp = (CIMAssociatorsOp) op;
1724 requestE =
1725 associators_request(
1726 pDoc,
1727 associatorsOp.getObjectName(),
1728 associatorsOp.getAssocClass(),
1729 associatorsOp.getResultClass(),
1730 associatorsOp.getRole(),
1731 associatorsOp.getResultRole(),
1732 associatorsOp.isIncludeQualifiers(),
1733 associatorsOp.isIncludeClassOrigin(),
1734 associatorsOp.getPropertyList()
1735 );
1736 } else if (op instanceof CIMAssociatorNamesOp) {
1737 CIMAssociatorNamesOp associatorNamesOp = (CIMAssociatorNamesOp) op;
1738 requestE =
1739 associatorNames_request(
1740 pDoc,
1741 associatorNamesOp.getObjectName(),
1742 associatorNamesOp.getAssocClass(),
1743 associatorNamesOp.getResultClass(),
1744 associatorNamesOp.getRole(),
1745 associatorNamesOp.getResultRole()
1746 );
1747 } else if (op instanceof CIMCreateClassOp) {
1748 CIMCreateClassOp createClassOp = (CIMCreateClassOp) op;
1749 requestE = createClass_request(pDoc, createClassOp.getObjectName(), createClassOp.getCimClass());
1750 } else if (op instanceof CIMCreateInstanceOp) {
1751 CIMCreateInstanceOp createInstanceOp = (CIMCreateInstanceOp) op;
1752 requestE = createInstance_request(pDoc, createInstanceOp.getObjectName(), createInstanceOp.getInstance());
1753 } else if (op instanceof CIMCreateNameSpaceOp) {
1754 CIMCreateNameSpaceOp createNameSpaceOp = (CIMCreateNameSpaceOp) op;
1755
1756 String namespace = createNameSpaceOp.getNameSpace();
1757 int j = namespace.lastIndexOf('/');
1758
1759 if (j < 0) throw new WBEMException(
1760 WBEMException.CIM_ERR_NOT_FOUND,
1761 "Invalid namespace. Must contain at least /"
1762 );
1763 String parentNs = namespace.substring(0, j);
1764 namespace = namespace.substring(j + 1);
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775 CIMInstance inst = new CIMInstance(
1776 new CIMObjectPath(null, null, null, null, "CIM_NameSpace", null),
1777 new CIMProperty[] {
1778 new CIMProperty<String>("NameSpace", CIMDataType.STRING_T, namespace, true, false, null)
1779 }
1780 );
1781 CIMObjectPath object = new CIMObjectPath(null, null, null, parentNs, null, null);
1782
1783 requestE = createInstance_request(pDoc, object, inst);
1784 } else if (op instanceof CIMCreateQualifierTypeOp) {
1785 CIMCreateQualifierTypeOp createQualifierTypeOp = (CIMCreateQualifierTypeOp) op;
1786 requestE =
1787 createQualifierType_request(
1788 pDoc,
1789 createQualifierTypeOp.getObjectName(),
1790 createQualifierTypeOp.getQualifierType()
1791 );
1792 } else if (op instanceof CIMDeleteClassOp) {
1793 CIMDeleteClassOp deleteClassOp = (CIMDeleteClassOp) op;
1794 requestE = deleteClass_request(pDoc, deleteClassOp.getObjectName());
1795 } else if (op instanceof CIMDeleteInstanceOp) {
1796 CIMDeleteInstanceOp deleteInstanceOp = (CIMDeleteInstanceOp) op;
1797 requestE = deleteClass_request(pDoc, deleteInstanceOp.getObjectName());
1798 } else if (op instanceof CIMDeleteQualifierTypeOp) {
1799 CIMDeleteQualifierTypeOp deleteQualifierTypeOp = (CIMDeleteQualifierTypeOp) op;
1800 requestE = deleteClass_request(pDoc, deleteQualifierTypeOp.getObjectName());
1801 } else if (op instanceof CIMEnumClassesOp) {
1802 CIMEnumClassesOp enumClassesOp = (CIMEnumClassesOp) op;
1803 requestE =
1804 enumerateClasses_request(
1805 pDoc,
1806 enumClassesOp.getObjectName(),
1807 enumClassesOp.isDeep(),
1808 enumClassesOp.isLocalOnly(),
1809 enumClassesOp.isIncludeQualifiers(),
1810 enumClassesOp.isIncludeClassOrigin()
1811 );
1812 } else if (op instanceof CIMEnumClassNamesOp) {
1813 CIMEnumClassNamesOp enumClassNamesOp = (CIMEnumClassNamesOp) op;
1814 requestE = enumerateClassNames_request(pDoc, enumClassNamesOp.getObjectName(), enumClassNamesOp.isDeep());
1815 } else if (op instanceof CIMEnumInstanceNamesOp) {
1816 CIMEnumInstanceNamesOp enumInstanceNamesOp = (CIMEnumInstanceNamesOp) op;
1817 requestE = enumerateInstanceNames_request(pDoc, enumInstanceNamesOp.getObjectName());
1818 } else if (op instanceof CIMEnumInstancesOp) {
1819 CIMEnumInstancesOp enumInstancesOp = (CIMEnumInstancesOp) op;
1820 requestE =
1821 enumerateInstances_request(
1822 pDoc,
1823 enumInstancesOp.getObjectName(),
1824 enumInstancesOp.isDeep(),
1825 enumInstancesOp.isLocalOnly(),
1826 enumInstancesOp.isIncludeQualifiers(),
1827 enumInstancesOp.isIncludeClassOrigin(),
1828 enumInstancesOp.getPropertyList()
1829 );
1830 } else if (op instanceof CIMEnumNameSpaceOp) {
1831 CIMEnumNameSpaceOp enumNameSpaceOp = (CIMEnumNameSpaceOp) op;
1832
1833
1834 CIMObjectPath objPath = enumNameSpaceOp.getObjectName();
1835 objPath =
1836 new CIMObjectPath(
1837 objPath.getScheme(),
1838 objPath.getHost(),
1839 objPath.getPort(),
1840 objPath.getNamespace(),
1841 "CIM_NameSpace",
1842 objPath.getKeys()
1843 );
1844 requestE = enumerateInstanceNames_request(pDoc, enumNameSpaceOp.getObjectName());
1845 } else if (op instanceof CIMEnumQualifierTypesOp) {
1846 CIMEnumQualifierTypesOp enumQualifierTypesOp = (CIMEnumQualifierTypesOp) op;
1847 requestE = enumQualifierTypes_request(pDoc, enumQualifierTypesOp.getObjectName());
1848 } else if (op instanceof CIMExecQueryOp) {
1849 CIMExecQueryOp execQueryOp = (CIMExecQueryOp) op;
1850 requestE =
1851 execQuery_request(
1852 pDoc,
1853 execQueryOp.getObjectName(),
1854 execQueryOp.getQuery(),
1855 execQueryOp.getQueryLanguage()
1856 );
1857 } else if (op instanceof CIMGetPropertyOp) {
1858 CIMGetPropertyOp getPropertyOp = (CIMGetPropertyOp) op;
1859 requestE =
1860 getInstance_request(
1861 pDoc,
1862 getPropertyOp.getObjectName(),
1863 false,
1864 false,
1865 false,
1866 new String[] { getPropertyOp.getPropertyName() }
1867 );
1868 } else if (op instanceof CIMGetClassOp) {
1869 CIMGetClassOp getClassOp = (CIMGetClassOp) op;
1870 requestE =
1871 getClass_request(
1872 pDoc,
1873 getClassOp.getObjectName(),
1874 getClassOp.isLocalOnly(),
1875 getClassOp.isIncludeQualifiers(),
1876 getClassOp.isIncludeClassOrigin(),
1877 getClassOp.getPropertyList()
1878 );
1879 } else if (op instanceof CIMGetInstanceOp) {
1880 CIMGetInstanceOp getInstanceOp = (CIMGetInstanceOp) op;
1881 requestE =
1882 getInstance_request(
1883 pDoc,
1884 getInstanceOp.getObjectName(),
1885 getInstanceOp.isLocalOnly(),
1886 getInstanceOp.isIncludeQualifiers(),
1887 getInstanceOp.isIncludeClassOrigin(),
1888 getInstanceOp.getPropertyList()
1889 );
1890 } else if (op instanceof CIMGetQualifierTypeOp) {
1891 CIMGetQualifierTypeOp getQualifierTypeOp = (CIMGetQualifierTypeOp) op;
1892 requestE =
1893 getQualifier_request(pDoc, getQualifierTypeOp.getObjectName(), getQualifierTypeOp.getQualifierType());
1894 } else if (op instanceof CIMInvokeMethodOp) {
1895 CIMInvokeMethodOp invokeMethodOp = (CIMInvokeMethodOp) op;
1896 requestE =
1897 invokeMethod_request(
1898 pDoc,
1899 invokeMethodOp.getObjectName(),
1900 invokeMethodOp.getMethodCall(),
1901 invokeMethodOp.getInParams()
1902 );
1903 } else if (op instanceof CIMReferenceNamesOp) {
1904 CIMReferenceNamesOp referenceNamesOp = (CIMReferenceNamesOp) op;
1905 requestE =
1906 referenceNames_request(
1907 pDoc,
1908 referenceNamesOp.getObjectName(),
1909 referenceNamesOp.getResultClass(),
1910 referenceNamesOp.getResultRole()
1911 );
1912 } else if (op instanceof CIMReferencesOp) {
1913 CIMReferencesOp referencesOp = (CIMReferencesOp) op;
1914 requestE =
1915 references_request(
1916 pDoc,
1917 referencesOp.getObjectName(),
1918 referencesOp.getResultClass(),
1919 referencesOp.getRole(),
1920 referencesOp.isIncludeQualifiers(),
1921 referencesOp.isIncludeClassOrigin(),
1922 referencesOp.getPropertyList()
1923 );
1924 } else if (op instanceof CIMSetClassOp) {
1925 CIMSetClassOp setClassOp = (CIMSetClassOp) op;
1926 requestE = setClass_request(pDoc, setClassOp.getObjectName(), setClassOp.getCimClass());
1927 } else if (op instanceof CIMSetInstanceOp) {
1928 CIMSetInstanceOp setInstanceOp = (CIMSetInstanceOp) op;
1929 requestE =
1930 setInstance_request(
1931 pDoc,
1932 setInstanceOp.getObjectName(),
1933 setInstanceOp.getInstance(),
1934 setInstanceOp.isIncludeQualifiers(),
1935 setInstanceOp.getPropertyList()
1936 );
1937 } else if (op instanceof CIMSetPropertyOp) {
1938 CIMSetPropertyOp setPropertyOp = (CIMSetPropertyOp) op;
1939 requestE =
1940 setProperty_request(
1941 pDoc,
1942 setPropertyOp.getObjectName(),
1943 setPropertyOp.getPropertyName(),
1944 setPropertyOp.getCimValue()
1945 );
1946 } else if (op instanceof CIMSetQualifierTypeOp) {
1947 CIMSetQualifierTypeOp setQualifierTypeOp = (CIMSetQualifierTypeOp) op;
1948 requestE =
1949 setQualifierType_request(pDoc, setQualifierTypeOp.getObjectName(), setQualifierTypeOp.getQualifierType());
1950 }
1951 if (requestE == null) throw new WBEMException(
1952 WBEMException.CIM_ERR_INVALID_PARAMETER,
1953 "Illegal batch operation number (" + i + ") " + op.getClass()
1954 );
1955 messageE.appendChild(requestE);
1956 } catch (WBEMException e) {
1957 throw e;
1958 } catch (Exception e) {
1959 throw new WBEMException(WBEMException.CIM_ERR_FAILED, "At batch operation (" + i + ')', null, e);
1960 }
1961 i++;
1962 }
1963 return messageE;
1964 }
1965
1966
1967
1968
1969
1970
1971
1972
1973 public void setId(int pId) {
1974 this.iCurrentId.set(new Counter(pId - 1));
1975 }
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985 private int getNextId() {
1986 if (this.iCurrentId.get() == null) {
1987 this.iCurrentId.set(new Counter(RANDOM.nextInt(MAX_ID)));
1988 }
1989 return this.iCurrentId.get().incrementAndGet();
1990 }
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009 public Element OpenAssociatorInstancePaths_request(
2010 Document pDoc,
2011 CIMObjectPath pPath,
2012 String pAssocClass,
2013 String pResultClass,
2014 String pRole,
2015 String pResultRole,
2016 String pFilterQueryLanguage,
2017 String pFilterQuery,
2018 UnsignedInteger32 pOperationTimeout,
2019 boolean pContinueOnError,
2020 UnsignedInteger32 pMaxObjectCount
2021 )
2022 throws WBEMException {
2023 String className = pPath.getObjectName();
2024 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2025
2026 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2027 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "OpenAssociatorInstancePaths");
2028 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2029
2030 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, INSTANCE_NAME);
2031 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
2032
2033 if (pAssocClass != null) {
2034 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ASSOC_CLASS);
2035 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
2036 }
2037 if (pResultClass != null) {
2038 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
2039 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
2040 }
2041 if (pRole != null) {
2042 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
2043 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
2044 }
2045 if (pResultRole != null) {
2046 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_ROLE);
2047 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
2048 }
2049 if (pFilterQueryLanguage != null) {
2050 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY_LANGUAGE);
2051 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
2052 }
2053 if (pFilterQuery != null) {
2054 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
2055 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
2056 }
2057 if (pOperationTimeout != null) {
2058 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, OPERATION_TIMEOUT);
2059 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
2060 }
2061
2062 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
2063 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
2064
2065 if (pMaxObjectCount != null) {
2066 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2067 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2068 }
2069
2070 return simplereqE;
2071 }
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092 public Element OpenAssociatorInstances_request(
2093 Document pDoc,
2094 CIMObjectPath pPath,
2095 String pAssocClass,
2096 String pResultClass,
2097 String pRole,
2098 String pResultRole,
2099 boolean pIncludeClassOrigin,
2100 String[] pPropertyList,
2101 String pFilterQueryLanguage,
2102 String pFilterQuery,
2103 UnsignedInteger32 pOperationTimeout,
2104 boolean pContinueOnError,
2105 UnsignedInteger32 pMaxObjectCount
2106 )
2107 throws WBEMException {
2108 String className = pPath.getObjectName();
2109
2110 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2111
2112 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2113 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "OpenAssociatorInstances");
2114 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2115
2116 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, INSTANCE_NAME);
2117
2118 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
2119
2120 if (pAssocClass != null) {
2121 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ASSOC_CLASS);
2122 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
2123 }
2124 if (pResultClass != null) {
2125 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
2126 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
2127 }
2128 if (pRole != null) {
2129 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
2130 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
2131 }
2132 if (pResultRole != null) {
2133 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_ROLE);
2134 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
2135 }
2136 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
2137 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
2138
2139 if (pPropertyList != null) {
2140 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
2141 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
2142 for (int i = 0; i < pPropertyList.length; i++) CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
2143 }
2144 if (pFilterQueryLanguage != null) {
2145 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY_LANGUAGE);
2146 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
2147 }
2148 if (pFilterQuery != null) {
2149 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
2150 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
2151 }
2152 if (pOperationTimeout != null) {
2153 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, OPERATION_TIMEOUT);
2154 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
2155 }
2156
2157 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
2158 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
2159
2160 if (pMaxObjectCount != null) {
2161 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2162 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2163 }
2164
2165 return simplereqE;
2166 }
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181 public Element OpenEnumerateInstancePaths_request(
2182 Document pDoc,
2183 CIMObjectPath pPath,
2184 String pFilterQueryLanguage,
2185 String pFilterQuery,
2186 UnsignedInteger32 pOperationTimeout,
2187 boolean pContinueOnError,
2188 UnsignedInteger32 pMaxObjectCount
2189 )
2190 throws WBEMException {
2191 String className = pPath.getObjectName();
2192 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2193
2194 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2195 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "OpenEnumerateInstancePaths");
2196 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2197
2198 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CLASS_NAME);
2199 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
2200
2201 if (pFilterQueryLanguage != null) {
2202 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY_LANGUAGE);
2203 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
2204 }
2205 if (pFilterQuery != null) {
2206 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
2207 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
2208 }
2209 if (pOperationTimeout != null) {
2210 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, OPERATION_TIMEOUT);
2211 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
2212 }
2213
2214 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
2215 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
2216
2217 if (pMaxObjectCount != null) {
2218 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2219 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2220 }
2221
2222 return simplereqE;
2223 }
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241 public Element OpenEnumerateInstances_request(
2242 Document pDoc,
2243 CIMObjectPath pPath,
2244 boolean pDeepInheritance,
2245 boolean pIncludeClassOrigin,
2246 String[] pPropertyList,
2247 String pFilterQueryLanguage,
2248 String pFilterQuery,
2249 UnsignedInteger32 pOperationTimeout,
2250 boolean pContinueOnError,
2251 UnsignedInteger32 pMaxObjectCount
2252 )
2253 throws WBEMException {
2254 String className = pPath.getObjectName();
2255 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2256
2257 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2258 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "OpenEnumerateInstances");
2259 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2260
2261 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CLASS_NAME);
2262 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
2263
2264 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, DEEP_INHERITANCE);
2265 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
2266
2267 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
2268 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
2269
2270 if (pPropertyList != null) {
2271 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
2272 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
2273 for (int i = 0; i < pPropertyList.length; i++) CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
2274 }
2275
2276 if (pFilterQueryLanguage != null) {
2277 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY_LANGUAGE);
2278 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
2279 }
2280 if (pFilterQuery != null) {
2281 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
2282 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
2283 }
2284 if (pOperationTimeout != null) {
2285 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, OPERATION_TIMEOUT);
2286 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
2287 }
2288
2289 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
2290 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
2291
2292 if (pMaxObjectCount != null) {
2293 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2294 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2295 }
2296
2297 return simplereqE;
2298 }
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309 public Element EnumerationCount_request(Document pDoc, CIMObjectPath pPath, String pEnumerationContext)
2310 throws WBEMException {
2311 String className = pPath.getObjectName();
2312 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2313
2314 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2315 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "EnumerationCount");
2316 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2317
2318 if (pEnumerationContext != null) {
2319 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ENUMERATION_CONTEXT);
2320 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pEnumerationContext);
2321 }
2322
2323 return simplereqE;
2324 }
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335 public Element CloseEnumeration_request(Document pDoc, CIMObjectPath pPath, String pEnumerationContext)
2336 throws WBEMException {
2337 String className = pPath.getObjectName();
2338
2339 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2340
2341 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2342 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "CloseEnumeration");
2343 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2344
2345 if (pEnumerationContext != null) {
2346 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ENUMERATION_CONTEXT);
2347 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pEnumerationContext);
2348 }
2349 return simplereqE;
2350 }
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367 public Element OpenReferenceInstancePaths_request(
2368 Document pDoc,
2369 CIMObjectPath pPath,
2370 String pResultClass,
2371 String pRole,
2372 String pFilterQueryLanguage,
2373 String pFilterQuery,
2374 UnsignedInteger32 pOperationTimeout,
2375 boolean pContinueOnError,
2376 UnsignedInteger32 pMaxObjectCount
2377 )
2378 throws WBEMException {
2379 String className = pPath.getObjectName();
2380 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2381
2382 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2383 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "OpenReferenceInstancePaths");
2384 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2385
2386 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, INSTANCE_NAME);
2387 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
2388
2389 if (pResultClass != null) {
2390 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
2391 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
2392 }
2393 if (pRole != null) {
2394 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
2395 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
2396 }
2397 if (pFilterQueryLanguage != null) {
2398 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY_LANGUAGE);
2399 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
2400 }
2401 if (pFilterQuery != null) {
2402 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
2403 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
2404 }
2405 if (pOperationTimeout != null) {
2406 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, OPERATION_TIMEOUT);
2407 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
2408 }
2409
2410 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
2411 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
2412
2413 if (pMaxObjectCount != null) {
2414 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2415 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2416 }
2417
2418 return simplereqE;
2419 }
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438 public Element OpenReferenceInstances_request(
2439 Document pDoc,
2440 CIMObjectPath pPath,
2441 String pResultClass,
2442 String pRole,
2443 boolean pIncludeClassOrigin,
2444 String[] pPropertyList,
2445 String pFilterQueryLanguage,
2446 String pFilterQuery,
2447 UnsignedInteger32 pOperationTimeout,
2448 boolean pContinueOnError,
2449 UnsignedInteger32 pMaxObjectCount
2450 )
2451 throws WBEMException {
2452 String className = pPath.getObjectName();
2453 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2454
2455 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2456 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "OpenReferenceInstances");
2457 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2458
2459 Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, INSTANCE_NAME);
2460 CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
2461
2462 if (pResultClass != null) {
2463 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
2464 CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
2465 }
2466 if (pRole != null) {
2467 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
2468 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
2469 }
2470
2471 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
2472 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
2473
2474 if (pPropertyList != null) {
2475 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
2476 Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
2477 for (int i = 0; i < pPropertyList.length; i++) CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
2478 }
2479
2480 if (pFilterQueryLanguage != null) {
2481 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY_LANGUAGE);
2482 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
2483 }
2484 if (pFilterQuery != null) {
2485 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
2486 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
2487 }
2488 if (pOperationTimeout != null) {
2489 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, OPERATION_TIMEOUT);
2490 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
2491 }
2492
2493 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
2494 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
2495
2496 if (pMaxObjectCount != null) {
2497 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2498 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2499 }
2500
2501 return simplereqE;
2502 }
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519 public Element OpenQueryInstances_request(
2520 Document pDoc,
2521 CIMObjectPath pPath,
2522 String pFilterQuery,
2523 String pFilterQueryLanguage,
2524 boolean pReturnQueryResultClass,
2525 UnsignedInteger32 pOperationTimeout,
2526 boolean pContinueOnError,
2527 UnsignedInteger32 pMaxObjectCount,
2528 CIMClass pQueryResultClass
2529 )
2530 throws WBEMException {
2531 String className = pPath.getObjectName();
2532 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2533
2534 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2535 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "OpenQueryInstances");
2536 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2537
2538 Element iparamvalueE;
2539
2540 if (pFilterQuery != null) {
2541 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
2542 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
2543 }
2544 if (pFilterQueryLanguage != null) {
2545 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY_LANGUAGE);
2546 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
2547 }
2548 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RETURN_QUERY_RESULT_CLASS);
2549 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pReturnQueryResultClass);
2550
2551 if (pOperationTimeout != null) {
2552 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, OPERATION_TIMEOUT);
2553 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
2554 }
2555
2556 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
2557 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
2558
2559 if (pMaxObjectCount != null) {
2560 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2561 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2562 }
2563 if (pQueryResultClass != null) {
2564 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, QUERY_RESULT_CLASS);
2565 CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pQueryResultClass);
2566 }
2567 return simplereqE;
2568 }
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580 public Element PullInstancesWithPath_request(
2581 Document pDoc,
2582 CIMObjectPath pPath,
2583 String pContext,
2584 UnsignedInteger32 pMaxObjectCount
2585 )
2586 throws WBEMException {
2587 String className = pPath.getObjectName();
2588 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2589
2590 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2591 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "PullInstancesWithPath");
2592 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2593
2594 Element iparamvalueE;
2595
2596 if (pContext != null) {
2597 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ENUMERATION_CONTEXT);
2598 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
2599 }
2600
2601 if (pMaxObjectCount != null) {
2602 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2603 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2604 }
2605
2606 return simplereqE;
2607 }
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619 public Element PullInstancePaths_request(
2620 Document pDoc,
2621 CIMObjectPath pPath,
2622 String pContext,
2623 UnsignedInteger32 pMaxObjectCount
2624 )
2625 throws WBEMException {
2626 String className = pPath.getObjectName();
2627
2628 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2629
2630 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2631 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "PullInstancePaths");
2632 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2633
2634 Element iparamvalueE;
2635
2636 if (pContext != null) {
2637 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ENUMERATION_CONTEXT);
2638 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
2639 }
2640
2641 if (pMaxObjectCount != null) {
2642 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2643 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2644 }
2645
2646 return simplereqE;
2647 }
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659 public Element PullInstances_request(
2660 Document pDoc,
2661 CIMObjectPath pPath,
2662 String pContext,
2663 UnsignedInteger32 pMaxObjectCount
2664 )
2665 throws WBEMException {
2666 String className = pPath.getObjectName();
2667
2668 if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER, "null class name");
2669
2670 Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
2671 Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "PullInstances");
2672 CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
2673
2674 Element iparamvalueE;
2675
2676 if (pContext != null) {
2677 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ENUMERATION_CONTEXT);
2678 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
2679 }
2680
2681 if (pMaxObjectCount != null) {
2682 iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
2683 CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
2684 }
2685
2686 return simplereqE;
2687 }
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697 public Element sendIndication_request(Document pDoc, CIMInstance pIndication) throws WBEMException {
2698 Element simpleexpreqE = CIMXMLBuilderImpl.createSIMPLEEXPREQ(pDoc);
2699 Element expmethodcallE = CIMXMLBuilderImpl.createEXPMETHODCALL(pDoc, simpleexpreqE, "ExportIndication");
2700 Element expparamvalueE = CIMXMLBuilderImpl.createEXPPARAMVALUE(pDoc, expmethodcallE, "NewIndication");
2701
2702 CIMXMLBuilderImpl.createINSTANCE(pDoc, expparamvalueE, pIndication);
2703
2704 return simpleexpreqE;
2705 }
2706 }