org.mobicents.media.server.testsuite.general.rtp
Class RtpSocketFactoryImpl

java.lang.Object
  extended by org.mobicents.media.server.testsuite.general.rtp.RtpSocketFactoryImpl
All Implemented Interfaces:
RtpSocketFactory

public class RtpSocketFactoryImpl
extends java.lang.Object
implements RtpSocketFactory

Start time:09:56:52 2009-08-03
Project: mobicents-media-server-test-suite

Author:
Bartosz Baranowski

Field Summary
protected  java.util.HashMap<java.nio.channels.SelectionKey,RtpSocket> rtpSockets
           
 
Constructor Summary
RtpSocketFactoryImpl()
           
 
Method Summary
 RtpSocket createSocket()
           
 java.lang.String getBindAddress()
          Gets the IP address to which trunk is bound.
 java.util.Vector<javax.sdp.Attribute> getFormatMap()
           
 int getHighPort()
           
 int getLowPort()
           
 java.lang.String getPortRange()
          Gets the available port range.
 java.nio.channels.SelectionKey registerSocket(RtpSocketImpl rtpSocketImpl)
           
 void releaseSocket(RtpSocket rtpSocket)
           
 void setBindAddress(java.lang.String bindAddress)
          Modify the bind address.
 void setFormatMap(java.util.Vector<javax.sdp.Attribute> originalFormatMap)
           
 void setHighPort(int hightPort)
           
 void setLowPort(int lowPort)
           
 void setPortRange(java.lang.String port)
          Modify port used to create RTP stream.
 void start()
           
 void stop()
          Terminates execution of created sockets, this is hard stop method, which will propably break calls.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rtpSockets

protected volatile java.util.HashMap<java.nio.channels.SelectionKey,RtpSocket> rtpSockets
Constructor Detail

RtpSocketFactoryImpl

public RtpSocketFactoryImpl()
                     throws java.io.IOException
Throws:
java.io.IOException
Method Detail

createSocket

public RtpSocket createSocket()
                       throws java.net.SocketException,
                              java.io.IOException
Specified by:
createSocket in interface RtpSocketFactory
Throws:
java.net.SocketException
java.io.IOException

releaseSocket

public void releaseSocket(RtpSocket rtpSocket)
Specified by:
releaseSocket in interface RtpSocketFactory

getFormatMap

public java.util.Vector<javax.sdp.Attribute> getFormatMap()
Specified by:
getFormatMap in interface RtpSocketFactory

setBindAddress

public void setBindAddress(java.lang.String bindAddress)
                    throws java.net.UnknownHostException
Description copied from interface: RtpSocketFactory
Modify the bind address. All endpoints of the trunk use this address for RTP connection.

Specified by:
setBindAddress in interface RtpSocketFactory
Parameters:
bindAddress - IP address as string or host name.
Throws:
java.net.UnknownHostException

setFormatMap

public void setFormatMap(java.util.Vector<javax.sdp.Attribute> originalFormatMap)
Specified by:
setFormatMap in interface RtpSocketFactory

stop

public void stop()
Description copied from interface: RtpSocketFactory
Terminates execution of created sockets, this is hard stop method, which will propably break calls.

Specified by:
stop in interface RtpSocketFactory

getBindAddress

public java.lang.String getBindAddress()
Description copied from interface: RtpSocketFactory
Gets the IP address to which trunk is bound. All endpoints of the trunk use this address for RTP connection.

Specified by:
getBindAddress in interface RtpSocketFactory
Returns:
the IP address string to which this trunk is bound.

start

public void start()
           throws java.net.SocketException,
                  java.io.IOException
Specified by:
start in interface RtpSocketFactory
Throws:
java.net.SocketException
java.io.IOException

getPortRange

public java.lang.String getPortRange()
Description copied from interface: RtpSocketFactory
Gets the available port range.

Specified by:
getPortRange in interface RtpSocketFactory
Returns:
the string in format "lowPort-highPort".

setPortRange

public void setPortRange(java.lang.String port)
Description copied from interface: RtpSocketFactory
Modify port used to create RTP stream.

Specified by:
setPortRange in interface RtpSocketFactory
Parameters:
port - the string in format "lowPort-highPort"

getLowPort

public int getLowPort()
Specified by:
getLowPort in interface RtpSocketFactory

setLowPort

public void setLowPort(int lowPort)

getHighPort

public int getHighPort()
Specified by:
getHighPort in interface RtpSocketFactory

setHighPort

public void setHighPort(int hightPort)

registerSocket

public java.nio.channels.SelectionKey registerSocket(RtpSocketImpl rtpSocketImpl)
                                              throws java.nio.channels.ClosedChannelException
Parameters:
rtpSocketImpl -
Returns:
Throws:
java.nio.channels.ClosedChannelException


Copyright © 2009. All Rights Reserved.