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 karl 1.12 CIMInstance _buildInstanceSkeleton(
204 const CIMObjectPath & objectPath,
|
205 karl 1.13 const CIMName& className,
206 CIMClass& returnedClass);
|
207 karl 1.12
208 CIMObjectPath _buildObjectPath(
209 const CIMObjectPath& objectPath,
210 const CIMName& className,
211 const CIMInstance& instance);
212 CIMObjectPath _buildInstancePath(
213 const CIMObjectPath& objectPath,
214 const CIMName& className,
215 const CIMInstance& instance);
|
216 karl 1.1
|
217 karl 1.12 CIMClass _getClass(const CIMObjectPath& objectPath,
218 const CIMName& className);
|
219 karl 1.1
220 Array<CIMNamespaceName> _enumerateNameSpaces();
221
|
222 tony 1.4 CIMInstance _buildInstancePGCIMXMLCommunicationMechanism(
|
223 karl 1.12 const CIMObjectPath& objectPath,
|
224 tony 1.4 const String& namespaceType,
|
225 karl 1.14 const Uint16& accessProtocol,
|
226 karl 1.15 const String& IPAddress);
|
227 tony 1.4
228 Array<CIMInstance> _buildInstancesPGCIMXMLCommunicationMechanism(
|
229 karl 1.15 const CIMObjectPath& objectPath);
|
230 tony 1.4
|
231 karl 1.12 CIMInstance _getInstanceCIMObjectManager(
232 const CIMObjectPath& objectPath,
233 const Boolean includeQualifiers,
234 const Boolean includeClassOrigin,
235 const CIMPropertyList& propertyList);
|
236 tony 1.4
|
237 karl 1.18 String _getObjectManagerName();
238
|
239 karl 1.12 Array<CIMInstance> _getInstancesCIMNamespace(
|
240 karl 1.15 const CIMObjectPath& objectPath);
|
241 tony 1.4
|
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.9 Boolean _getInstanceFromRepositoryCIMObjectManager(
|
256 karl 1.12 const CIMObjectPath& objectPath,
257 CIMInstance& rtnInstance,
258 const Boolean includeQualifiers,
259 const Boolean includeClassOrigin,
260 const CIMPropertyList& propertyList);
|
261 karl 1.6
|
262 karl 1.19 Boolean InteropProvider::isModifyAllowed(const OperationContext & context,
263 const CIMObjectPath & instanceReference,
264 const CIMInstance& modifiedIns,
265 const Boolean includeQualifiers,
266 const CIMPropertyList& propertyList,
267 const CIMPropertyList& allowedModifyProperties);
268
|
269 karl 1.6 void modifyObjectManagerInstance(const OperationContext & context,
270 const CIMObjectPath & instanceReference,
271 const CIMInstance& modifiedIns,
272 const Boolean includeQualifiers,
|
273 karl 1.19 const CIMPropertyList& propertyList);
|
274 karl 1.6
|
275 karl 1.15 // The following are internal equivalents of the operations
276 // allowing the operations to call one another internally within
277 // the provider.
|
278 karl 1.16 Array<CIMInstance> localEnumerateInstances(
|
279 karl 1.15 const OperationContext & context,
280 const CIMObjectPath & ref,
281 const Boolean includeQualifiers,
282 const Boolean includeClassOrigin,
283 const CIMPropertyList& propertyList);
284
|
285 karl 1.16 Array<CIMObject> localReferences(
|
286 karl 1.15 const OperationContext & context,
287 const CIMObjectPath & objectName,
288 const CIMName & resultClass,
289 const String & role,
290 const Boolean includeQualifiers,
291 const Boolean includeClassOrigin,
292 const CIMPropertyList & propertyList);
293
|
294 karl 1.17 CIMInstance localGetInstance(
|
295 karl 1.15 const OperationContext & context,
296 const CIMObjectPath & instanceName,
297 const Boolean includeQualifiers,
298 const Boolean includeClassOrigin,
299 const CIMPropertyList & propertyList);
|
300 karl 1.18
301 // Repository Instance variable
|
302 karl 1.1 CIMRepository* _repository;
|
303 karl 1.18 // local save for name of object manager
304 String _objectManagerName;
|
305 karl 1.1 };
306
307 PEGASUS_NAMESPACE_END
308
309 #endif // InteropProvider_h
|