org.mobicents.media.server.resource
Class Channel

java.lang.Object
  extended by org.mobicents.media.server.resource.Channel

public class Channel
extends java.lang.Object

Channel is used to join media source with media sink with customized media path. For customization of media path inner pipes are used where each pipe has c onfigured its inlet and outlet.

Author:
kulikov

Field Summary
protected  java.util.HashMap<java.lang.String,org.mobicents.media.Inlet> inlets
           
protected  java.util.HashMap<java.lang.String,org.mobicents.media.Outlet> outlets
           
protected  java.util.HashMap<java.lang.String,org.mobicents.media.MediaSink> sinks
           
protected  java.util.HashMap<java.lang.String,org.mobicents.media.MediaSource> sources
           
 
Constructor Summary
protected Channel(java.util.HashMap<java.lang.String,? extends org.mobicents.media.Component> components)
           
protected Channel(java.util.HashMap<java.lang.String,org.mobicents.media.MediaSource> sources, java.util.HashMap<java.lang.String,org.mobicents.media.MediaSink> sinks, java.util.HashMap<java.lang.String,org.mobicents.media.Inlet> inlets, java.util.HashMap<java.lang.String,org.mobicents.media.Outlet> outlets)
          Constructs new channel with specified components.
 
Method Summary
 void close()
           
 void closePipe(Pipe pipe)
          Closes specified pipe.
 void connect(Channel rxChannel)
          Establish a connection with other channel
 org.mobicents.media.Format[] connect(org.mobicents.media.MediaSink sink)
          Connects channel to a sink.
 org.mobicents.media.Format[] connect(org.mobicents.media.MediaSource source)
          Connects channel to a source.
 void disconnect(Channel channel)
          Deletes connection with other channel
 void disconnect(org.mobicents.media.MediaSink sink)
          Disconnects channel from a sink.
 void disconnect(org.mobicents.media.MediaSource source)
          Disconnects channel from a source.
 long getBytesTransmitted()
           
 org.mobicents.media.Component getComponent(java.lang.Class _interface)
           
 org.mobicents.media.Component getComponent(java.lang.String name)
          Searches the component with specified name that can be explicitly added to this channel.
 org.mobicents.media.server.spi.Connection getConnection()
           
 org.mobicents.media.server.spi.Endpoint getEndpoint()
           
 org.mobicents.media.Format[] getFormats()
           
 org.mobicents.media.Format[] getInputFormats()
           
 org.mobicents.media.Format[] getOutputFormats()
           
 long getPacketsTransmitted()
           
 void openPipe(Pipe pipe, java.lang.String inlet, java.lang.String outlet)
          Opens pipes between source and sink.
 void setConnection(org.mobicents.media.server.spi.Connection connection)
           
 void setEndpoint(org.mobicents.media.server.spi.Endpoint endpoint)
           
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sources

protected java.util.HashMap<java.lang.String,org.mobicents.media.MediaSource> sources

sinks

protected java.util.HashMap<java.lang.String,org.mobicents.media.MediaSink> sinks

inlets

protected java.util.HashMap<java.lang.String,org.mobicents.media.Inlet> inlets

outlets

protected java.util.HashMap<java.lang.String,org.mobicents.media.Outlet> outlets
Constructor Detail

Channel

protected Channel(java.util.HashMap<java.lang.String,org.mobicents.media.MediaSource> sources,
                  java.util.HashMap<java.lang.String,org.mobicents.media.MediaSink> sinks,
                  java.util.HashMap<java.lang.String,org.mobicents.media.Inlet> inlets,
                  java.util.HashMap<java.lang.String,org.mobicents.media.Outlet> outlets)
Constructs new channel with specified components.

Parameters:
sources - the map of components of type MediaSource
sinks - the map of components of type MediaSink
inlets - the map of components of type Inlet
outlets - the map of components of type Outlet

Channel

protected Channel(java.util.HashMap<java.lang.String,? extends org.mobicents.media.Component> components)
Method Detail

getFormats

public org.mobicents.media.Format[] getFormats()

getEndpoint

public org.mobicents.media.server.spi.Endpoint getEndpoint()

getConnection

public org.mobicents.media.server.spi.Connection getConnection()

setEndpoint

public void setEndpoint(org.mobicents.media.server.spi.Endpoint endpoint)

setConnection

public void setConnection(org.mobicents.media.server.spi.Connection connection)

start

public void start()

stop

public void stop()

openPipe

public void openPipe(Pipe pipe,
                     java.lang.String inlet,
                     java.lang.String outlet)
              throws UnknownComponentException
Opens pipes between source and sink.

Parameters:
pipe - the pipe to be opened
inlet - the name of the source
outlet - the name of the destination. *
Throws:
UnknownComponentException - if name of the sink or source is not known.

closePipe

public void closePipe(Pipe pipe)
Closes specified pipe.

Parameters:
pipe - the pipe to be closed.

getInputFormats

public org.mobicents.media.Format[] getInputFormats()

getOutputFormats

public org.mobicents.media.Format[] getOutputFormats()

connect

public org.mobicents.media.Format[] connect(org.mobicents.media.MediaSink sink)
Connects channel to a sink.

Parameters:
sink - the sink to connect to

disconnect

public void disconnect(org.mobicents.media.MediaSink sink)
Disconnects channel from a sink.

Parameters:
sink - the sink to connect from

connect

public org.mobicents.media.Format[] connect(org.mobicents.media.MediaSource source)
Connects channel to a source.

Parameters:
source - the source to connect to

disconnect

public void disconnect(org.mobicents.media.MediaSource source)
Disconnects channel from a source.

Parameters:
source - the source to connect from

connect

public void connect(Channel rxChannel)
Establish a connection with other channel

Parameters:
other -

disconnect

public void disconnect(Channel channel)
Deletes connection with other channel

Parameters:
other -

getComponent

public org.mobicents.media.Component getComponent(java.lang.String name)
Searches the component with specified name that can be explicitly added to this channel.

Parameters:
name - the name of the component to find.
Returns:
component that was found or null if component with specified name absent.

getComponent

public org.mobicents.media.Component getComponent(java.lang.Class _interface)

close

public void close()

getPacketsTransmitted

public long getPacketsTransmitted()

getBytesTransmitted

public long getBytesTransmitted()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.