com.sun.wbem.provider20
Interface InstanceProvider


public interface InstanceProvider
extends CIMProvider

This is the base interface implemented by instance providers. Instance providers are used to serve up dynamic instances of classes.

Since:
WBEM 1.0

Method Summary
 CIMObjectPath createInstance(CIMObjectPath op, CIMInstance ci)
          This method must be implemented by instance providers to create the instance specified in the object path.
 void deleteInstance(CIMObjectPath op)
          This method must be implemented by instance providers to delete the instance specified in the object path.
 java.util.Vector enumInstances(CIMObjectPath op, boolean deep, CIMClass cc)
          This method must be implemented by instance providers to enumerate all names of instances of the class which is specified in op.
 java.util.Vector enumInstances(CIMObjectPath op, boolean deep, CIMClass cc, boolean localOnly)
          This method must be implemented by instance providers to enumerate all instances of the class which is specified in op.
 java.util.Vector execQuery(CIMObjectPath op, java.lang.String query, int ql, CIMClass cc)
          This method must be implemented by instance providers to handle client queries for the dynamic data they provide.
 CIMInstance getInstance(CIMObjectPath op, CIMClass cc, boolean localOnly)
          This method must be implemented by instance providers to retrieve the instance specified in the object path.
 void setInstance(CIMObjectPath op, CIMInstance ci)
          This method must be implemented by instance providers to set the instance specified in the object path.
 
Methods inherited from interface com.sun.wbem.provider.CIMProvider
cleanup, initialize
 

Method Detail

enumInstances

public java.util.Vector enumInstances(CIMObjectPath op,
                                      boolean deep,
                                      CIMClass cc)
                               throws CIMException
This method must be implemented by instance providers to enumerate all names of instances of the class which is specified in op. Deep or shallow enumeration is possible, however currently the CIMOM only asks for shallow enumeration.
Parameters:
op - The object path specifies the class that must be enumerated.
deep - If true, deep enumeration must be done, otherwise shallow.
cc, - the class reference
Returns:
Vector of CIMObjectPath containing names of the enumerated instances.
Throws:
CIMException - The method enumInstances throws a CIMException message if the CIMObjectPath is incorrect or does not exist.

enumInstances

public java.util.Vector enumInstances(CIMObjectPath op,
                                      boolean deep,
                                      CIMClass cc,
                                      boolean localOnly)
                               throws CIMException
This method must be implemented by instance providers to enumerate all instances of the class which is specified in op. The entire instances and not just the names are returned. Deep or shallow enumeration is possible, however currently the CIMOM only asks for shallow enumeration.
Parameters:
op - The object path specifies the class that must be enumerated.
deep - If true, deep enumeration must be done, otherwise shallow.
cc, - the class reference
localOnly - If true, only the non-inherited properties are to be returned, otherwise all properties are required.
Returns:
Vector of CIMInstance containing names of the enumerated instances.
Throws:
CIMException - The method enumInstances throws a CIMException if the CIMObjectPath is incorrect or does not exist.

getInstance

public CIMInstance getInstance(CIMObjectPath op,
                               CIMClass cc,
                               boolean localOnly)
                        throws CIMException
This method must be implemented by instance providers to retrieve the instance specified in the object path.
Parameters:
op - The name of the instance to be retrieved.
cc - The Class to which the instance belongs. This is useful for providers which do not want to create instances from scratch. They can call the class newInstance() routine to create a template for the new instance.
localOnly - If true, only the non-inherited properties are to be returned, otherwise all properties are required.
Returns:
CIMInstance The retrieved instance.
Throws:
CIMException - The method getInstance throws a CIMException if the CIMObjectPath is incorrect or does not exist.

createInstance

public CIMObjectPath createInstance(CIMObjectPath op,
                                    CIMInstance ci)
                             throws CIMException
This method must be implemented by instance providers to create the instance specified in the object path. If the instance does exist, CIMInstanceException with ID CIM_ERR_ALREADY_EXISTS must be thrown. The parameter should be the instance name.
Parameters:
op - The path of the instance to be set. The important part in this parameter is the namespace component.
ci - The instance to be set.
Returns:
CIMObjectPath of the instance that was created.
Throws:
CIMException - The method createInstance throws a CIMException.

setInstance

public void setInstance(CIMObjectPath op,
                        CIMInstance ci)
                 throws CIMException
This method must be implemented by instance providers to set the instance specified in the object path. If the instance does not exist, CIMInstanceException with ID CIM_ERR_NOT_FOUND must be thrown. The parameter should be the instance name.
Parameters:
op - The path of the instance to be set. The important part in this parameter is the namespace component.
ci - The instance to be set.
Throws:
CIMException - The setInstance method throws a CIMException.

deleteInstance

public void deleteInstance(CIMObjectPath op)
                    throws CIMException
This method must be implemented by instance providers to delete the instance specified in the object path.
Parameters:
ci - The instance to be deleted.
Throws:
CIMException - The deleteInstance method throws a CIMException.

execQuery

public java.util.Vector execQuery(CIMObjectPath op,
                                  java.lang.String query,
                                  int ql,
                                  CIMClass cc)
                           throws CIMException
This method must be implemented by instance providers to handle client queries for the dynamic data they provide. Typically, a provider parses the query string, enumerates the instances in the class (op), and then filters those instances to match the query string (ql). The provider then returns a vector containing the instances that match the query string. Providers with access to an entity that handles indexing can pass the query string to that entity for parsing.
Parameters:
op - The object name of the CIM Class to enumerate.
query - The CIM query expression.
ql - The CIM query.
cc - The CIM class reference.
Throws:
CIMException - Throws a CIMException.