001/**
002 *
003 * Copyright 2003-2006 Jive Software.
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smackx.jingleold.mediaimpl.test;
018
019import org.jivesoftware.smackx.jingleold.JingleSession;
020import org.jivesoftware.smackx.jingleold.media.JingleMediaSession;
021import org.jivesoftware.smackx.jingleold.media.PayloadType;
022import org.jivesoftware.smackx.jingleold.nat.TransportCandidate;
023
024/**
025 * This Class implements a complete JingleMediaSession for unit testing.
026 *
027 * @author Thiago Camargo
028 */
029public class TestMediaSession extends JingleMediaSession {
030
031     /**
032     * Creates a TestMediaSession with defined payload type, remote and local candidates
033     *
034     * @param payloadType Payload of the jmf
035     * @param remote      the remote information. The candidate that the jmf will be sent to.
036     * @param local       the local information. The candidate that will receive the jmf
037     * @param locator     media locator
038     */
039    public TestMediaSession(final PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local,
040            final String locator, JingleSession jingleSession) {
041        super(payloadType, remote, local, "Test", jingleSession);
042        initialize();
043    }
044
045    /**
046     * Initialize the screen share channels.
047     */
048    public void initialize() {
049
050    }
051
052    /**
053     * Starts transmission and for NAT Traversal reasons start receiving also.
054     */
055    public void startTrasmit() {
056        
057    }
058
059    /**
060     * Set transmit activity. If the active is true, the instance should trasmit.
061     * If it is set to false, the instance should pause transmit.
062     *
063     * @param active active state
064     */
065    public void setTrasmit(boolean active) {
066        
067    }
068
069    /**
070     * For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
071     */
072    public void startReceive() {
073        // Do nothing
074    }
075
076    /**
077     * Stops transmission and for NAT Traversal reasons stop receiving also.
078     */
079    public void stopTrasmit() {
080       
081    }
082
083    /**
084     * For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
085     */
086    public void stopReceive() {
087       
088    }
089}