(file) Return to InteropProvider.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ControlProviders / InteropProvider

  1 a.dunfey 1.20.10.3 //%2006////////////////////////////////////////////////////////////////////////
  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 a.dunfey 1.20.10.3 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12                    // EMC Corporation; Symantec Corporation; The Open Group.
 13 karl     1.1       //
 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.2       // 
 21 karl     1.1       // 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                    // Author: Karl Schopmeyer (k.schopmeyer@opengrooup.org)
 33                    //
 34                    // Modified By:
 35 a.dunfey 1.20.10.2 //              Alex Dunfey, EMC (Dunfey_alexander@emc.com) for PEP 244
 36 karl     1.1       //
 37                    //%////////////////////////////////////////////////////////////////////////////
 38                    
 39                    
 40                    #ifndef InteropProvider_h
 41                    #define InteropProvider_h
 42                    
 43                    ///////////////////////////////////////////////////////////////////////////////
 44                    //  Interop Provider
 45                    ///////////////////////////////////////////////////////////////////////////////
 46                    
 47                    #include <Pegasus/Common/Config.h>
 48                    #include <Pegasus/ControlProviders/InteropProvider/Linkage.h>
 49                    
 50                    #include <Pegasus/Common/String.h>
 51                    #include <Pegasus/Common/System.h>
 52                    #include <Pegasus/Common/ArrayInternal.h>
 53                    #include <Pegasus/Common/CIMType.h>
 54                    #include <Pegasus/Common/CIMInstance.h>
 55                    #include <Pegasus/Common/CIMObjectPath.h>
 56                    #include <Pegasus/Common/InternalException.h>
 57 karl     1.1       #include <Pegasus/Common/CIMStatusCode.h>
 58                    #include <Pegasus/Common/Tracer.h>
 59                    #include <Pegasus/Config/ConfigManager.h>
 60                    
 61                    #include <Pegasus/Repository/CIMRepository.h>
 62                    #include <Pegasus/Provider/CIMInstanceProvider.h>
 63                    #include <Pegasus/Provider/CIMAssociationProvider.h>
 64                    
 65 a.dunfey 1.20.10.1 PEGASUS_USING_PEGASUS;
 66 karl     1.1       
 67                    /**
 68 a.dunfey 1.20.10.2  * The InteropProvider services the Interop classes of the DMTF CIM Schema
 69                     * in the root/PG_InterOp namespace (as well as some related cross-namespace
 70                     * associations in other namespaces). Through this implementation, combined
 71                     * with the SLP provider and one or more vendor-supplied SMI providers, the
 72                     * Pegasus WBEM Server is able to provide a fully-functional implementation of
 73                     * the SMI-S Server profile (currently, version 1.1.0).
 74                     *
 75                     * The following is a list of the association and instance classes supported
 76                     * by this provider in the root/PG_InterOp namespace:
 77                     *
 78                     *  PG_CIMXMLCommunicationMechanism (CIM_CIMXMLCommunicationMechanism)
 79                     *  PG_CommMechanismForManager (CIM_CommMechanismForManager)
 80                     *  PG_ComputerSystem (CIM_ComputerSystem)
 81                     *  PG_ElementConformsToProfile (CIM_ElementConformsToProfile)
 82                     *  PG_ElementSoftwareIdentity (CIM_ElementSoftwareIdentity)
 83                     *  PG_HostedAccessPoint (CIM_HostedAccessPoint)
 84                     *  PG_HostedObjectManager (CIM_HostedService)
 85 a.dunfey 1.20.10.3  *  PG_InstalledSoftwareIdentity (CIM_InstalledSoftwareIdentity)
 86 a.dunfey 1.20.10.2  *  PG_Namespace (CIM_Namespace)
 87                     *  PG_NamespaceInManager (CIM_NamespaceInManager)
 88                     *  PG_ObjectManager (CIM_ObjectManager)
 89                     *  PG_ReferencedProfile (CIM_ReferencedProfile)
 90                     *  PG_RegisteredProfile (CIM_RegisteredProfile)
 91                     *  PG_RegisteredSubProfile (CIM_RegisteredSubProfile)
 92                     *  PG_SoftwareIdentity (CIM_SoftwareIdentity)
 93                     *  PG_SubProfileRequiredProfile (CIM_SubProfileRequiresProfile)
 94 a.dunfey 1.20.10.3  *
 95 a.dunfey 1.20.10.2  */
 96                    
 97                    typedef Array<CIMName> CIMNameArray;
 98                    typedef Array<CIMNamespaceName> CIMNamespaceArray;
 99 karl     1.1       
