package ever.workflowRepresentation;

import javax.xml.stream.XMLStreamWriter;
/**
 * Used to represent input- and output-products (resources and products) its an abstract class, Currently 
 * just the SimpleProduct class implements it.
 * @author Pol Schumacher, Wirtschaftsinformatik, Institut fuer Informatik, Goethe Universitaet Frankfurt
 *
 */
public abstract class Product {			
	
	public Product()
	{
										
	}
	/**
	 * A products must have a name
	 * @return productName
	 */
	public abstract String getName();

	/**
	 * Sets the product name
	 * @param name
	 * @throws EmptyProductException
	 */
	public abstract void setName(String name) throws EmptyProductException; 

//	/**
//	 * Get the id of the product. The idpool is not the same as the idpool for workflowelements
//	 * @return productId
//	 */
//	public abstract int getId();

	/**
	 * Add a new facet to a product.
	 * @param facet
	 */
	public abstract void addFacet(Facet f);

	/**
	 * Get next facet of the product
	 * @return fracet
	 */
	public abstract Facet getNextFacet();

	/**
	 * Writes the xml representation to the XMLStreamWriter
	 * @param writer 
	 * @param id The id of the Product.
	 */
	public abstract void exportWf2Xml(XMLStreamWriter writer, int id);

	/**
	 * Writes the product list entry, which is at the beginning of a workflow. This entry contains all facets.
	 * @param writer
	 * @throws EmptyProductException
	 */
	public abstract void exportProd2List(XMLStreamWriter writer) throws EmptyProductException;
	
	
	@Override
	public abstract int hashCode();

	@Override
	public abstract boolean equals(Object obj);
	
	

}
