/*
 * {ClassName}Impl.java
 *
 * Generated by {productTitle}  {versionName} - {utilityTitle}
 *
 * {copywrite}
 */
package {packageName}.implementation;

import javax.cim.*;
import javax.wbem.*;

import {packageName}.abstractImpl.{ClassName}AbstractImpl;
import {packageName}.data.{ClassName}Data;
import static {packageName}.schema.{schemaName}.{SchemaName}_{ClassName}Constants.*;
import com.ws.wbem.CloseableAddableIterator;
import com.ws.wbem.query.fql.FQLParser;

public class {ClassName}Impl extends {ClassName}AbstractImpl {

	public {ClassName}Impl() {
		super(CCN_NAME);
	}
	
	@Override
	public void getAllInstances(CloseableAddableIterator<CIMInstance> iter,
			CIMObjectPath op, String[] propertyList,
			final FQLParser fqlParser,
			final WBEMOperation wbemOperation) throws WBEMException {

		try {
			// This example code generates a single instance with dummy values.
			// TODO: Provider writers should modify this code.
			{ClassName}Data inst = new {ClassName}Data();
		
			// set key values			
			{prop_key_value_setters}			
			// set other pertinent values
			{prop_value_setters}
			final CIMInstance instance = inst.generateCIMInstance(op,
					propertyList, fqlParser);

			// if instance is not null (FQLParser did not reject instance) then
			// add it to the return iterator
			if (null != instance) {
				iter.add(instance);
			}
		} finally {
			if (null != iter && !iter.isClosed()) {
				iter.done();
			}
		}
	}
	
    @Override
	public void initialize() throws WBEMException {
		// Add one time initialization code here

	}
    
    @Override
	public CIMInstance getInstance(final CIMObjectPath op,
			final String[] propertyList) throws WBEMException {
		// TODO: This function is very inefficient as it enumerates all
		// instances and then tries to match the passed in objectpath to what
		// is returned. If the provider has more then a couple of instances then
		// this implementation should be changed to be more efficient
		return super.getInstance(op, propertyList);
	}
	
}
