/**
 * ITitleProviderRegistry.java
 * Created May 14, 2008
 * Copyright (c) TANDBERG Television 2007-2008
 */
package com.tandbergtv.watchpoint.pmm.title.provider;

import java.util.Collection;

import com.tandbergtv.workflow.core.service.Service;

/**
 * The registry of title providers
 * 
 * @author Sahil Verma
 */
public interface ITitleProviderRegistry extends Service {
	
	/**
	 * Adds the specified provider
	 * 
	 * @param provider
	 */
	void addProvider(ITitleProvider provider);
	
	/**
	 * Removes the provider from this registry
	 * 
	 * @param provider
	 */
	void removeProvider(ITitleProvider provider);
	
	/**
	 * Returns all the registered ITitleProviders
	 * 
	 * @return
	 */
	Collection<ITitleProvider> getProviders();
	
	/**
	 * Returns the title providers that support the specified metadata format 
	 * 
	 * @param specification
	 * @return
	 */
	Collection<ITitleProvider> getProviders(String specification);
	
	/**
	 * Returns the provider with the specified system id
	 * 
	 * @param id
	 * @return
	 */
	ITitleProvider getProvider(String id);

	/**
	 * Returns the provider that manages the provider instance that matches the provided title
	 * external location
	 * 
	 * @param titleExternalLocation The external location key for the title
	 * 
	 * @return The Title Provider that matches, or null if no match is found.
	 */
	ITitleProvider getProviderForTitle(String titleExternalLocation);

	/**
	 * Returns the default title provider
	 * 
	 * @return
	 */
	ITitleProvider getDefaultProvider();
}
