/* ===================================================================
 * RecipeSearchIndexBiz.java
 * 
 * Created Sep 24, 2004 11:47:05 AM
 * 
 * Copyright (c) 2004 Matt Magoffin (spamsqr@msqr.us)
 * 
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License as 
 * published by the Free Software Foundation; either version 2 of 
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
 * 02111-1307 USA
 * ===================================================================
 * $Id: RecipeSearchIndexBiz.java 39 2009-05-06 03:30:47Z msqr $
 * ===================================================================
 */

package magoffin.matt.ieat.biz;

/**
 * Business interface for indexing recipes to enable searching.
 * 
 * <p>For search implementations outside of the backend data store,
 * this interface is assumed to be necessary in order to enable 
 * searching of that data. Most likely the search implementation 
 * will been to manage the creating and updating of a search index
 * as well as performing searches against that index.</p>
 * 
 * @author Matt Magoffin (spamsqr@msqr.us)
 * @version $Revision: 39 $ $Date: 2009-05-06 15:30:47 +1200 (Wed, 06 May 2009) $
 */

public interface RecipeSearchIndexBiz {

	/**
	 * Index a recipe object based on its ID.
	 * 
	 * <p>This method must support indexing a recipe that may 
	 * or may not have been indexed before.</p>
	 * 
	 * @param recipeId the ID of the recipe to index
	 */
	public void indexRecipe(Long recipeId);
	
	/**
	 * Remove a recipe from the index.
	 * 
	 * @param recipeId the ID of the recipe to remove
	 */
	public void removeRecipeFromIndex(Long recipeId);
	
	/**
	 * Rebuild the entire recipe index.
	 */
	public void recreateRecipeIndex();

	/**
	 * Index an ingredient object based on its ID.
	 * 
	 * <p>This method must support indexing a ingredient that may 
	 * or may not have been indexed before.</p>
	 * 
	 * @param ingredientId the ID of the ingredient to index
	 */
	public void indexIngredient(Integer ingredientId);
	
	/**
	 * Remove an ingredient from the index.
	 * 
	 * @param ingredientId the ID of the ingredient to remove
	 */
	public void removeIngredientFromIndex(Integer ingredientId);
	
	/**
	 * Rebuild the entire ingredient index.
	 */
	public void recreateIngredientIndex();

	/**
	 * Index a user object based on its ID.
	 * 
	 * <p>This method must support indexing a user that may 
	 * or may not have been indexed before.</p>
	 * 
	 * @param userId the ID of the user to index
	 */
	public void indexUser(Integer userId);
	
	/**
	 * Remove a user from the index.
	 * 
	 * @param userId the ID of the user to remove
	 */
	public void removeUserFromIndex(Integer userId);
	
	/**
	 * Rebuild the entire user index.
	 */
	public void recreateUserIndex();
	
	/**
	 * Rebuild the entire unit index.
	 */
	public void recreateUnitIndex();
	
	/**
	 * Recreate all search indicies.
	 */
	public void recreateSearchIndicies();
}
