package com.tandbergtv.watchpoint.pmm.assetlist;

import java.io.Serializable;
import java.util.List;

import com.tandbergtv.watchpoint.pmm.entities.IAssetList;
import com.tandbergtv.workflow.core.service.Service;

public interface IAssetListPersistenceService<L extends IAssetList> extends Service {

	/**
	 * Creates or updates the given entity.
	 * 
	 * @param entity
	 * @return entity that was persisted to the db.
	 */
	L save(L entity);

	/**
	 * Returns the entity with the specified key
	 * 
	 * @param id
	 * @return
	 */
	L get(Serializable id);

	/**
	 * Deletes the entity represented by this id.
	 * 
	 * @param id
	 */
	void delete(Serializable id);

	/**
	 * Deletes the specified entity.
	 * 
	 * @param entity
	 */
	void delete(L entity);
	
	/**
	 * Adds the titles with the given ids to the this title list.
	 * 
	 * @param assetListId
	 * @param titleIds
	 */
	void addTitles(long assetListId, List<Long> titleIds);
	
	/**
	 * Removes the titles with the given ids from the this title list.
	 * 
	 * @param assetListId
	 * @param titleIds
	 */
	void removeTitles(long assetListId, List<Long> titleIds);
}
