version 1.9, 2005/03/15 16:59:21
|
version 1.22, 2006/11/01 21:51:19
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// | // |
//============================================================================== | //============================================================================== |
// |
|
// Author: Karl Schopmeyer (k.schopmeyer@opengrooup.org) |
|
// |
|
// Modified By: |
|
// |
|
//%//////////////////////////////////////////////////////////////////////////// |
|
| |
| |
#ifndef InteropProvider_h | #ifndef InteropProvider_h |
|
|
#include <Pegasus/Provider/CIMInstanceProvider.h> | #include <Pegasus/Provider/CIMInstanceProvider.h> |
#include <Pegasus/Provider/CIMAssociationProvider.h> | #include <Pegasus/Provider/CIMAssociationProvider.h> |
| |
PEGASUS_NAMESPACE_BEGIN |
PEGASUS_NAMESPACE_BEGIN; |
| |
/** | /** |
The InteropProvider provides information and manipulates the |
* The InteropProvider services the Interop classes of the DMTF CIM Schema |
following classes from the DMTF CIM_Interop schema: |
* in the root/PG_InterOp namespace (as well as some related cross-namespace |
CIM_Namespace - Creation and deletion of namespaces |
* associations in other namespaces). Through this implementation, combined |
Note: Effective Pegasus 2.4, it processes PG_Namespace |
* with the SLP provider and one or more vendor-supplied SMI providers, the |
__Namespace - Creation and deletion of namespaces (deprecated) |
* Pegasus WBEM Server is able to provide a fully-functional implementation of |
CIM_ObjectManager - Reports on the status of the object manager |
* the SMI-S Server profile (currently, version 1.1.0). |
CIM_ObjectManagerCommunicationMechanism - Reports on CIMOM communications |
* |
COM_CIMXMLCommunicationMechanism - Reports on CIMXML communications |
* The following is a list of the association and instance classes supported |
CIM_ProtocolAdapter |
* by this provider in the root/PG_InterOp namespace: |
|
* |
Associations |
* PG_CIMXMLCommunicationMechanism (CIM_CIMXMLCommunicationMechanism) |
NamespaceinManager |
* PG_CommMechanismForManager (CIM_CommMechanismForManager) |
|
* PG_ComputerSystem (CIM_ComputerSystem) |
creation and deletion of namespaces using the __namespace class |
* PG_ElementConformsToProfile (CIM_ElementConformsToProfile) |
Note however, that the DMTF specification model does not define a class for |
* PG_ElementSoftwareIdentity (CIM_ElementSoftwareIdentity) |
__namespace so that it is, a "false" class. We assume that it has the |
* PG_HostedAccessPoint (CIM_HostedAccessPoint) |
same characteristics as the CIM_namespace class defined in CIM 2.6. |
* PG_HostedObjectManager (CIM_HostedService) |
|
* PG_InstalledSoftwareIdentity (CIM_InstalledSoftwareIdentity) |
This provider implements the following functions: |
* PG_Namespace (CIM_Namespace) |
- createInstance ( adds a new namespace to the repository) |
* PG_NamespaceInManager (CIM_NamespaceInManager) |
- getInstance ( Gets one instance containing a namespace name) |
* PG_ObjectManager (CIM_ObjectManager) |
- modifyInstance ( Limited Support) |
* PG_ReferencedProfile (CIM_ReferencedProfile) |
- enumerateInstances ( Lists all namespaces as Instances) |
* PG_RegisteredProfile (CIM_RegisteredProfile) |
- enumerateInstanceNames ( Lists all namespace names ) |
* PG_RegisteredSubProfile (CIM_RegisteredSubProfile) |
TBD |
* PG_SoftwareIdentity (CIM_SoftwareIdentity) |
|
* PG_SubProfileRequiredProfile (CIM_SubProfileRequiresProfile) |
|
* |
*/ | */ |
| |
|
typedef Array<CIMName> CIMNameArray; |
|
typedef Array<CIMNamespaceName> CIMNamespaceArray; |
|
|
class PEGASUS_INTEROPPROVIDER_LINKAGE InteropProvider : | class PEGASUS_INTEROPPROVIDER_LINKAGE InteropProvider : |
public CIMInstanceProvider, public CIMAssociationProvider | public CIMInstanceProvider, public CIMAssociationProvider |
{ | { |
public: | public: |
| |
InteropProvider(CIMRepository* repository) |
InteropProvider(CIMRepository* repository); |
{ |
|
PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::InteropProvider"); |
|
_repository = repository; |
|
PEG_METHOD_EXIT(); |
|
} |
|
|
|
virtual ~InteropProvider() | virtual ~InteropProvider() |
{ | { |
PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::~InteropProvider"); | PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::~InteropProvider"); |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
|
|
const CIMObjectPath & classReference, | const CIMObjectPath & classReference, |
ObjectPathResponseHandler & handler); | ObjectPathResponseHandler & handler); |
| |
// Association Interfaces |
|
| |
// CIMAssociationProvider interface | // CIMAssociationProvider interface |
virtual void associators( | virtual void associators( |
|
|
/** | /** |
Standard initialization function for the provider. | Standard initialization function for the provider. |
*/ | */ |
void initialize(CIMOMHandle& cimomHandle) |
void initialize(CIMOMHandle& handle) |
{ | { |
|
cimomHandle = handle; |
} | } |
| |
void terminate(void) | void terminate(void) |
{ | { |
|
// delete self. this is necessary because the entry point for this object allocated it, and |
|
// the module is responsible for its memory management. |
|
//delete this; |
} | } |
| |
private: | private: |
| |
|
CIMInstance buildInstanceSkeleton( |
CIMInstance _buildInstanceSkeleton(const CIMName& className); |
const CIMNamespaceName & nameSpace, |
|
|
CIMObjectPath _buildReference(const CIMInstance& instance, |
|
const CIMName& className); |
|
|
|
CIMObjectPath _buildObjectPath(const CIMNamespaceName& name, |
|
const CIMName& className, |
|
const CIMInstance& instance); |
|
CIMObjectPath _buildInstancePath(const CIMNamespaceName& name, |
|
const CIMName& className, | const CIMName& className, |
const CIMInstance& instance); |
CIMClass& returnedClass); |
|
|
CIMClass _getClass(const CIMNamespaceName& nameSpace, const CIMName& className); |
|
| |
Array<CIMNamespaceName> _enumerateNameSpaces(); |
CIMInstance buildCIMXMLCommunicationMechanismInstance( |
|
|
CIMInstance _buildInstancePGCIMXMLCommunicationMechanism( |
|
const String& namespaceType, | const String& namespaceType, |
|
const Uint16& accessProtocol, |
const String& IPAddress, | const String& IPAddress, |
const Boolean& includeQualifiers, |
const CIMClass & commMechClass); |
const Boolean& includeClassOrigin, |
|
const CIMPropertyList& propertyList); |
|
| |
Array<CIMInstance> _buildInstancesPGCIMXMLCommunicationMechanism( |
Array<CIMInstance> enumCIMXMLCommunicationMechanismInstances(); |
const Boolean includeQualifiers, |
|
const Boolean includeClassOrigin, |
|
const CIMPropertyList& propertyList); |
|
| |
CIMInstance _getInstanceCIMObjectManager(const Boolean includeQualifiers, |
Array<CIMInstance> enumHostedAccessPointInstances(); |
const Boolean includeClassOrigin, |
|
const CIMPropertyList& propertyList); |
|
| |
Array<CIMInstance> _getInstancesCIMNamespace(const Boolean& includeQualifiers, |
CIMInstance getObjectManagerInstance(); |
const Boolean& includeClassOrigin, |
|
const CIMPropertyList& propertyList); |
|
| |
|
CIMInstance getComputerSystemInstance(); |
| |
CIMInstance _getInstanceCIMNamespace(const CIMNamespaceName & nameSpace); |
CIMInstance getHostedObjectManagerInstance(); |
// |
|
CIMInstance _buildInstancePGNamespace(const CIMNamespaceName & nameSpace); |
|
| |
|
Array<CIMInstance> enumNamespaceInstances(); |
| |
Array<CIMInstance> _buildInstancesNamespaceInManager(); |
CIMInstance buildNamespaceInstance(const String & nameSpace); |
| |
Array<CIMInstance> _buildInstancesCommMechanismForManager(); |
CIMObjectPath createNamespace(const CIMInstance & namespaceInstance); |
|
void deleteNamespace(const CIMObjectPath & instanceName); |
| |
|
Array<CIMInstance> enumNamespaceInManagerInstances(); |
| |
Boolean _getInstanceFromRepositoryCIMObjectManager( |
Array<CIMInstance> enumCommMechanismForManagerInstances(); |
CIMInstance& rtnInstance, |
|
const Boolean includeQualifiers, |
|
const Boolean includeClassOrigin, |
|
const CIMPropertyList& propertyList); |
|
| |
void modifyObjectManagerInstance(const OperationContext & context, | void modifyObjectManagerInstance(const OperationContext & context, |
const CIMObjectPath & instanceReference, | const CIMObjectPath & instanceReference, |
const CIMInstance& modifiedIns, | const CIMInstance& modifiedIns, |
const Boolean includeQualifiers, | const Boolean includeQualifiers, |
const CIMPropertyList& propertyList, |
const CIMPropertyList& propertyList); |
ResponseHandler & handler); |
|
|
void extractSoftwareIdentityInfo( |
|
const CIMInstance & providerInstance, |
|
String & moduleName, |
|
String & providerName, |
|
String & version, |
|
String & vendor, |
|
Uint16 & majorVersion, |
|
Uint16 & minorVersion, |
|
Uint16 & revision, |
|
Uint16 & build, |
|
bool & extendedVersionSupplied, |
|
String & interfaceType, |
|
String & elementName, |
|
String & caption); |
|
|
|
Array<CIMInstance> enumRegisteredProfileInstances(); |
|
Array<CIMInstance> enumRegisteredSubProfileInstances(); |
|
Array<CIMInstance> enumReferencedProfileInstances(); |
|
Array<CIMInstance> enumElementConformsToProfileInstances( |
|
const OperationContext & opContext, |
|
const CIMNamespaceName & opNamespace); |
|
Array<CIMInstance> enumSubProfileRequiresProfileInstances(); |
|
Array<CIMInstance> enumSoftwareIdentityInstances(); |
|
Array<CIMInstance> enumElementSoftwareIdentityInstances(); |
|
Array<CIMInstance> enumInstalledSoftwareIdentityInstances(); |
|
|
|
CIMInstance buildRegisteredProfile( |
|
const String & instanceId, |
|
const String & profileName, |
|
const String & profileVersion, |
|
Uint16 profileOrganization, |
|
const String & otherProfileOrganization, |
|
const CIMClass & profileClass); |
|
|
|
CIMInstance buildDependencyInstance( |
|
const String & antecedentId, |
|
const CIMName & antecedentClass, |
|
const String & dependentId, |
|
const CIMName & dependentClass, |
|
const CIMClass & dependencyClass); |
|
|
|
CIMInstance buildSoftwareIdentity( |
|
const String & module, |
|
const String & provider, |
|
const String & vendor, |
|
const String & version, |
|
Uint16 majorVersion, |
|
Uint16 minorVersion, |
|
Uint16 revisionNumber, |
|
Uint16 buildNumber, |
|
bool extendedVersionSupplied, |
|
const String & interfaceType, |
|
const String & elementName, |
|
const String & caption); |
|
|
|
Array<CIMInstance> getProfileInstances( |
|
const CIMName & profileType, |
|
const Array<String> & defaultSniaProfiles); |
|
|
|
// The following are internal equivalents of the operations |
|
// allowing the operations to call one another internally within |
|
// the provider. |
|
Array<CIMInstance> localEnumerateInstances( |
|
const OperationContext & context, |
|
const CIMObjectPath & ref, |
|
const CIMPropertyList& propertyList=CIMPropertyList()); |
|
|
|
Array<CIMInstance> localReferences( |
|
const OperationContext & context, |
|
const CIMObjectPath & objectName, |
|
const CIMName & resultClass, |
|
String & originRole, |
|
String & targetRole, |
|
const CIMPropertyList & propertyList=CIMPropertyList(), |
|
const CIMName & targetClass=CIMName()); |
|
|
|
CIMInstance localGetInstance( |
|
const OperationContext & context, |
|
const CIMObjectPath & instanceName, |
|
const CIMPropertyList & propertyList); |
|
|
|
void cacheProfileRegistrationInfo(); |
|
void verifyCachedInfo(); |
|
|
|
bool validAssocClassForObject( |
|
const CIMName & assocClass, const CIMName & originClass, |
|
const CIMNamespaceName & opNamespace, |
|
String & originProperty, String & targetProperty); |
| |
// Repository Instance variable | // Repository Instance variable |
// |
CIMOMHandle cimomHandle; |
CIMRepository* _repository; |
CIMRepository * repository; |
CIMClass * _cimNamespaceClass; |
String objectManagerName; |
CIMNamespaceName _operationNamespace; |
String hostName; |
//CIMInstance instanceOfCIMObjectManager; |
CIMClass profileCapabilitiesClass; |
|
CIMClass softwareIdentityClass; |
|
Array<Uint16> providerClassifications; |
|
Mutex interopMut; |
|
//bool namespacesInitialized; - currently unused |
|
|
|
// Registration info to cache |
|
Array<String> profileIds; |
|
Array<CIMNameArray> conformingElements; |
|
Array<CIMNamespaceArray> elementNamespaces; |
}; | }; |
| |
PEGASUS_NAMESPACE_END |
PEGASUS_NAMESPACE_END; |
| |
#endif // InteropProvider_h | #endif // InteropProvider_h |