HP WBEM Services Software Developer's Kit for HP-UX Provider and Client Developer's Guide A.01
Provider Implementation
The Provider Programming Interfaces
Chapter 4 73
// specifier is not required for a global instance declaration,
// as shown.
ExampleProvider exp;
extern "C" CIMProvider*
PegasusCreateProvider(const String &providerName)
{
// return the address of the global provider instance
if String::equalNoCase(providerName, "ExampleProvider")
return &exp;
else
return 0;
}
The provider constructor and destructor should do as little as possible.
Any initialization should be done in the initialize() function, and
cleanup in the terminate() function.
Instance Provider
The InstanceProvider interface is the most commonly implemented
provider interface. An instance provider is required for any class that
will have instances that can be displayed or manipulated by a client.
An instance provider must supply values for all required and key
properties (required properties may be inherited from superclasses). This
is required by the CIM standard for DMTF compliance, not HP WBEM
Services for HP-UX. Properties not supported can be omitted by simply
not adding the property when building a CIMInstance for responses to
read operations (getInstance() and enumerateInstances()).
However, on write operations (createInstance() and
modifyInstance()), the provider must throw a
CIMNotSupportedException exception if the speciļ¬ed instance contains
properties that it does not support.
If an instance provider performs authorization, it may do so before
attempting the requested operation. If the provider determines that the
client is not authorized to perform the requested operation, it must
throw an CIMAccessDeniedException exception.
If there are no instances to return in a request to
enumerateInstanceNames() or enumerateInstances(), the provider
should not throw an exception. It can simply return, or it may call the