100                    class PEGASUS_INTEROPPROVIDER_LINKAGE InteropProvider :
101                    	public CIMInstanceProvider, public CIMAssociationProvider
102                    {
103                    public:
104                    
105 w.white  1.11          InteropProvider(CIMRepository* repository);
106 karl     1.1           virtual ~InteropProvider()
107                        {
108 a.dunfey 1.20.10.1         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::~InteropProvider");
109                            PEG_METHOD_EXIT();
110 karl     1.1           }
111                    
112                        virtual void createInstance(
113 a.dunfey 1.20.10.1         const OperationContext & context,
114                            const CIMObjectPath & instanceReference,
115 karl     1.1               const CIMInstance& myInstance,
116 a.dunfey 1.20.10.1         ObjectPathResponseHandler & handler);
117 karl     1.1       
118                        virtual void deleteInstance(
119 a.dunfey 1.20.10.1         const OperationContext & context,
120 karl     1.1               const CIMObjectPath& instanceName,
121 a.dunfey 1.20.10.1         ResponseHandler & handler);
122 karl     1.1       
123                        virtual void getInstance(
124 a.dunfey 1.20.10.1         const OperationContext & context,
125 karl     1.1               const CIMObjectPath& instanceName,
126 a.dunfey 1.20.10.1         const Boolean includeQualifiers,
127                            const Boolean includeClassOrigin,
128 karl     1.1               const CIMPropertyList& propertyList,
129 a.dunfey 1.20.10.1         InstanceResponseHandler & handler);
130 karl     1.1       
131                        void modifyInstance(
132 a.dunfey 1.20.10.1         const OperationContext & context,
133                            const CIMObjectPath & instanceReference,
134 karl     1.1               const CIMInstance& modifiedIns,
135 a.dunfey 1.20.10.1         const Boolean includeQualifiers,
136 karl     1.1               const CIMPropertyList& propertyList,
137 a.dunfey 1.20.10.1         ResponseHandler & handler);
138 karl     1.1       
139                        virtual void enumerateInstances(
140 a.dunfey 1.20.10.1         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.20.10.1         InstanceResponseHandler & handler);
146 karl     1.1       
147                        virtual void enumerateInstanceNames(
148 a.dunfey 1.20.10.1         const OperationContext & context,
149                            const CIMObjectPath & classReference,
150 karl     1.1               ObjectPathResponseHandler & handler);
151                    
152 a.dunfey 1.20.10.1 
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                            const CIMName & associationClass,
170                            const CIMName & resultClass,
171                            const String & role,
172                            const String & resultRole,
173 a.dunfey 1.20.10.1         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                            ObjectPathResponseHandler & handler);
191 a.dunfey 1.20.10.3 
192 karl     1.1           /**
193                        Standard initialization function for the provider.
194                        */
195 a.dunfey 1.20.10.1     void initialize(CIMOMHandle& handle)
196 karl     1.1           {
197 a.dunfey 1.20.10.3       printf("Init called on Interop provider\n");
198 a.dunfey 1.20.10.1       cimomHandle = handle;
199 karl     1.1           }
200                    
201                        void terminate(void)
202                        {
203 a.dunfey 1.20.10.1         // delete self. this is necessary because the entry point for this object allocated it, and
204                            // the module is responsible for its memory management.
205 a.dunfey 1.20.10.2         //delete this;
206 karl     1.1           }
207                    
208                    private:
209                    
210 a.dunfey 1.20.10.1     CIMInstance buildInstanceSkeleton(
211                            const CIMNamespaceName & nameSpace,
212 karl     1.13              const CIMName& className,
213                            CIMClass& returnedClass);
214 a.dunfey 1.20.10.3 
215 a.dunfey 1.20.10.1     CIMInstance buildCIMXMLCommunicationMechanismInstance(
216 tony     1.4               const String& namespaceType,
217 karl     1.14              const Uint16& accessProtocol,
218 a.dunfey 1.20.10.1         const String& IPAddress,
219                            const CIMClass & commMechClass);
220 tony     1.4       
221 a.dunfey 1.20.10.1     Array<CIMInstance> enumCIMXMLCommunicationMechanismInstances();
222 tony     1.4       
223 a.dunfey 1.20.10.1     Array<CIMInstance> enumHostedAccessPointInstances();
224 tony     1.4       
225 a.dunfey 1.20.10.3     CIMInstance getObjectManagerInstance();
226 karl     1.18      
227 a.dunfey 1.20.10.3     CIMInstance getComputerSystemInstance();
228 tony     1.4       
229 a.dunfey 1.20.10.3     CIMInstance getHostedObjectManagerInstance();
230 karl     1.6       
231 a.dunfey 1.20.10.1     Array<CIMInstance> enumNamespaceInstances();
232                    
233                        CIMInstance buildNamespaceInstance(const String & nameSpace);
234                    
235                        Array<CIMInstance> enumNamespaceInManagerInstances();
236                    
237                        Array<CIMInstance> enumCommMechanismForManagerInstances();
238 karl     1.19      
239 karl     1.6           void modifyObjectManagerInstance(const OperationContext & context,
240                            const CIMObjectPath & instanceReference,
241                            const CIMInstance& modifiedIns,
242                            const Boolean includeQualifiers,
243 karl     1.19              const CIMPropertyList& propertyList);
244 karl     1.6       
245 a.dunfey 1.20.10.1     void extractSoftwareIdentityInfo(
246                            const CIMInstance & providerInstance,
247                            String & moduleName,
248                            String & providerName,
249                            String & version,
250                            String & vendor,
251 a.dunfey 1.20.10.3         Uint16 & majorVersion,
252                            Uint16 & minorVersion,
253                            Uint16 & revision,
254                            Uint16 & build,
255                            bool & extendedVersionSupplied,
256 a.dunfey 1.20.10.1         String & interfaceType);
257                    
258                        Array<CIMInstance> enumRegisteredProfileInstances();
259                        Array<CIMInstance> enumRegisteredSubProfileInstances();
260                        Array<CIMInstance> enumReferencedProfileInstances();
261                        Array<CIMInstance> enumElementConformsToProfileInstances(
262                            const OperationContext & opContext,
263                            const CIMNamespaceName & opNamespace);
264                        Array<CIMInstance> enumSubProfileRequiresProfileInstances();
265                        Array<CIMInstance> enumSoftwareIdentityInstances();
266                        Array<CIMInstance> enumElementSoftwareIdentityInstances();
267 a.dunfey 1.20.10.3     Array<CIMInstance> enumInstalledSoftwareIdentityInstances();
268 a.dunfey 1.20.10.1 
269                        CIMInstance buildRegisteredProfile(
270                            const String & instanceId,
271                            const String & profileName,
272                            const String & profileVersion,
273                            Uint16 profileOrganization,
274                            const String & otherProfileOrganization,
275                            const CIMClass & profileClass);
276                    
277                        CIMInstance buildDependencyInstance(
278                            const String & antecedentId,
279                            const CIMName & antecedentClass,
280                            const String & dependentId,
281                            const CIMName & dependentClass,
282                            const CIMClass & dependencyClass);
283                    
284                        CIMInstance buildSoftwareIdentity(
285                            const String & module,
286                            const String & provider,
287                            const String & vendor,
288 a.dunfey 1.20.10.3         const String & version,
289                            Uint16 majorVersion,
290                            Uint16 minorVersion,
291                            Uint16 revisionNumber,
292                            Uint16 buildNumber,
293                            bool extendedVersionSupplied,
294 a.dunfey 1.20.10.1         const String & interfaceType);
295                    
296                        Array<CIMInstance> getProfileInstances(
297                            const CIMName & profileType,
298                            const Array<String> & defaultSniaProfiles);
299                    
300 karl     1.15          // The following are internal equivalents of the operations
301                        // allowing the operations to call one another internally within
302                        // the provider.
303 karl     1.16          Array<CIMInstance> localEnumerateInstances(
304 karl     1.15              const OperationContext & context,
305                            const CIMObjectPath & ref,
306 a.dunfey 1.20.10.1         const CIMPropertyList& propertyList=CIMPropertyList());
307 karl     1.15      
308 a.dunfey 1.20.10.1     Array<CIMInstance> localReferences(
309                            const OperationContext & context,
310                            const CIMObjectPath & objectName,
311                            const CIMName & resultClass,
312 a.dunfey 1.20.10.2         String & originRole,
313                            String & targetRole,
314 a.dunfey 1.20.10.1         const CIMPropertyList & propertyList=CIMPropertyList(),
315 a.dunfey 1.20.10.2         const CIMName & targetClass=CIMName());
316 karl     1.15      
317 karl     1.17          CIMInstance localGetInstance(
318 karl     1.15              const OperationContext & context,
319                            const CIMObjectPath & instanceName,
320                            const CIMPropertyList & propertyList);
321 karl     1.18      
322 a.dunfey 1.20.10.2     void cacheProfileRegistrationInfo();
323                        void verifyCachedInfo();
324                    
325                        bool validAssocClassForObject(
326                            const CIMName & assocClass, const CIMName & originClass,
327                            const CIMNamespaceName & opNamespace,
328                            String & originProperty, String & targetProperty);
329                    
330                        // Repository Instance variable
331                        CIMOMHandle cimomHandle;
332 a.dunfey 1.20.10.3     CIMRepository * repository;
333 a.dunfey 1.20.10.2     // local save for name of object manager
334                        String objectManagerName;
335                        String hostName;
336                        CIMClass profileCapabilitiesClass;
337                        CIMClass softwareIdentityClass;
338                        Array<Uint16> providerClassifications;
339                        Mutex interopMut;
340                        bool namespacesInitialized;
341                    
342                        // Registration info to cache
343                        Array<String> profileIds;
344                        Array<CIMNameArray> conformingElements;
345                        Array<CIMNamespaceArray> elementNamespaces;
346 karl     1.1       };
347                    
348                    #endif // InteropProvider_h

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2