/**
 * IJobManager.java
 * Created on May 15, 2008
 * (C) Copyright TANDBERG Television Ltd.
 */
package com.tandbergtv.watchpoint.pmm.job;

import java.util.List;

import com.tandbergtv.watchpoint.pmm.entities.Job;
import com.tandbergtv.watchpoint.pmm.entities.RuleType;

/**
 * @author spuranik
 * 
 * This interface deals with all job related tasks
 */
public interface IJobManager {

	/**
	 * @param job
	 *            the job entity for which a job needs to be created in the system
	 */
	public boolean createJob(Job job);

	/**
	 * @param jobId
	 *            The jobId for which the job entity is requested
	 * @return the job entity corresponding to the job id provided.
	 */
	public Job getJob(long jobId);

	/**
	 * @param job
	 *            job entity for which needs to be updated in the system
	 */
	public boolean updateJob(Job job);

	/**
	 * @param jobId
	 *            job id for the job which needs to be deleted
	 * @return true if the job was deleted else false. Errors are logged in this method.
	 */
	public boolean deleteJob(long jobId);

	/**
	 * @param contextId
	 *            contextId for which jobs need to be looked up
	 * @return the complete list of jobs for a given context Id
	 */
	public List<Job> getAllJobs(long contextId);

	/**
	 * @return retrieves all ruletypes and returns a list
	 */
	public List<RuleType> getAllRuleTypes();

	/**
	 * @param name
	 *            rule type name to search for
	 * @return RuleType object corresponding to this name
	 */
	public RuleType getRuleType(String name);

	/**
	 * @param isAssociatedWithTitles
	 *            true/false
	 * @return list of rule types which are/are not associated with titles
	 */
	public List<RuleType> getRuleTypes(boolean isAssociatedWithTitles);
}
