package com.tandbergtv.metadatamanager;

import java.util.List;

import com.tandbergtv.metadatamanager.exception.MetadataException;
import com.tandbergtv.metadatamanager.exception.SearchException;
import com.tandbergtv.metadatamanager.model.RuleSet;

/**
 * This interface is implemented by every Rule Manager DAO.
 * 
 */
public interface RuleManagerDAO {

	/**
	 * Saves rule set in the rule set store.
	 *  
	 * @param ruleSet Rule set to be stored
	 * @return RuleSet
	 */
	RuleSet saveRuleSet(RuleSet ruleSet) throws MetadataException;

	/**
	 * Retrieves a rule set form the rule set store.
	 *  
	 * @param id 
	 * @return RuleSet
	 */
	RuleSet getRuleSet(long id) throws SearchException;

	/**
	 * Retrieves all rule set names form the rule set store for a given spec.
	 *  
	 * @param spec
	 * @return List<String>
	 */
	List<String> getAllRuleSetNames(String spec) throws MetadataException;

	/**
	 * Searches the store for a given rule set based on name and spec.
	 *  
	 * @param name rule set name
	 * @param spec 
	 * @return RuleSet
	 */
	RuleSet lookupRuleSet(String name, String spec) throws SearchException;
	/**
	 * Deletes a rule set form the rule set store.
	 *  
	 * @param id 
	 */
	void deleteRuleSet(long id) throws SearchException;
}
