1 karl 1.8 //%2005////////////////////////////////////////////////////////////////////////
|
2 karl 1.1 //
|
3 karl 1.7 // 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.2 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.7 // 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.8 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.1 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy
13 // of this software and associated documentation files (the "Software"), to
14 // deal in the Software without restriction, including without limitation the
15 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16 // sell copies of the Software, and to permit persons to whom the Software is
17 // furnished to do so, subject to the following conditions:
|
18 karl 1.2 //
|
19 karl 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
20 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
21 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
22 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //==============================================================================
29 //
30 // Author: Karl Schopmeyer (k.schopmeyer@opengrooup.org)
31 //
32 // Modified By:
33 //
34 //%////////////////////////////////////////////////////////////////////////////
35
36
37 #ifndef InteropProvider_h
38 #define InteropProvider_h
39
40 karl 1.1 ///////////////////////////////////////////////////////////////////////////////
41 // Interop Provider
42 ///////////////////////////////////////////////////////////////////////////////
43
44 #include <Pegasus/Common/Config.h>
45 #include <Pegasus/ControlProviders/InteropProvider/Linkage.h>
46
47 #include <Pegasus/Common/String.h>
48 #include <Pegasus/Common/System.h>
49 #include <Pegasus/Common/ArrayInternal.h>
50 #include <Pegasus/Common/CIMType.h>
51 #include <Pegasus/Common/CIMInstance.h>
52 #include <Pegasus/Common/CIMObjectPath.h>
53 #include <Pegasus/Common/InternalException.h>
54 #include <Pegasus/Common/CIMStatusCode.h>
55 #include <Pegasus/Common/Tracer.h>
56 #include <Pegasus/Config/ConfigManager.h>
57
58 #include <Pegasus/Repository/CIMRepository.h>
59 #include <Pegasus/Provider/CIMInstanceProvider.h>
60 #include <Pegasus/Provider/CIMAssociationProvider.h>
61 karl 1.1
62 PEGASUS_NAMESPACE_BEGIN
63
64 /**
65 The InteropProvider provides information and manipulates the
66 following classes from the DMTF CIM_Interop schema:
67 CIM_Namespace - Creation and deletion of namespaces
|
68 karl 1.5 Note: Effective Pegasus 2.4, it processes PG_Namespace
|
69 karl 1.1 __Namespace - Creation and deletion of namespaces (deprecated)
70 CIM_ObjectManager - Reports on the status of the object manager
71 CIM_ObjectManagerCommunicationMechanism - Reports on CIMOM communications
72 COM_CIMXMLCommunicationMechanism - Reports on CIMXML communications
73 CIM_ProtocolAdapter
74
75 Associations
76 NamespaceinManager
77
78 creation and deletion of namespaces using the __namespace class
79 Note however, that the DMTF specification model does not define a class for
80 __namespace so that it is, a "false" class. We assume that it has the
81 same characteristics as the CIM_namespace class defined in CIM 2.6.
82
83 This provider implements the following functions:
84 - createInstance ( adds a new namespace to the repository)
|
85 karl 1.15 - getInstance ( Gets one instance of any supported object)
86 - modifyInstance ( Limited Support - selected fields in CIM_Namespace)
87 - enumerateInstances ( Lists all namespaces of all supported classes)
88 - enumerateInstanceNames ( Lists all namespace names of all supported classes )
89 - reference and associations
|
90 karl 1.1 TBD
91 */
92
93 class PEGASUS_INTEROPPROVIDER_LINKAGE InteropProvider :
94 public CIMInstanceProvider, public CIMAssociationProvider
95 {
96 public:
97
|
98 w.white 1.11 InteropProvider(CIMRepository* repository);
|
99 karl 1.1 virtual ~InteropProvider()
100 {
101 PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::~InteropProvider");
102
103 PEG_METHOD_EXIT();
104 }
105
106 virtual void createInstance(
|
107 karl 1.15 const OperationContext & context,
108 const CIMObjectPath & instanceReference,
|
109 karl 1.1 const CIMInstance& myInstance,
|
110 karl 1.15 ObjectPathResponseHandler & handler);
|
111 karl 1.1
112 virtual void deleteInstance(
|
113 karl 1.15 const OperationContext & context,
|
114 karl 1.1 const CIMObjectPath& instanceName,
|
115 karl 1.15 ResponseHandler & handler);
|
116 karl 1.1
117 virtual void getInstance(
|
118 karl 1.15 const OperationContext & context,
|
119 karl 1.1 const CIMObjectPath& instanceName,
|
120 karl 1.15 const Boolean includeQualifiers,
121 const Boolean includeClassOrigin,
|
122 karl 1.1 const CIMPropertyList& propertyList,
|
123 karl 1.15 InstanceResponseHandler & handler);
|
124 karl 1.1
125 void modifyInstance(
|
126 karl 1.15 const OperationContext & context,
127 const CIMObjectPath & instanceReference,
|
128 karl 1.1 const CIMInstance& modifiedIns,
|
129 karl 1.15 const Boolean includeQualifiers,
|
130 karl 1.1 const CIMPropertyList& propertyList,
|
131 karl 1.5 ResponseHandler & handler);
|
132 karl 1.1
133 virtual void enumerateInstances(
|
134 karl 1.15 const OperationContext & context,
135 const CIMObjectPath & ref,
136 const Boolean includeQualifiers,
137 const Boolean includeClassOrigin,
|
138 karl 1.1 const CIMPropertyList& propertyList,
|
139 karl 1.15 InstanceResponseHandler & handler);
|
140 karl 1.1
141 virtual void enumerateInstanceNames(
142 const OperationContext & context,
143 const CIMObjectPath & classReference,
144 ObjectPathResponseHandler & handler);
145
146 // Association Interfaces
147
148 // CIMAssociationProvider interface
149 virtual void associators(
150 const OperationContext & context,
151 const CIMObjectPath & objectName,
152 const CIMName & associationClass,
153 const CIMName & resultClass,
154 const String & role,
155 const String & resultRole,
156 const Boolean includeQualifiers,
157 const Boolean includeClassOrigin,
158 const CIMPropertyList & propertyList,
159 ObjectResponseHandler & handler);
160
161 karl 1.1 virtual void associatorNames(
162 const OperationContext & context,
163 const CIMObjectPath & objectName,
164 const CIMName & associationClass,
165 const CIMName & resultClass,
166 const String & role,
167 const String & resultRole,
168 ObjectPathResponseHandler & handler);
169
170 virtual void references(
171 const OperationContext & context,
172 const CIMObjectPath & objectName,
173 const CIMName & resultClass,
174 const String & role,
175 const Boolean includeQualifiers,
176 const Boolean includeClassOrigin,
177 const CIMPropertyList & propertyList,
178 ObjectResponseHandler & handler);
179
180 virtual void referenceNames(
181 const OperationContext & context,
182 karl 1.1 const CIMObjectPath & objectName,
183 const CIMName & resultClass,
184 const String & role,
185 ObjectPathResponseHandler & handler);
186
187 /**
188 Standard initialization function for the provider.
189 */
190 void initialize(CIMOMHandle& cimomHandle)
191 {
192 }
193
194 void terminate(void)
195 {
|
196 konrad.r 1.10 // delete self. this is necessary because the entry point for this object allocated it, and
197 // the module is responsible for its memory management.
198 delete this;
|
199 karl 1.1 }
200
201 private:
202
|
203 tony 1.4
|
204 karl 1.12 CIMInstance _buildInstanceSkeleton(
205 const CIMObjectPath & objectPath,
|
206 karl 1.13 const CIMName& className,
207 CIMClass& returnedClass);
|
208 karl 1.12
209 CIMObjectPath _buildObjectPath(
210 const CIMObjectPath& objectPath,
211 const CIMName& className,
212 const CIMInstance& instance);
213 CIMObjectPath _buildInstancePath(
214 const CIMObjectPath& objectPath,
215 const CIMName& className,
216 const CIMInstance& instance);
|
217 karl 1.1
|
218 karl 1.12 CIMClass _getClass(const CIMObjectPath& objectPath,
219 const CIMName& className);
|
220 karl 1.1
221 Array<CIMNamespaceName> _enumerateNameSpaces();
222
|
223 tony 1.4 CIMInstance _buildInstancePGCIMXMLCommunicationMechanism(
|
224 karl 1.12 const CIMObjectPath& objectPath,
|
225 tony 1.4 const String& namespaceType,
|
226 karl 1.14 const Uint16& accessProtocol,
|
227 karl 1.15 const String& IPAddress);
|
228 tony 1.4
229 Array<CIMInstance> _buildInstancesPGCIMXMLCommunicationMechanism(
|
230 karl 1.15 const CIMObjectPath& objectPath);
|
231 tony 1.4
|
232 karl 1.12 CIMInstance _getInstanceCIMObjectManager(
233 const CIMObjectPath& objectPath,
234 const Boolean includeQualifiers,
235 const Boolean includeClassOrigin,
236 const CIMPropertyList& propertyList);
|
237 tony 1.4
|
238 karl 1.12 Array<CIMInstance> _getInstancesCIMNamespace(
|
239 karl 1.15 const CIMObjectPath& objectPath);
|
240 tony 1.4
241
|
242 karl 1.12 CIMInstance _getInstanceCIMNamespace(
243 const CIMObjectPath& objectPath);
|
244 karl 1.1 //
|
245 karl 1.12 CIMInstance _buildInstancePGNamespace(
246 const CIMObjectPath& objectPath,
247 CIMNamespaceName& nameSpace);
|
248 tony 1.4
|
249 karl 1.12 Array<CIMInstance> _buildInstancesNamespaceInManager(
250 const CIMObjectPath& objectPath);
|
251 tony 1.4
|
252 karl 1.12 Array<CIMInstance> _buildInstancesCommMechanismForManager(
253 const CIMObjectPath& objectPath);
|
254 tony 1.4
|
255 karl 1.6
|
256 karl 1.9 Boolean _getInstanceFromRepositoryCIMObjectManager(
|
257 karl 1.12 const CIMObjectPath& objectPath,
258 CIMInstance& rtnInstance,
259 const Boolean includeQualifiers,
260 const Boolean includeClassOrigin,
261 const CIMPropertyList& propertyList);
|
262 karl 1.6
263 void modifyObjectManagerInstance(const OperationContext & context,
264 const CIMObjectPath & instanceReference,
265 const CIMInstance& modifiedIns,
266 const Boolean includeQualifiers,
267 const CIMPropertyList& propertyList,
268 ResponseHandler & handler);
269
|
270 karl 1.15 // The following are internal equivalents of the operations
271 // allowing the operations to call one another internally within
272 // the provider.
273 Array<CIMInstance> InteropProvider::localEnumerateInstances(
274 const OperationContext & context,
275 const CIMObjectPath & ref,
276 const Boolean includeQualifiers,
277 const Boolean includeClassOrigin,
278 const CIMPropertyList& propertyList);
279
280 Array<CIMObject> InteropProvider::localReferences(
281 const OperationContext & context,
282 const CIMObjectPath & objectName,
283 const CIMName & resultClass,
284 const String & role,
285 const Boolean includeQualifiers,
286 const Boolean includeClassOrigin,
287 const CIMPropertyList & propertyList);
288
289 CIMInstance InteropProvider::localGetInstance(
290 const OperationContext & context,
291 karl 1.15 const CIMObjectPath & instanceName,
292 const Boolean includeQualifiers,
293 const Boolean includeClassOrigin,
294 const CIMPropertyList & propertyList);
|
295 karl 1.1 // Repository Instance variable
296 //
297 CIMRepository* _repository;
298 };
299
300 PEGASUS_NAMESPACE_END
301
302 #endif // InteropProvider_h
|