1 karl 1.70 //%2006////////////////////////////////////////////////////////////////////////
|
2 mday 1.40 //
|
3 karl 1.63 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.53 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.63 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.67 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.70 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mday 1.40 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 karl 1.53 //
|
21 mday 1.40 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34
35 #include <Pegasus/Common/Constants.h>
|
36 kumpf 1.62 #include <Pegasus/Common/MessageQueue.h>
37 #include "CIMOMHandleRep.h"
38 #include "InternalCIMOMHandleRep.h"
39 #include "ClientCIMOMHandleRep.h"
|
40 mday 1.40
|
41 kumpf 1.62 #include "CIMOMHandle.h"
|
42 joyce.j 1.66
|
43 chuck 1.46
|
44 mday 1.40 PEGASUS_NAMESPACE_BEGIN
45
|
46 kumpf 1.62 CIMOMHandle::CIMOMHandle(void)
|
47 mday 1.40 {
|
48 kumpf 1.62 // The existence of a BinaryMessageHandler determines which Rep to use
|
49 joyce.j 1.66 MessageQueue* bmh = MessageQueue::lookup(PEGASUS_QUEUENAME_BINARY_HANDLER);
50 if (bmh != 0)
|
51 chuck 1.45 {
|
52 kumpf 1.62 // A BinaryMessageHandler exists. We can use InternalCIMOMHandleRep
53 _rep = new InternalCIMOMHandleRep();
|
54 chuck 1.45 }
55 else
56 {
|
57 kumpf 1.62 // No BinaryMessageHandler exists. We must use ClientCIMOMHandleRep
58 _rep = new ClientCIMOMHandleRep();
59 }
60 }
|
61 mday 1.40
|
62 chuck 1.57 #ifdef PEGASUS_OS_OS400
|
63 kumpf 1.62 CIMOMHandle::CIMOMHandle(Uint32 os400UserStateKey)
64 {
|
65 david 1.69
66 // A BinaryMessageHandler exists. We can use InternalCIMOMHandleRep
67 _rep = new InternalCIMOMHandleRep(os400UserStateKey);
68
|
69 chuck 1.57 }
70
71 void CIMOMHandle::setOS400ProfileHandle(const char * profileHandle)
72 {
|
73 kumpf 1.62 _rep->setOS400ProfileHandle(profileHandle);
|
74 chuck 1.56 }
75 #endif
76
|
77 kumpf 1.62 CIMOMHandle::CIMOMHandle(const CIMOMHandle & handle)
|
78 mday 1.40 {
|
79 kumpf 1.68 Inc(this->_rep = handle._rep);
|
80 mday 1.40 }
81
82 CIMOMHandle::~CIMOMHandle(void)
83 {
|
84 kumpf 1.62 Dec(_rep);
|
85 mday 1.40 }
86
87 CIMOMHandle & CIMOMHandle::operator =(const CIMOMHandle & handle)
88 {
|
89 kumpf 1.62 if (this != &handle)
90 {
91 Dec(_rep);
92 Inc(_rep = handle._rep);
93 }
94 return *this;
|
95 mday 1.40 }
96
97
98 CIMClass CIMOMHandle::getClass(
|
99 kumpf 1.62 const OperationContext& context,
|
100 mday 1.40 const CIMNamespaceName& nameSpace,
101 const CIMName& className,
102 Boolean localOnly,
103 Boolean includeQualifiers,
104 Boolean includeClassOrigin,
105 const CIMPropertyList& propertyList)
106 {
|
107 kumpf 1.62 return _rep->getClass(
108 context,
|
109 mday 1.40 nameSpace,
110 className,
111 localOnly,
112 includeQualifiers,
113 includeClassOrigin,
|
114 kumpf 1.62 propertyList);
|
115 mday 1.40 }
116
117 Array<CIMClass> CIMOMHandle::enumerateClasses(
|
118 kumpf 1.62 const OperationContext& context,
|
119 mday 1.40 const CIMNamespaceName& nameSpace,
120 const CIMName& className,
121 Boolean deepInheritance,
122 Boolean localOnly,
123 Boolean includeQualifiers,
124 Boolean includeClassOrigin)
125 {
|
126 kumpf 1.62 return _rep->enumerateClasses(
127 context,
|
128 mday 1.40 nameSpace,
129 className,
130 deepInheritance,
131 localOnly,
132 includeQualifiers,
|
133 kumpf 1.62 includeClassOrigin);
|
134 mday 1.40 }
135
136 Array<CIMName> CIMOMHandle::enumerateClassNames(
|
137 kumpf 1.62 const OperationContext& context,
138 const CIMNamespaceName& nameSpace,
|
139 mday 1.40 const CIMName& className,
140 Boolean deepInheritance)
141 {
|
142 kumpf 1.62 return _rep->enumerateClassNames(
143 context,
|
144 mday 1.40 nameSpace,
145 className,
|
146 kumpf 1.62 deepInheritance);
|
147 mday 1.40 }
148
149 void CIMOMHandle::createClass(
|
150 kumpf 1.62 const OperationContext& context,
|
151 mday 1.40 const CIMNamespaceName& nameSpace,
152 const CIMClass& newClass)
153 {
|
154 kumpf 1.62 _rep->createClass(
155 context,
156 nameSpace,
157 newClass);
|
158 mday 1.40 }
159
160 void CIMOMHandle::modifyClass(
|
161 kumpf 1.62 const OperationContext& context,
162 const CIMNamespaceName& nameSpace,
|
163 mday 1.40 const CIMClass& modifiedClass)
164 {
|
165 kumpf 1.62 _rep->modifyClass(
166 context,
167 nameSpace,
168 modifiedClass);
|
169 mday 1.40 }
170
171 void CIMOMHandle::deleteClass(
|
172 kumpf 1.62 const OperationContext& context,
173 const CIMNamespaceName& nameSpace,
|
174 mday 1.40 const CIMName& className)
175 {
|
176 kumpf 1.62 _rep->deleteClass(
177 context,
178 nameSpace,
179 className);
|
180 mday 1.40 }
181
182 CIMInstance CIMOMHandle::getInstance(
|
183 kumpf 1.62 const OperationContext& context,
184 const CIMNamespaceName& nameSpace,
185 const CIMObjectPath& instanceName,
186 Boolean localOnly,
187 Boolean includeQualifiers,
188 Boolean includeClassOrigin,
189 const CIMPropertyList& propertyList)
|
190 mday 1.40 {
|
191 kumpf 1.62 return _rep->getInstance(
192 context,
193 nameSpace,
194 instanceName,
195 localOnly,
196 includeQualifiers,
197 includeClassOrigin,
198 propertyList);
|
199 mday 1.40 }
200
201 Array<CIMInstance> CIMOMHandle::enumerateInstances(
|
202 kumpf 1.62 const OperationContext& context,
203 const CIMNamespaceName& nameSpace,
204 const CIMName& className,
205 Boolean deepInheritance,
206 Boolean localOnly,
207 Boolean includeQualifiers,
208 Boolean includeClassOrigin,
209 const CIMPropertyList& propertyList)
|
210 mday 1.40 {
|
211 kumpf 1.62 return _rep->enumerateInstances(
212 context,
213 nameSpace,
214 className,
215 deepInheritance,
216 localOnly,
217 includeQualifiers,
218 includeClassOrigin,
219 propertyList);
|
220 mday 1.40 }
221
222 Array<CIMObjectPath> CIMOMHandle::enumerateInstanceNames(
|
223 kumpf 1.62 const OperationContext& context,
224 const CIMNamespaceName& nameSpace,
225 const CIMName& className)
|
226 mday 1.40 {
|
227 kumpf 1.62 return _rep->enumerateInstanceNames(
228 context,
229 nameSpace,
230 className);
|
231 mday 1.40 }
232
233 CIMObjectPath CIMOMHandle::createInstance(
|
234 kumpf 1.62 const OperationContext& context,
235 const CIMNamespaceName& nameSpace,
236 const CIMInstance& newInstance)
|
237 mday 1.40 {
|
238 kumpf 1.62 return _rep->createInstance(
239 context,
240 nameSpace,
241 newInstance);
|
242 mday 1.40 }
243
244 void CIMOMHandle::modifyInstance(
|
245 kumpf 1.62 const OperationContext& context,
246 const CIMNamespaceName& nameSpace,
247 const CIMInstance& modifiedInstance,
248 Boolean includeQualifiers,
249 const CIMPropertyList& propertyList)
|
250 mday 1.40 {
|
251 kumpf 1.62 _rep->modifyInstance(
252 context,
253 nameSpace,
254 modifiedInstance,
255 includeQualifiers,
256 propertyList);
|
257 mday 1.40 }
258
259 void CIMOMHandle::deleteInstance(
|
260 kumpf 1.62 const OperationContext& context,
261 const CIMNamespaceName& nameSpace,
262 const CIMObjectPath& instanceName)
|
263 mday 1.40 {
|
264 kumpf 1.62 _rep->deleteInstance(
265 context,
266 nameSpace,
267 instanceName);
|
268 mday 1.40 }
269
270 Array<CIMObject> CIMOMHandle::execQuery(
|
271 kumpf 1.62 const OperationContext& context,
272 const CIMNamespaceName& nameSpace,
273 const String& queryLanguage,
274 const String& query)
|
275 mday 1.40 {
|
276 kumpf 1.62 return _rep->execQuery(
277 context,
278 nameSpace,
279 queryLanguage,
280 query);
|
281 mday 1.40 }
282
283 Array<CIMObject> CIMOMHandle::associators(
|
284 kumpf 1.62 const OperationContext& context,
285 const CIMNamespaceName& nameSpace,
|
286 mday 1.40 const CIMObjectPath& objectName,
287 const CIMName& assocClass,
288 const CIMName& resultClass,
289 const String& role,
290 const String& resultRole,
291 Boolean includeQualifiers,
292 Boolean includeClassOrigin,
293 const CIMPropertyList& propertyList)
294 {
|
295 kumpf 1.62 return _rep->associators(
296 context,
|
297 mday 1.40 nameSpace,
298 objectName,
299 assocClass,
300 resultClass,
301 role,
302 resultRole,
303 includeQualifiers,
304 includeClassOrigin,
|
305 kumpf 1.62 propertyList);
|
306 mday 1.40 }
307
308 Array<CIMObjectPath> CIMOMHandle::associatorNames(
|
309 kumpf 1.62 const OperationContext& context,
310 const CIMNamespaceName& nameSpace,
|
311 mday 1.40 const CIMObjectPath& objectName,
312 const CIMName& assocClass,
313 const CIMName& resultClass,
314 const String& role,
315 const String& resultRole)
316 {
|
317 kumpf 1.62 return _rep->associatorNames(
318 context,
319 nameSpace,
320 objectName,
321 assocClass,
322 resultClass,
323 role,
324 resultRole);
|
325 mday 1.40 }
326
327 Array<CIMObject> CIMOMHandle::references(
|
328 kumpf 1.62 const OperationContext& context,
329 const CIMNamespaceName& nameSpace,
330 const CIMObjectPath& objectName,
331 const CIMName& resultClass,
332 const String& role,
333 Boolean includeQualifiers,
334 Boolean includeClassOrigin,
335 const CIMPropertyList& propertyList)
|
336 mday 1.40 {
|
337 kumpf 1.62 return _rep->references(
338 context,
339 nameSpace,
340 objectName,
341 resultClass,
342 role,
343 includeQualifiers,
344 includeClassOrigin,
345 propertyList);
|
346 mday 1.40 }
347
348 Array<CIMObjectPath> CIMOMHandle::referenceNames(
|
349 kumpf 1.62 const OperationContext& context,
350 const CIMNamespaceName& nameSpace,
351 const CIMObjectPath& objectName,
352 const CIMName& resultClass,
353 const String& role)
|
354 mday 1.40 {
|
355 kumpf 1.62 return _rep->referenceNames(
356 context,
357 nameSpace,
358 objectName,
359 resultClass,
360 role);
|
361 mday 1.40 }
362
363 CIMValue CIMOMHandle::getProperty(
|
364 kumpf 1.62 const OperationContext& context,
365 const CIMNamespaceName& nameSpace,
|
366 mday 1.40 const CIMObjectPath& instanceName,
367 const CIMName& propertyName)
368 {
|
369 kumpf 1.62 return _rep->getProperty(
370 context,
|
371 mday 1.40 nameSpace,
372 instanceName,
|
373 kumpf 1.62 propertyName);
|
374 mday 1.40 }
375
376 void CIMOMHandle::setProperty(
|
377 kumpf 1.62 const OperationContext& context,
378 const CIMNamespaceName& nameSpace,
379 const CIMObjectPath& instanceName,
380 const CIMName& propertyName,
381 const CIMValue& newValue)
|
382 mday 1.40 {
|
383 kumpf 1.62 _rep->setProperty(
384 context,
385 nameSpace,
386 instanceName,
387 propertyName,
388 newValue);
|
389 mday 1.40 }
390
391 CIMValue CIMOMHandle::invokeMethod(
|
392 kumpf 1.62 const OperationContext& context,
393 const CIMNamespaceName& nameSpace,
|
394 mday 1.40 const CIMObjectPath& instanceName,
395 const CIMName& methodName,
396 const Array<CIMParamValue>& inParameters,
397 Array<CIMParamValue>& outParameters)
398 {
|
399 kumpf 1.62 return _rep->invokeMethod(
400 context,
401 nameSpace,
402 instanceName,
403 methodName,
404 inParameters,
405 outParameters);
|
406 mday 1.40 }
407
408
|
409 kumpf 1.49 void CIMOMHandle::disallowProviderUnload()
410 {
|
411 kumpf 1.62 _rep->disallowProviderUnload();
|
412 kumpf 1.49 }
413
414 void CIMOMHandle::allowProviderUnload()
415 {
|
416 kumpf 1.62 _rep->allowProviderUnload();
|
417 mday 1.40 }
418
419 Boolean CIMOMHandle::unload_ok(void)
420 {
|
421 kumpf 1.62 return _rep->unload_ok();
|
422 mday 1.40 }
|
423 chuck 1.61
424 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
425 OperationContext CIMOMHandle::getResponseContext(void)
426 {
|
427 kumpf 1.62 return _rep->getResponseContext();
|
428 chuck 1.61 }
429 #endif
|
430 mday 1.40
431 PEGASUS_NAMESPACE_END
|