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