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 kumpf 1.62 // Author: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
33 mday 1.40 //
|
34 a.arora 1.64 // Modified By: Josephine Eskaline Joyce (jojustin@in.ibm.com) for PEP101
|
35 joyce.j 1.66 // Josephine Eskaline Joyce (jojustin@in.ibm.com) for Bug#2486
|
36 mday 1.40 //
37 //%/////////////////////////////////////////////////////////////////////////////
38
39
40 #include <Pegasus/Common/Constants.h>
|
41 kumpf 1.62 #include <Pegasus/Common/MessageQueue.h>
42 #include "CIMOMHandleRep.h"
43 #include "InternalCIMOMHandleRep.h"
44 #include "ClientCIMOMHandleRep.h"
|
45 mday 1.40
|
46 kumpf 1.62 #include "CIMOMHandle.h"
|
47 joyce.j 1.66
|
48 chuck 1.46
|
49 mday 1.40 PEGASUS_NAMESPACE_BEGIN
50
|
51 kumpf 1.62 CIMOMHandle::CIMOMHandle(void)
|
52 mday 1.40 {
|
53 kumpf 1.62 // The existence of a BinaryMessageHandler determines which Rep to use
|
54 joyce.j 1.66 MessageQueue* bmh = MessageQueue::lookup(PEGASUS_QUEUENAME_BINARY_HANDLER);
55 if (bmh != 0)
|
56 chuck 1.45 {
|
57 kumpf 1.62 // A BinaryMessageHandler exists. We can use InternalCIMOMHandleRep
58 _rep = new InternalCIMOMHandleRep();
|
59 chuck 1.45 }
60 else
61 {
|
62 kumpf 1.62 // No BinaryMessageHandler exists. We must use ClientCIMOMHandleRep
63 _rep = new ClientCIMOMHandleRep();
64 }
65 }
|
66 mday 1.40
|
67 chuck 1.57 #ifdef PEGASUS_OS_OS400
|
68 kumpf 1.62 CIMOMHandle::CIMOMHandle(Uint32 os400UserStateKey)
69 {
|
70 david 1.69
71 // A BinaryMessageHandler exists. We can use InternalCIMOMHandleRep
72 _rep = new InternalCIMOMHandleRep(os400UserStateKey);
73
|
74 chuck 1.57 }
75
76 void CIMOMHandle::setOS400ProfileHandle(const char * profileHandle)
77 {
|
78 kumpf 1.62 _rep->setOS400ProfileHandle(profileHandle);
|
79 chuck 1.56 }
80 #endif
81
|
82 kumpf 1.62 CIMOMHandle::CIMOMHandle(const CIMOMHandle & handle)
|
83 mday 1.40 {
|
84 kumpf 1.68 Inc(this->_rep = handle._rep);
|
85 mday 1.40 }
86
87 CIMOMHandle::~CIMOMHandle(void)
88 {
|
89 kumpf 1.62 Dec(_rep);
|
90 mday 1.40 }
91
92 CIMOMHandle & CIMOMHandle::operator =(const CIMOMHandle & handle)
93 {
|
94 kumpf 1.62 if (this != &handle)
95 {
96 Dec(_rep);
97 Inc(_rep = handle._rep);
98 }
99 return *this;
|
100 mday 1.40 }
101
102
103 CIMClass CIMOMHandle::getClass(
|
104 kumpf 1.62 const OperationContext& context,
|
105 mday 1.40 const CIMNamespaceName& nameSpace,
106 const CIMName& className,
107 Boolean localOnly,
108 Boolean includeQualifiers,
109 Boolean includeClassOrigin,
110 const CIMPropertyList& propertyList)
111 {
|
112 kumpf 1.62 return _rep->getClass(
113 context,
|
114 mday 1.40 nameSpace,
115 className,
116 localOnly,
117 includeQualifiers,
118 includeClassOrigin,
|
119 kumpf 1.62 propertyList);
|
120 mday 1.40 }
121
122 Array<CIMClass> CIMOMHandle::enumerateClasses(
|
123 kumpf 1.62 const OperationContext& context,
|
124 mday 1.40 const CIMNamespaceName& nameSpace,
125 const CIMName& className,
126 Boolean deepInheritance,
127 Boolean localOnly,
128 Boolean includeQualifiers,
129 Boolean includeClassOrigin)
130 {
|
131 kumpf 1.62 return _rep->enumerateClasses(
132 context,
|
133 mday 1.40 nameSpace,
134 className,
135 deepInheritance,
136 localOnly,
137 includeQualifiers,
|
138 kumpf 1.62 includeClassOrigin);
|
139 mday 1.40 }
140
141 Array<CIMName> CIMOMHandle::enumerateClassNames(
|
142 kumpf 1.62 const OperationContext& context,
143 const CIMNamespaceName& nameSpace,
|
144 mday 1.40 const CIMName& className,
145 Boolean deepInheritance)
146 {
|
147 kumpf 1.62 return _rep->enumerateClassNames(
148 context,
|
149 mday 1.40 nameSpace,
150 className,
|
151 kumpf 1.62 deepInheritance);
|
152 mday 1.40 }
153
154 void CIMOMHandle::createClass(
|
155 kumpf 1.62 const OperationContext& context,
|
156 mday 1.40 const CIMNamespaceName& nameSpace,
157 const CIMClass& newClass)
158 {
|
159 kumpf 1.62 _rep->createClass(
160 context,
161 nameSpace,
162 newClass);
|
163 mday 1.40 }
164
165 void CIMOMHandle::modifyClass(
|
166 kumpf 1.62 const OperationContext& context,
167 const CIMNamespaceName& nameSpace,
|
168 mday 1.40 const CIMClass& modifiedClass)
169 {
|
170 kumpf 1.62 _rep->modifyClass(
171 context,
172 nameSpace,
173 modifiedClass);
|
174 mday 1.40 }
175
176 void CIMOMHandle::deleteClass(
|
177 kumpf 1.62 const OperationContext& context,
178 const CIMNamespaceName& nameSpace,
|
179 mday 1.40 const CIMName& className)
180 {
|
181 kumpf 1.62 _rep->deleteClass(
182 context,
183 nameSpace,
184 className);
|
185 mday 1.40 }
186
187 CIMInstance CIMOMHandle::getInstance(
|
188 kumpf 1.62 const OperationContext& context,
189 const CIMNamespaceName& nameSpace,
190 const CIMObjectPath& instanceName,
191 Boolean localOnly,
192 Boolean includeQualifiers,
193 Boolean includeClassOrigin,
194 const CIMPropertyList& propertyList)
|
195 mday 1.40 {
|
196 kumpf 1.62 return _rep->getInstance(
197 context,
198 nameSpace,
199 instanceName,
200 localOnly,
201 includeQualifiers,
202 includeClassOrigin,
203 propertyList);
|
204 mday 1.40 }
205
206 Array<CIMInstance> CIMOMHandle::enumerateInstances(
|
207 kumpf 1.62 const OperationContext& context,
208 const CIMNamespaceName& nameSpace,
209 const CIMName& className,
210 Boolean deepInheritance,
211 Boolean localOnly,
212 Boolean includeQualifiers,
213 Boolean includeClassOrigin,
214 const CIMPropertyList& propertyList)
|
215 mday 1.40 {
|
216 kumpf 1.62 return _rep->enumerateInstances(
217 context,
218 nameSpace,
219 className,
220 deepInheritance,
221 localOnly,
222 includeQualifiers,
223 includeClassOrigin,
224 propertyList);
|
225 mday 1.40 }
226
227 Array<CIMObjectPath> CIMOMHandle::enumerateInstanceNames(
|
228 kumpf 1.62 const OperationContext& context,
229 const CIMNamespaceName& nameSpace,
230 const CIMName& className)
|
231 mday 1.40 {
|
232 kumpf 1.62 return _rep->enumerateInstanceNames(
233 context,
234 nameSpace,
235 className);
|
236 mday 1.40 }
237
238 CIMObjectPath CIMOMHandle::createInstance(
|
239 kumpf 1.62 const OperationContext& context,
240 const CIMNamespaceName& nameSpace,
241 const CIMInstance& newInstance)
|
242 mday 1.40 {
|
243 kumpf 1.62 return _rep->createInstance(
244 context,
245 nameSpace,
246 newInstance);
|
247 mday 1.40 }
248
249 void CIMOMHandle::modifyInstance(
|
250 kumpf 1.62 const OperationContext& context,
251 const CIMNamespaceName& nameSpace,
252 const CIMInstance& modifiedInstance,
253 Boolean includeQualifiers,
254 const CIMPropertyList& propertyList)
|
255 mday 1.40 {
|
256 kumpf 1.62 _rep->modifyInstance(
257 context,
258 nameSpace,
259 modifiedInstance,
260 includeQualifiers,
261 propertyList);
|
262 mday 1.40 }
263
264 void CIMOMHandle::deleteInstance(
|
265 kumpf 1.62 const OperationContext& context,
266 const CIMNamespaceName& nameSpace,
267 const CIMObjectPath& instanceName)
|
268 mday 1.40 {
|
269 kumpf 1.62 _rep->deleteInstance(
270 context,
271 nameSpace,
272 instanceName);
|
273 mday 1.40 }
274
275 Array<CIMObject> CIMOMHandle::execQuery(
|
276 kumpf 1.62 const OperationContext& context,
277 const CIMNamespaceName& nameSpace,
278 const String& queryLanguage,
279 const String& query)
|
280 mday 1.40 {
|
281 kumpf 1.62 return _rep->execQuery(
282 context,
283 nameSpace,
284 queryLanguage,
285 query);
|
286 mday 1.40 }
287
288 Array<CIMObject> CIMOMHandle::associators(
|
289 kumpf 1.62 const OperationContext& context,
290 const CIMNamespaceName& nameSpace,
|
291 mday 1.40 const CIMObjectPath& objectName,
292 const CIMName& assocClass,
293 const CIMName& resultClass,
294 const String& role,
295 const String& resultRole,
296 Boolean includeQualifiers,
297 Boolean includeClassOrigin,
298 const CIMPropertyList& propertyList)
299 {
|
300 kumpf 1.62 return _rep->associators(
301 context,
|
302 mday 1.40 nameSpace,
303 objectName,
304 assocClass,
305 resultClass,
306 role,
307 resultRole,
308 includeQualifiers,
309 includeClassOrigin,
|
310 kumpf 1.62 propertyList);
|
311 mday 1.40 }
312
313 Array<CIMObjectPath> CIMOMHandle::associatorNames(
|
314 kumpf 1.62 const OperationContext& context,
315 const CIMNamespaceName& nameSpace,
|
316 mday 1.40 const CIMObjectPath& objectName,
317 const CIMName& assocClass,
318 const CIMName& resultClass,
319 const String& role,
320 const String& resultRole)
321 {
|
322 kumpf 1.62 return _rep->associatorNames(
323 context,
324 nameSpace,
325 objectName,
326 assocClass,
327 resultClass,
328 role,
329 resultRole);
|
330 mday 1.40 }
331
332 Array<CIMObject> CIMOMHandle::references(
|
333 kumpf 1.62 const OperationContext& context,
334 const CIMNamespaceName& nameSpace,
335 const CIMObjectPath& objectName,
336 const CIMName& resultClass,
337 const String& role,
338 Boolean includeQualifiers,
339 Boolean includeClassOrigin,
340 const CIMPropertyList& propertyList)
|
341 mday 1.40 {
|
342 kumpf 1.62 return _rep->references(
343 context,
344 nameSpace,
345 objectName,
346 resultClass,
347 role,
348 includeQualifiers,
349 includeClassOrigin,
350 propertyList);
|
351 mday 1.40 }
352
353 Array<CIMObjectPath> CIMOMHandle::referenceNames(
|
354 kumpf 1.62 const OperationContext& context,
355 const CIMNamespaceName& nameSpace,
356 const CIMObjectPath& objectName,
357 const CIMName& resultClass,
358 const String& role)
|
359 mday 1.40 {
|
360 kumpf 1.62 return _rep->referenceNames(
361 context,
362 nameSpace,
363 objectName,
364 resultClass,
365 role);
|
366 mday 1.40 }
367
368 CIMValue CIMOMHandle::getProperty(
|
369 kumpf 1.62 const OperationContext& context,
370 const CIMNamespaceName& nameSpace,
|
371 mday 1.40 const CIMObjectPath& instanceName,
372 const CIMName& propertyName)
373 {
|
374 kumpf 1.62 return _rep->getProperty(
375 context,
|
376 mday 1.40 nameSpace,
377 instanceName,
|
378 kumpf 1.62 propertyName);
|
379 mday 1.40 }
380
381 void CIMOMHandle::setProperty(
|
382 kumpf 1.62 const OperationContext& context,
383 const CIMNamespaceName& nameSpace,
384 const CIMObjectPath& instanceName,
385 const CIMName& propertyName,
386 const CIMValue& newValue)
|
387 mday 1.40 {
|
388 kumpf 1.62 _rep->setProperty(
389 context,
390 nameSpace,
391 instanceName,
392 propertyName,
393 newValue);
|
394 mday 1.40 }
395
396 CIMValue CIMOMHandle::invokeMethod(
|
397 kumpf 1.62 const OperationContext& context,
398 const CIMNamespaceName& nameSpace,
|
399 mday 1.40 const CIMObjectPath& instanceName,
400 const CIMName& methodName,
401 const Array<CIMParamValue>& inParameters,
402 Array<CIMParamValue>& outParameters)
403 {
|
404 kumpf 1.62 return _rep->invokeMethod(
405 context,
406 nameSpace,
407 instanceName,
408 methodName,
409 inParameters,
410 outParameters);
|
411 mday 1.40 }
412
413
|
414 kumpf 1.51 void CIMOMHandle::get_idle_timer(void *tv)
|
415 mday 1.40 {
|
416 kumpf 1.62 _rep->get_idle_timer(reinterpret_cast<struct timeval*>(tv));
|
417 mday 1.40 }
418
419 void CIMOMHandle::update_idle_timer(void)
420 {
|
421 kumpf 1.62 _rep->update_idle_timer();
|
422 mday 1.40 }
423
424 Boolean CIMOMHandle::pending_operation(void)
425 {
|
426 kumpf 1.62 return _rep->pending_operation();
|
427 kumpf 1.49 }
428
429 void CIMOMHandle::disallowProviderUnload()
430 {
|
431 kumpf 1.62 _rep->disallowProviderUnload();
|
432 kumpf 1.49 }
433
434 void CIMOMHandle::allowProviderUnload()
435 {
|
436 kumpf 1.62 _rep->allowProviderUnload();
|
437 mday 1.40 }
438
439 Boolean CIMOMHandle::unload_ok(void)
440 {
|
441 kumpf 1.62 return _rep->unload_ok();
|
442 mday 1.40 }
|
443 chuck 1.61
444 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
445 OperationContext CIMOMHandle::getResponseContext(void)
446 {
|
447 kumpf 1.62 return _rep->getResponseContext();
|
448 chuck 1.61 }
449 #endif
|
450 mday 1.40
451 PEGASUS_NAMESPACE_END
|