/*
 * Kurento Commons MSControl: Simplified Media Control API for the Java Platform based on jsr309
 * Copyright (C) 2011  Tikal Technologies
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3
 * as published by the Free Software Foundation.
 *
 * 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, see <http://www.gnu.org/licenses/>.
 */

package com.kurento.commons.mscontrol;

import com.kurento.commons.mscontrol.mediacomponent.MediaComponent;
import com.kurento.commons.mscontrol.mediamixer.MediaMixer;
import com.kurento.commons.mscontrol.networkconnection.NetworkConnection;

/**
 * A MediaSession is a container and factory for media objects. It handles the
 * cleanup on <code>release()</code>.
 * 
 * @author mparis
 * 
 */
public interface MediaSession extends MediaObject {

	/**
	 * Create a NetworkConnection.
	 * 
	 * @return a NetworkConnection
	 * @throws MsControlException
	 */
	public NetworkConnection createNetworkConnection() throws MsControlException;

	/**
	 * </p> Create a MediaComponent.
	 * 
	 * @param predefinedConfig
	 *            Defines the concrete MediaComponent to create. <br>
	 *            The list of predefined Configurations is dependent on the
	 *            implementation.
	 * @param params
	 *            Parameters to create a MediaComponent. The possible parameters
	 *            for each concrete component must be defined on the
	 *            implementation.
	 * @return a MediaComponent
	 * @throws MsControlException
	 */
	public MediaComponent createMediaComponent(Configuration<MediaComponent> predefinedConfig,
			Parameters params) throws MsControlException;

	/**
	 * Create a MediaMixer.
	 * 
	 * @param predefinedConfig
	 *            Defines the set of resources in the MediaMixer, and their
	 *            arrangement. See MediaMixer for the list of predefined
	 *            Configurations.
	 * @param params
	 *            Customization parameters, like MediaObject.MEDIAOBJECT_ID, or
	 *            MediaMixer.MAX_PORTS.
	 * @return a MediaMixer Throws: MsControlException
	 */
	public MediaMixer createMediaMixer(Configuration<MediaMixer> predefinedConfig,
			Parameters params)
			throws MsControlException;

	/**
	 * Create a MediaMixer.
	 * 
	 * @return a MediaMixer Throws: MsControlException
	 */
	public MediaMixer createMediaMixer() throws MsControlException;
}

@@ -1353,32 +1353,373 @@
 trolException;%0A%0A
+%09/**%0A%09 * Create a NetworkConnection.%0A%09 * %0A%09 * @param predefinedConfig%0A%09 *            Defines the configuration of the NetworkConnection.%0A%09 * @return a NetworkConnection%0A%09 * @throws MsControlException%0A%09 */%0A%09public NetworkConnection createNetworkConnection(%0A%09%09%09Configuration%3CNetworkConnection%3E predefinedConfig)%0A%09%09%09throws MsControlException;%0A%0A
 %09/**%0A%09 * %3C/p%3E Cr

Add a method to create NetworkConnections based on a predefined configuration