1 martin 1.32 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.33 //
|
3 martin 1.32 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.33 //
|
10 martin 1.32 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.33 //
|
17 martin 1.32 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.33 //
|
20 martin 1.32 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.33 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.32 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.33 //
|
28 martin 1.32 //////////////////////////////////////////////////////////////////////////
|
29 karl 1.1
30
31 #ifndef InteropProvider_h
32 #define InteropProvider_h
33
34 ///////////////////////////////////////////////////////////////////////////////
35 // Interop Provider
36 ///////////////////////////////////////////////////////////////////////////////
37
38 #include <Pegasus/Common/Config.h>
39 #include <Pegasus/ControlProviders/InteropProvider/Linkage.h>
40
41 #include <Pegasus/Common/String.h>
42 #include <Pegasus/Common/System.h>
43 #include <Pegasus/Common/ArrayInternal.h>
44 #include <Pegasus/Common/CIMType.h>
45 #include <Pegasus/Common/CIMInstance.h>
46 #include <Pegasus/Common/CIMObjectPath.h>
47 #include <Pegasus/Common/InternalException.h>
48 #include <Pegasus/Common/CIMStatusCode.h>
49 #include <Pegasus/Common/Tracer.h>
50 karl 1.1 #include <Pegasus/Config/ConfigManager.h>
51
52 #include <Pegasus/Repository/CIMRepository.h>
53 #include <Pegasus/Provider/CIMInstanceProvider.h>
54 #include <Pegasus/Provider/CIMAssociationProvider.h>
|
55 venkat.puvvada 1.27 #include <Pegasus/Provider/CIMMethodProvider.h>
|
56 karl 1.1
|
57 a.dunfey 1.23 PEGASUS_NAMESPACE_BEGIN
|
58 karl 1.1
59 /**
|
60 a.dunfey 1.22 * The InteropProvider services the Interop classes of the DMTF CIM Schema
61 * in the root/PG_InterOp namespace (as well as some related cross-namespace
62 * associations in other namespaces). Through this implementation, combined
63 * with the SLP provider and one or more vendor-supplied SMI providers, the
64 * Pegasus WBEM Server is able to provide a fully-functional implementation of
65 * the SMI-S Server profile (currently, version 1.1.0).
66 *
67 * The following is a list of the association and instance classes supported
68 * by this provider in the root/PG_InterOp namespace:
69 *
70 * PG_CIMXMLCommunicationMechanism (CIM_CIMXMLCommunicationMechanism)
71 * PG_CommMechanismForManager (CIM_CommMechanismForManager)
72 * PG_ComputerSystem (CIM_ComputerSystem)
73 * PG_ElementConformsToProfile (CIM_ElementConformsToProfile)
74 * PG_ElementSoftwareIdentity (CIM_ElementSoftwareIdentity)
75 * PG_HostedAccessPoint (CIM_HostedAccessPoint)
76 * PG_HostedObjectManager (CIM_HostedService)
77 * PG_InstalledSoftwareIdentity (CIM_InstalledSoftwareIdentity)
78 * PG_Namespace (CIM_Namespace)
79 * PG_NamespaceInManager (CIM_NamespaceInManager)
80 * PG_ObjectManager (CIM_ObjectManager)
81 a.dunfey 1.22 * PG_ReferencedProfile (CIM_ReferencedProfile)
82 * PG_RegisteredProfile (CIM_RegisteredProfile)
83 * PG_RegisteredSubProfile (CIM_RegisteredSubProfile)
84 * PG_SoftwareIdentity (CIM_SoftwareIdentity)
85 * PG_SubProfileRequiredProfile (CIM_SubProfileRequiresProfile)
86 *
87 */
88
89 typedef Array<CIMName> CIMNameArray;
90 typedef Array<CIMNamespaceName> CIMNamespaceArray;
|
91 karl 1.1
92 class PEGASUS_INTEROPPROVIDER_LINKAGE InteropProvider :
|
93 venkat.puvvada 1.27 public CIMInstanceProvider,
94 public CIMAssociationProvider,
95 public CIMMethodProvider
|
96 karl 1.1 {
97 public:
98
|
99 w.white 1.11 InteropProvider(CIMRepository* repository);
|
100 karl 1.1 virtual ~InteropProvider()
101 {
|
102 karl 1.25 PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
103 "InteropProvider::~InteropProvider");
|
104 a.dunfey 1.22 PEG_METHOD_EXIT();
|
105 karl 1.1 }
106
|
107 kumpf 1.24 // Note: The initialize() and terminate() methods are not called for
108 // Control Providers.
109 void initialize(CIMOMHandle& handle) { }
110 void terminate() { }
111
|
112 karl 1.1 virtual void createInstance(
|
113 a.dunfey 1.22 const OperationContext & context,
114 const CIMObjectPath & instanceReference,
|
115 karl 1.1 const CIMInstance& myInstance,
|
116 a.dunfey 1.22 ObjectPathResponseHandler & handler);
|
117 karl 1.1
118 virtual void deleteInstance(
|
119 a.dunfey 1.22 const OperationContext & context,
|
120 karl 1.1 const CIMObjectPath& instanceName,
|
121 a.dunfey 1.22 ResponseHandler & handler);
|
122 karl 1.1
123 virtual void getInstance(
|
124 a.dunfey 1.22 const OperationContext & context,
|
125 karl 1.1 const CIMObjectPath& instanceName,
|
126 a.dunfey 1.22 const Boolean includeQualifiers,
127 const Boolean includeClassOrigin,
|
128 karl 1.1 const CIMPropertyList& propertyList,
|
129 a.dunfey 1.22 InstanceResponseHandler & handler);
|
130 karl 1.1
131 void modifyInstance(
|
132 a.dunfey 1.22 const OperationContext & context,
133 const CIMObjectPath & instanceReference,
|
134 karl 1.1 const CIMInstance& modifiedIns,
|
135 a.dunfey 1.22 const Boolean includeQualifiers,
|
136 karl 1.1 const CIMPropertyList& propertyList,
|
137 a.dunfey 1.22 ResponseHandler & handler);
|
138 karl 1.1
139 virtual void enumerateInstances(
|
140 a.dunfey 1.22 const OperationContext & context,
141 const CIMObjectPath & ref,
142 const Boolean includeQualifiers,
143 const Boolean includeClassOrigin,
|
144 karl 1.1 const CIMPropertyList& propertyList,
|
145 a.dunfey 1.22 InstanceResponseHandler & handler);
|
146 karl 1.1
147 virtual void enumerateInstanceNames(
|
148 a.dunfey 1.22 const OperationContext & context,
149 const CIMObjectPath & classReference,
150 ObjectPathResponseHandler & handler);
151
152
153 // CIMAssociationProvider interface
154 virtual void associators(
155 const OperationContext & context,
156 const CIMObjectPath & objectName,
157 const CIMName & associationClass,
158 const CIMName & resultClass,
159 const String & role,
160 const String & resultRole,
161 const Boolean includeQualifiers,
162 const Boolean includeClassOrigin,
163 const CIMPropertyList & propertyList,
164 ObjectResponseHandler & handler);
165
166 virtual void associatorNames(
167 const OperationContext & context,
168 const CIMObjectPath & objectName,
169 a.dunfey 1.22 const CIMName & associationClass,
170 const CIMName & resultClass,
171 const String & role,
172 const String & resultRole,
173 ObjectPathResponseHandler & handler);
174
175 virtual void references(
176 const OperationContext & context,
177 const CIMObjectPath & objectName,
178 const CIMName & resultClass,
179 const String & role,
180 const Boolean includeQualifiers,
181 const Boolean includeClassOrigin,
182 const CIMPropertyList & propertyList,
183 ObjectResponseHandler & handler);
184
185 virtual void referenceNames(
186 const OperationContext & context,
187 const CIMObjectPath & objectName,
188 const CIMName & resultClass,
189 const String & role,
|
190 karl 1.1 ObjectPathResponseHandler & handler);
191
|
192 venkat.puvvada 1.27 // CIMMethodProvider interface
193 virtual void invokeMethod(
194 const OperationContext & context,
195 const CIMObjectPath & objectReference,
196 const CIMName & methodName,
197 const Array<CIMParamValue> & inParameters,
198 MethodResultResponseHandler & handler);
199
|
200 karl 1.1 private:
201
|
202 a.dunfey 1.23 void initProvider();
203
|
204 a.dunfey 1.22 CIMInstance buildInstanceSkeleton(
205 const CIMNamespaceName & nameSpace,
|
206 karl 1.13 const CIMName& className,
|
207 kumpf 1.31 Boolean includeQualifiers,
|
208 karl 1.13 CIMClass& returnedClass);
|
209 karl 1.12
|
210 a.dunfey 1.22 CIMInstance buildCIMXMLCommunicationMechanismInstance(
|
211 tony 1.4 const String& namespaceType,
|
212 karl 1.14 const Uint16& accessProtocol,
|
213 a.dunfey 1.22 const String& IPAddress,
214 const CIMClass & commMechClass);
215
216 Array<CIMInstance> enumCIMXMLCommunicationMechanismInstances();
217
218 Array<CIMInstance> enumHostedAccessPointInstances();
|
219 tony 1.4
|
220 a.dunfey 1.22 CIMInstance getObjectManagerInstance();
|
221 tony 1.4
|
222 a.dunfey 1.22 CIMInstance getComputerSystemInstance();
223
224 CIMInstance getHostedObjectManagerInstance();
225
226 Array<CIMInstance> enumNamespaceInstances();
|
227 tony 1.4
|
228 a.dunfey 1.22 CIMInstance buildNamespaceInstance(const String & nameSpace);
|
229 karl 1.18
|
230 a.dunfey 1.22 CIMObjectPath createNamespace(const CIMInstance & namespaceInstance);
231 void deleteNamespace(const CIMObjectPath & instanceName);
|
232 tony 1.4
|
233 venkat.puvvada 1.27 CIMObjectPath createProviderProfileCapabilityInstance(
234 const CIMInstance & profileInstance,
235 const OperationContext & context);
236
237 void deleteProviderProfileCapabilityInstance(
238 const CIMObjectPath & instanceName,
239 const OperationContext & context);
240
|
241 a.dunfey 1.22 Array<CIMInstance> enumNamespaceInManagerInstances();
|
242 karl 1.6
|
243 a.dunfey 1.22 Array<CIMInstance> enumCommMechanismForManagerInstances();
|
244 karl 1.19
|
245 karl 1.6 void modifyObjectManagerInstance(const OperationContext & context,
246 const CIMObjectPath & instanceReference,
247 const CIMInstance& modifiedIns,
248 const Boolean includeQualifiers,
|
249 karl 1.19 const CIMPropertyList& propertyList);
|
250 karl 1.6
|
251 a.dunfey 1.22 void extractSoftwareIdentityInfo(
252 const CIMInstance & providerInstance,
253 String & moduleName,
254 String & providerName,
255 String & version,
256 String & vendor,
257 Uint16 & majorVersion,
258 Uint16 & minorVersion,
259 Uint16 & revision,
260 Uint16 & build,
261 bool & extendedVersionSupplied,
262 String & interfaceType,
263 String & elementName,
264 String & caption);
265
266 Array<CIMInstance> enumRegisteredProfileInstances();
267 Array<CIMInstance> enumRegisteredSubProfileInstances();
268 Array<CIMInstance> enumReferencedProfileInstances();
|
269 s.manicka 1.26 Array<CIMInstance> getProfilesForVersion(
270 Array<CIMInstance>& subprofs,
271 const String version);
|
272 a.dunfey 1.22 Array<CIMInstance> enumElementConformsToProfileInstances(
273 const OperationContext & opContext,
274 const CIMNamespaceName & opNamespace);
|
275 s.manicka 1.26 Array<CIMInstance> enumElementConformsToProfileRPRPInstances(
276 const OperationContext & opContext,
277 const CIMNamespaceName & opNamespace);
|
278 a.dunfey 1.22 Array<CIMInstance> enumSubProfileRequiresProfileInstances();
279 Array<CIMInstance> enumSoftwareIdentityInstances();
280 Array<CIMInstance> enumElementSoftwareIdentityInstances();
281 Array<CIMInstance> enumInstalledSoftwareIdentityInstances();
282
|
283 venkat.puvvada 1.27 Array<CIMInstance> enumProviderProfileCapabilityInstances(
284 Boolean checkProviders = true,
285 Boolean localOnly = true,
286 Boolean includeQualifiers = false,
287 Boolean includeClassOrigin = false,
288 const CIMPropertyList &propertyList = CIMPropertyList());
289
|
290 venkat.puvvada 1.28 #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
291 Array<CIMInstance> enumElementCapabilityInstances(
292 const OperationContext & opContext);
293 Array<CIMInstance> enumHostedIndicationServiceInstances(
294 const OperationContext & opContext);
295 Array<CIMInstance> enumServiceAffectsElementInstances(
296 const OperationContext & opContext);
297 CIMInstance buildAssociationInstance(
298 const CIMName &className,
299 const CIMName &propName1,
300 const CIMObjectPath &objPath1,
301 const CIMName &propName2,
302 const CIMObjectPath &objPath2);
303 #endif
|
304 venkat.puvvada 1.27
|
305 a.dunfey 1.22 CIMInstance buildRegisteredProfile(
306 const String & instanceId,
307 const String & profileName,
308 const String & profileVersion,
309 Uint16 profileOrganization,
310 const String & otherProfileOrganization,
311 const CIMClass & profileClass);
312
313 CIMInstance buildDependencyInstance(
314 const String & antecedentId,
315 const CIMName & antecedentClass,
316 const String & dependentId,
317 const CIMName & dependentClass,
318 const CIMClass & dependencyClass);
319
320 CIMInstance buildSoftwareIdentity(
321 const String & module,
322 const String & provider,
323 const String & vendor,
324 const String & version,
325 Uint16 majorVersion,
326 a.dunfey 1.22 Uint16 minorVersion,
327 Uint16 revisionNumber,
328 Uint16 buildNumber,
329 bool extendedVersionSupplied,
330 const String & interfaceType,
331 const String & elementName,
332 const String & caption);
333
334 Array<CIMInstance> getProfileInstances(
335 const CIMName & profileType,
336 const Array<String> & defaultSniaProfiles);
337
|
338 venkat.puvvada 1.27 Array<CIMInstance> getDMTFProfileInstances(
339 const CIMName & profileType);
340
|
341 karl 1.15 // The following are internal equivalents of the operations
342 // allowing the operations to call one another internally within
343 // the provider.
|
344 karl 1.16 Array<CIMInstance> localEnumerateInstances(
|
345 karl 1.15 const OperationContext & context,
346 const CIMObjectPath & ref,
|
347 a.dunfey 1.22 const CIMPropertyList& propertyList=CIMPropertyList());
|
348 karl 1.15
|
349 a.dunfey 1.22 Array<CIMInstance> localReferences(
350 const OperationContext & context,
351 const CIMObjectPath & objectName,
352 const CIMName & resultClass,
353 String & originRole,
354 String & targetRole,
355 const CIMPropertyList & propertyList=CIMPropertyList(),
356 const CIMName & targetClass=CIMName());
|
357 karl 1.15
|
358 karl 1.17 CIMInstance localGetInstance(
|
359 karl 1.15 const OperationContext & context,
360 const CIMObjectPath & instanceName,
361 const CIMPropertyList & propertyList);
|
362 karl 1.18
|
363 a.dunfey 1.22 void cacheProfileRegistrationInfo();
364 void verifyCachedInfo();
|
365 venkat.puvvada 1.27 void initializeNamespaces();
|
366 a.dunfey 1.22
367 bool validAssocClassForObject(
|
368 s.manicka 1.26 const OperationContext & context,
369 const CIMName & assocClass, const CIMObjectPath & objectName,
|
370 a.dunfey 1.22 const CIMNamespaceName & opNamespace,
371 String & originProperty, String & targetProperty);
372
|
373 venkat.puvvada 1.27 #ifdef PEGASUS_ENABLE_SLP
374 void sendUpdateRegMessageToSLPProvider(
375 const OperationContext & context);
376 #endif
377
|
378 a.dunfey 1.22 // Repository Instance variable
379 CIMOMHandle cimomHandle;
380 CIMRepository * repository;
381 String objectManagerName;
382 String hostName;
383 CIMClass profileCapabilitiesClass;
384 CIMClass softwareIdentityClass;
385 Array<Uint16> providerClassifications;
386 Mutex interopMut;
|
387 a.dunfey 1.23 bool providerInitialized;
|
388 venkat.puvvada 1.27 AtomicInt updateProfileCache;
|
389 a.dunfey 1.22
390 // Registration info to cache
391 Array<String> profileIds;
392 Array<CIMNameArray> conformingElements;
393 Array<CIMNamespaceArray> elementNamespaces;
|
394 s.kodali 1.29
395 Boolean enableSLP;
|
396 venkat.puvvada 1.30 String httpPort;
397 String httpsPort;
|
398 karl 1.1 };
399
|
400 a.dunfey 1.23 PEGASUS_NAMESPACE_END
|
401 karl 1.1
402 #endif // InteropProvider_h
|