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 marek 1.34.2.1 #include <Pegasus/Common/VersionUtil.h>
|
57 karl 1.1
|
58 marek 1.34.2.2 #include \
59 <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h>
60
|
61 a.dunfey 1.23 PEGASUS_NAMESPACE_BEGIN
|
62 karl 1.1
63 /**
|
64 a.dunfey 1.22 * The InteropProvider services the Interop classes of the DMTF CIM Schema
65 * in the root/PG_InterOp namespace (as well as some related cross-namespace
66 * associations in other namespaces). Through this implementation, combined
67 * with the SLP provider and one or more vendor-supplied SMI providers, the
68 * Pegasus WBEM Server is able to provide a fully-functional implementation of
69 * the SMI-S Server profile (currently, version 1.1.0).
70 *
71 * The following is a list of the association and instance classes supported
72 * by this provider in the root/PG_InterOp namespace:
73 *
74 * PG_CIMXMLCommunicationMechanism (CIM_CIMXMLCommunicationMechanism)
75 * PG_CommMechanismForManager (CIM_CommMechanismForManager)
76 * PG_ComputerSystem (CIM_ComputerSystem)
77 * PG_ElementConformsToProfile (CIM_ElementConformsToProfile)
78 * PG_ElementSoftwareIdentity (CIM_ElementSoftwareIdentity)
79 * PG_HostedAccessPoint (CIM_HostedAccessPoint)
80 * PG_HostedObjectManager (CIM_HostedService)
81 * PG_InstalledSoftwareIdentity (CIM_InstalledSoftwareIdentity)
82 * PG_Namespace (CIM_Namespace)
83 * PG_NamespaceInManager (CIM_NamespaceInManager)
84 * PG_ObjectManager (CIM_ObjectManager)
85 a.dunfey 1.22 * PG_ReferencedProfile (CIM_ReferencedProfile)
86 * PG_RegisteredProfile (CIM_RegisteredProfile)
87 * PG_RegisteredSubProfile (CIM_RegisteredSubProfile)
88 * PG_SoftwareIdentity (CIM_SoftwareIdentity)
89 * PG_SubProfileRequiredProfile (CIM_SubProfileRequiresProfile)
90 *
91 */
92
93 typedef Array<CIMName> CIMNameArray;
94 typedef Array<CIMNamespaceName> CIMNamespaceArray;
|
95 karl 1.1
96 class PEGASUS_INTEROPPROVIDER_LINKAGE InteropProvider :
|
97 kumpf 1.34 public CIMInstanceProvider,
|
98 venkat.puvvada 1.27 public CIMAssociationProvider,
99 public CIMMethodProvider
|
100 karl 1.1 {
101 public:
102
|
103 marek 1.34.2.2 InteropProvider(
104 CIMRepository* repository,
105 ProviderRegistrationManager* provRegManager);
106
|
107 karl 1.1 virtual ~InteropProvider()
108 {
|
109 karl 1.25 PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
110 "InteropProvider::~InteropProvider");
|
111 a.dunfey 1.22 PEG_METHOD_EXIT();
|
112 karl 1.1 }
113
|
114 kumpf 1.24 // Note: The initialize() and terminate() methods are not called for
115 // Control Providers.
116 void initialize(CIMOMHandle& handle) { }
117 void terminate() { }
118
|
119 karl 1.1 virtual void createInstance(
|
120 a.dunfey 1.22 const OperationContext & context,
121 const CIMObjectPath & instanceReference,
|
122 karl 1.1 const CIMInstance& myInstance,
|
123 a.dunfey 1.22 ObjectPathResponseHandler & handler);
|
124 karl 1.1
125 virtual void deleteInstance(
|
126 a.dunfey 1.22 const OperationContext & context,
|
127 karl 1.1 const CIMObjectPath& instanceName,
|
128 a.dunfey 1.22 ResponseHandler & handler);
|
129 karl 1.1
130 virtual void getInstance(
|
131 a.dunfey 1.22 const OperationContext & context,
|
132 karl 1.1 const CIMObjectPath& instanceName,
|
133 a.dunfey 1.22 const Boolean includeQualifiers,
134 const Boolean includeClassOrigin,
|
135 karl 1.1 const CIMPropertyList& propertyList,
|
136 a.dunfey 1.22 InstanceResponseHandler & handler);
|
137 karl 1.1
138 void modifyInstance(
|
139 a.dunfey 1.22 const OperationContext & context,
140 const CIMObjectPath & instanceReference,
|
141 karl 1.1 const CIMInstance& modifiedIns,
|
142 a.dunfey 1.22 const Boolean includeQualifiers,
|
143 karl 1.1 const CIMPropertyList& propertyList,
|
144 a.dunfey 1.22 ResponseHandler & handler);
|
145 karl 1.1
146 virtual void enumerateInstances(
|
147 a.dunfey 1.22 const OperationContext & context,
148 const CIMObjectPath & ref,
149 const Boolean includeQualifiers,
150 const Boolean includeClassOrigin,
|
151 karl 1.1 const CIMPropertyList& propertyList,
|
152 a.dunfey 1.22 InstanceResponseHandler & handler);
|
153 karl 1.1
154 virtual void enumerateInstanceNames(
|
155 a.dunfey 1.22 const OperationContext & context,
156 const CIMObjectPath & classReference,
157 ObjectPathResponseHandler & handler);
158
159
160 // CIMAssociationProvider interface
161 virtual void associators(
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 const Boolean includeQualifiers,
169 const Boolean includeClassOrigin,
170 const CIMPropertyList & propertyList,
171 ObjectResponseHandler & handler);
172
173 virtual void associatorNames(
174 const OperationContext & context,
175 const CIMObjectPath & objectName,
176 a.dunfey 1.22 const CIMName & associationClass,
177 const CIMName & resultClass,
178 const String & role,
179 const String & resultRole,
180 ObjectPathResponseHandler & handler);
181
182 virtual void references(
183 const OperationContext & context,
184 const CIMObjectPath & objectName,
185 const CIMName & resultClass,
186 const String & role,
187 const Boolean includeQualifiers,
188 const Boolean includeClassOrigin,
189 const CIMPropertyList & propertyList,
190 ObjectResponseHandler & handler);
191
192 virtual void referenceNames(
193 const OperationContext & context,
194 const CIMObjectPath & objectName,
195 const CIMName & resultClass,
196 const String & role,
|
197 karl 1.1 ObjectPathResponseHandler & handler);
198
|
199 venkat.puvvada 1.27 // CIMMethodProvider interface
200 virtual void invokeMethod(
201 const OperationContext & context,
202 const CIMObjectPath & objectReference,
203 const CIMName & methodName,
204 const Array<CIMParamValue> & inParameters,
205 MethodResultResponseHandler & handler);
206
|
207 karl 1.1 private:
208
|
209 a.dunfey 1.23 void initProvider();
210
|
211 a.dunfey 1.22 CIMInstance buildInstanceSkeleton(
212 const CIMNamespaceName & nameSpace,
|
213 karl 1.13 const CIMName& className,
|
214 kumpf 1.31 Boolean includeQualifiers,
|
215 karl 1.13 CIMClass& returnedClass);
|
216 karl 1.12
|
217 a.dunfey 1.22 CIMInstance buildCIMXMLCommunicationMechanismInstance(
|
218 tony 1.4 const String& namespaceType,
|
219 karl 1.14 const Uint16& accessProtocol,
|
220 a.dunfey 1.22 const String& IPAddress,
221 const CIMClass & commMechClass);
222
223 Array<CIMInstance> enumCIMXMLCommunicationMechanismInstances();
224
225 Array<CIMInstance> enumHostedAccessPointInstances();
|
226 tony 1.4
|
227 a.dunfey 1.22 CIMInstance getObjectManagerInstance();
|
228 tony 1.4
|
229 a.dunfey 1.22 CIMInstance getComputerSystemInstance();
230
231 CIMInstance getHostedObjectManagerInstance();
232
233 Array<CIMInstance> enumNamespaceInstances();
|
234 tony 1.4
|
235 a.dunfey 1.22 CIMInstance buildNamespaceInstance(const String & nameSpace);
|
236 karl 1.18
|
237 marek 1.34.2.3 CIMInstance getNameSpaceInstance(const CIMObjectPath & ref);
238
|
239 a.dunfey 1.22 CIMObjectPath createNamespace(const CIMInstance & namespaceInstance);
240 void deleteNamespace(const CIMObjectPath & instanceName);
|
241 tony 1.4
|
242 venkat.puvvada 1.27 CIMObjectPath createProviderProfileCapabilityInstance(
243 const CIMInstance & profileInstance,
244 const OperationContext & context);
245
246 void deleteProviderProfileCapabilityInstance(
247 const CIMObjectPath & instanceName,
248 const OperationContext & context);
249
|
250 a.dunfey 1.22 Array<CIMInstance> enumNamespaceInManagerInstances();
|
251 karl 1.6
|
252 a.dunfey 1.22 Array<CIMInstance> enumCommMechanismForManagerInstances();
|
253 karl 1.19
|
254 karl 1.6 void modifyObjectManagerInstance(const OperationContext & context,
255 const CIMObjectPath & instanceReference,
256 const CIMInstance& modifiedIns,
257 const Boolean includeQualifiers,
|
258 karl 1.19 const CIMPropertyList& propertyList);
|
259 karl 1.6
|
260 a.dunfey 1.22 void extractSoftwareIdentityInfo(
261 const CIMInstance & providerInstance,
262 String & moduleName,
263 String & providerName,
264 String & version,
265 String & vendor,
266 Uint16 & majorVersion,
267 Uint16 & minorVersion,
268 Uint16 & revision,
269 Uint16 & build,
270 bool & extendedVersionSupplied,
271 String & interfaceType,
272 String & elementName,
273 String & caption);
274
275 Array<CIMInstance> enumRegisteredProfileInstances();
276 Array<CIMInstance> enumRegisteredSubProfileInstances();
277 Array<CIMInstance> enumReferencedProfileInstances();
|
278 s.manicka 1.26 Array<CIMInstance> getProfilesForVersion(
|
279 kumpf 1.34 Array<CIMInstance>& subprofs,
|
280 marek 1.34.2.1 Uint16 regOrg,
281 Uint32 majorVer,
282 Uint32 minorVer,
283 Uint32 updateVer);
|
284 a.dunfey 1.22 Array<CIMInstance> enumElementConformsToProfileInstances(
285 const OperationContext & opContext,
286 const CIMNamespaceName & opNamespace);
|
287 s.manicka 1.26 Array<CIMInstance> enumElementConformsToProfileRPRPInstances(
|
288 kumpf 1.34 const OperationContext & opContext,
|
289 s.manicka 1.26 const CIMNamespaceName & opNamespace);
|
290 a.dunfey 1.22 Array<CIMInstance> enumSubProfileRequiresProfileInstances();
291 Array<CIMInstance> enumSoftwareIdentityInstances();
292 Array<CIMInstance> enumElementSoftwareIdentityInstances();
293 Array<CIMInstance> enumInstalledSoftwareIdentityInstances();
|
294 marek 1.34.2.2 Array<CIMInstance> enumDefaultSoftwareIdentityInstances();
295
296 CIMInstance getSoftwareIdentityInstance(
297 const CIMObjectPath &ref);
|
298 a.dunfey 1.22
|
299 venkat.puvvada 1.27 Array<CIMInstance> enumProviderProfileCapabilityInstances(
300 Boolean checkProviders = true,
301 Boolean localOnly = true,
302 Boolean includeQualifiers = false,
303 Boolean includeClassOrigin = false,
304 const CIMPropertyList &propertyList = CIMPropertyList());
305
|
306 venkat.puvvada 1.28 #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
307 Array<CIMInstance> enumElementCapabilityInstances(
308 const OperationContext & opContext);
309 Array<CIMInstance> enumHostedIndicationServiceInstances(
310 const OperationContext & opContext);
311 Array<CIMInstance> enumServiceAffectsElementInstances(
312 const OperationContext & opContext);
313 CIMInstance buildAssociationInstance(
314 const CIMName &className,
315 const CIMName &propName1,
316 const CIMObjectPath &objPath1,
317 const CIMName &propName2,
318 const CIMObjectPath &objPath2);
319 #endif
|
320 venkat.puvvada 1.27
|
321 a.dunfey 1.22 CIMInstance buildRegisteredProfile(
322 const String & instanceId,
323 const String & profileName,
324 const String & profileVersion,
325 Uint16 profileOrganization,
326 const String & otherProfileOrganization,
327 const CIMClass & profileClass);
328
329 CIMInstance buildDependencyInstance(
330 const String & antecedentId,
331 const CIMName & antecedentClass,
332 const String & dependentId,
333 const CIMName & dependentClass,
334 const CIMClass & dependencyClass);
335
336 CIMInstance buildSoftwareIdentity(
337 const String & module,
338 const String & provider,
339 const String & vendor,
340 const String & version,
341 Uint16 majorVersion,
342 a.dunfey 1.22 Uint16 minorVersion,
343 Uint16 revisionNumber,
344 Uint16 buildNumber,
345 bool extendedVersionSupplied,
346 const String & interfaceType,
347 const String & elementName,
348 const String & caption);
349
350 Array<CIMInstance> getProfileInstances(
351 const CIMName & profileType,
352 const Array<String> & defaultSniaProfiles);
353
|
354 venkat.puvvada 1.27 Array<CIMInstance> getDMTFProfileInstances(
355 const CIMName & profileType);
356
|
357 karl 1.15 // The following are internal equivalents of the operations
358 // allowing the operations to call one another internally within
359 // the provider.
|
360 karl 1.16 Array<CIMInstance> localEnumerateInstances(
|
361 karl 1.15 const OperationContext & context,
362 const CIMObjectPath & ref,
|
363 a.dunfey 1.22 const CIMPropertyList& propertyList=CIMPropertyList());
|
364 karl 1.15
|
365 a.dunfey 1.22 Array<CIMInstance> localReferences(
366 const OperationContext & context,
367 const CIMObjectPath & objectName,
368 const CIMName & resultClass,
369 String & originRole,
370 String & targetRole,
371 const CIMPropertyList & propertyList=CIMPropertyList(),
372 const CIMName & targetClass=CIMName());
|
373 karl 1.15
|
374 karl 1.17 CIMInstance localGetInstance(
|
375 karl 1.15 const OperationContext & context,
376 const CIMObjectPath & instanceName,
377 const CIMPropertyList & propertyList);
|
378 karl 1.18
|
379 marek 1.34.2.3 // This function fetches the other side of the reference.
380 Array<CIMInstance> getReferencedInstances(
381 const Array<CIMInstance> &refs,
382 const String targetRole,
383 const OperationContext & context,
384 const CIMPropertyList & propertyList);
385
|
386 a.dunfey 1.22 void cacheProfileRegistrationInfo();
387 void verifyCachedInfo();
|
388 venkat.puvvada 1.27 void initializeNamespaces();
|
389 a.dunfey 1.22
390 bool validAssocClassForObject(
|
391 s.manicka 1.26 const OperationContext & context,
392 const CIMName & assocClass, const CIMObjectPath & objectName,
|
393 a.dunfey 1.22 const CIMNamespaceName & opNamespace,
394 String & originProperty, String & targetProperty);
395
|
396 venkat.puvvada 1.27 #ifdef PEGASUS_ENABLE_SLP
397 void sendUpdateRegMessageToSLPProvider(
398 const OperationContext & context);
399 #endif
400
|
401 marek 1.34.2.2
|
402 a.dunfey 1.22 // Repository Instance variable
403 CIMOMHandle cimomHandle;
404 CIMRepository * repository;
|
405 marek 1.34.2.2 ProviderRegistrationManager *providerRegistrationManager;
|
406 a.dunfey 1.22 String objectManagerName;
407 String hostName;
408 CIMClass profileCapabilitiesClass;
409 CIMClass softwareIdentityClass;
410 Array<Uint16> providerClassifications;
411 Mutex interopMut;
|
412 a.dunfey 1.23 bool providerInitialized;
|
413 venkat.puvvada 1.27 AtomicInt updateProfileCache;
|
414 a.dunfey 1.22
415 // Registration info to cache
416 Array<String> profileIds;
417 Array<CIMNameArray> conformingElements;
418 Array<CIMNamespaceArray> elementNamespaces;
|
419 s.kodali 1.29
420 Boolean enableSLP;
|
421 venkat.puvvada 1.30 String httpPort;
422 String httpsPort;
|
423 karl 1.1 };
424
|
425 a.dunfey 1.23 PEGASUS_NAMESPACE_END
|
426 karl 1.1
427 #endif // InteropProvider_h
|