In file ../../src/Pegasus/Provider/CIMProvider.h:

class PEGASUS_PROVIDER_LINKAGE CIMProvider

Parent class for all provider interfaces.

Documentation

Parent class for all provider interfaces.

The CIMProvider is the parent class for all provider interface types. The currently supported interfaces are:

  • CIMInstanceProvider - supports manipulation of CIM instances and their properties
  • CIMMethodProvider - supports invocation of methods defined on CIM instances
  • CIMAssociationProvider - supports query of CIM Associaitons and their properties. This provider interfaces provides both reference and associatior query operations in accordance with the DMTF Cim Operation specifications

A provider may inherit from any of these interface classes or all of them. A provider MUST implement every function in the chosen interface(s). However, it is not required that all operations be supported. If an operation is not supported, then a minimal implementation of the corresponding function must throw a {@link NotSupported NotSupported} exception.

Certain parameters are passed in several of the functions in the provider interfaces. These are also described in their own sections, and include:

  • OperationContext - contains information about the client's context, including the User ID. The provider must determine whether the specified user should be permitted to perform the operation. If the operation should not be permitted, the provider must throw an AccessDenied exception.
  • CIMObjectPath - specifies the CIM object on which the operation is to be performed. This parameter specifies the hostname, namespace, classname, and key values that uniquely identify an instance of a CIM object.

    hostname - specifies the name of the system on which the object resides. This does not need to be the system that the CIM server is running on, but it generally will be the same system.

    namespace - this CIMNamespaceName object specifies the namespace on the aforementioned host in which the object resides.

    classname - specifies the class on which the requested operation is to be performed.

    keybindings - thisCIMKeyBinging object specifies the set of key properties for the aforementioned class. The set of keys uniquely identifies a CIM instance in the host and namespace. It is permissible for clients to specify, and providers should accept, empty strings for key values when this would not be ambiguous. If the specification is ambiguous, or if a key name is invalid or missing, the provider should throw an InvalidParameter exception.

  • CIMInstance - contains a representation of an instance of a CIM object to be used by the requested operation. This parameter should contain all of the key properties, as well as all properties necessary to perform the requested operation.
  • CIMPropertyList - specifies the properties on which this operation should be performed. The exact use of this parameter depends on the specific operation, and is described in the respective section.
  • ResponseHandler - a callback handle used to return results to the CIM Server for subsequent return to the client.

Certain exceptions can be thrown by several of the functions in the provider interfaces. These are described in their own sections, and include:

The CIMProvider interface contains two functions that are inherited by all provider interfaces:

  • initialize - Called before the first call to any client-requested operation; the provider should perform any processing that may be required before normal operation can begin.
  • terminate - Called prior to the provider being stopped; the provider should perform any final processing that may be required.

Providers must implement these functions. A minimal implementation may simply return to the caller.


Inheritance:


Public Methods

[more] CIMProvider (void)
Creates a CIMProvider instance with null values (default constructor)
[more]virtual ~CIMProvider (void)
CIMProvider destructor
[more]virtual void initialize (CIMOMHandle & cimom)
Performs any setup required before normal operation of the provider.
[more]virtual void terminate (void)
Performs any cleanup required before termination.
[more]virtual Boolean tryTerminate (void)
Allows a provider to decline a terminate call.

o CIMProvider(void)
Creates a CIMProvider instance with null values (default constructor)

ovirtual ~CIMProvider(void)
CIMProvider destructor

ovirtual void initialize(CIMOMHandle & cimom) = 0
Performs any setup required before normal operation of the provider.

The initialize() function allows the provider to conduct the necessary preparations to handle requests. The initialize function is called only once during the lifetime of the provider. Note, however, that with the Pegasus automatic unload function enabled, a provider many be unloaded and loaded many times during one cycle of the CIMOM. This function must complete before the CIM server invokes any other function of the provider, other than terminate.

Parameters:
cimom - Reserved for future use.

ovirtual void terminate(void) = 0
Performs any cleanup required before termination.

The terminate function allows the provider to conduct the necessary preparations for termination. This function may be called by the CIM Server at any time, including initialization. Once invoked, no other provider functions are invoked until after a call to initialize.

The provider may, for example, do the following in the terminate function:

  • close files or I/O streams
  • release resources such as shared memory
  • inform concurrently executing requests to complete immediately (this may be done by setting a global flag)
  • kill subprocesses
  • and others

If the provider instance was created on the heap with new in PegasusCreateProvider, then it must be deleted in terminate:

void MyProvider::terminate()
    {
    ...
    delete this;
    ...
    return;
    }

ovirtual Boolean tryTerminate(void)
Allows a provider to decline a terminate call. If the provider is unable to terminate, it should return false. Otherwise, it calls its terminate() function and then returns true, as in the default implementation.
Returns:
False If the provider is unable to terminate; Otherwise, return true.


Direct child classes:
CIMMethodProvider
CIMInstanceProvider
CIMIndicationProvider
CIMAssociationProvider

Alphabetic index HTML hierarchy of classes or Java