/*
 * ProviderImplIF.java
 *
 * Generated by {productTitle}  {versionName} - {utilityTitle}
 *
 * {copywrite}
 */
package {packageName}.common;

import javax.cim.CIMInstance;
import javax.cim.CIMObjectPath;
import javax.wbem.WBEMException;
import javax.wbem.WBEMOperation;
import javax.wbem.provider.IndicationProvider;
import javax.wbem.provider.PullInstanceProvider;

import com.ws.wbem.CloseableAddableIterator;
import com.ws.wbem.query.fql.FQLParser;

/**
 * This interface is used to allow a provider to be called for instance ops
 */

public interface ProviderImplIF extends IndicationProvider {

	/**
	 * Gets the name of this class
	 * 
	 * @return A string with the name of the CIM class this implementation is
	 *         for
	 */
	public String getClassName();
	
	/**
	 * Called so that a new instance of a class can be created
	 * 
	 * @param ci
	 *            The instance to create
	 * 
	 * @return Objectpath of the created instance
	 * @throws WBEMException
	 */
	public CIMObjectPath createInstance(CIMInstance ci) throws WBEMException;

	/**
	 * Delete the specified instance
	 * 
	 * @param op
	 *            Points to the instance to delete.
	 * @throws WBEMException
	 */
	public void deleteInstance(CIMObjectPath op) throws WBEMException;

	/**
	 * This function <B>must</B> be coded, it will gather the data necessary and
	 * then create CIMInstance objects for each element that exists. It should
	 * use the generateInstance function to actually create the instance.
	 * 
	 * @param iter
	 *            the iterator to add the values to
	 * @param op
	 *            this objectpath will be used to help create the returned
	 *            objectpath (i.e. the namespace, etc)
	 * @param propertyList
	 *            a list of the properties to return
	 * @param FQLParser
	 *            an FQLParser object used to validate the instance against
	 * @param wbemOperation
	 *            The WBEMOperation operation being performed
	 * @throws WBEMException
	 * 
	 * @see {@link PullInstanceProvider#enumerateInstances(CIMObjectPath, boolean, boolean, String[], String, String, boolean)}
	 */
	public void getAllInstances(CloseableAddableIterator<CIMInstance> iter,
			CIMObjectPath op, String[] propertyList, final FQLParser fqlParser,
			 final WBEMOperation wbemOperation) throws WBEMException;

	/**
	 * Get the instance specified by the object path.
	 * 
	 * @param op
	 *            The object path of the instance to be retrieved. This must
	 *            include all of the keys for the instance.
	 * @param propertyList
	 *            If not null this list will contain the names of properties
	 *            that the caller wants returned, properties not listed must not
	 *            be returned.
	 * @return The CIMInstance being retrieved
	 * @throws WBEMException
	 * @see {@link PullInstanceProvider#getInstance(CIMObjectPath, boolean, boolean, String[])}
	 */
	public CIMInstance getInstance(CIMObjectPath op, String[] propertyList)
			throws WBEMException;

	/**
	 * Return instances that match the specified query
	 * 
	 * @param iter
	 *            Iterator used to return qualifying instances to the caller
	 * @param op
	 *            Indicates which class is being operated on
	 * @param query
	 *            The query to be processed
	 * @param ql
	 *            The query language that the query is written in
	 * @throws WBEMException
	 * @see {@link PullInstanceProvider#execQuery(CIMObjectPath, String, String)}
	 */
	public void execQuery(CloseableAddableIterator<CIMInstance> iter,
			CIMObjectPath op, String query, String ql) throws WBEMException;

	/**
	 * Used to modify the instance
	 * 
	 * @param ci
	 *            Instance with changed properties
	 * @param propertyList
	 *            List of properties that have changed (null for all)
	 * @throws WBEMException
	 * @see {@link PullInstanceProvider#modifyInstance(CIMInstance, String[])
	 *
	 */
	public void modifyInstance(CIMInstance ci, String[] propertyList)	
			throws WBEMException;
}