Package org.jitsi.service.neomedia
Class StreamConnectorDelegate<T extends StreamConnector>
- java.lang.Object
-
- org.jitsi.service.neomedia.StreamConnectorDelegate<T>
-
- Type Parameters:
T- the very type of the StreamConnector wrapped by StreamConnectorDelegate
- All Implemented Interfaces:
StreamConnector
public class StreamConnectorDelegate<T extends StreamConnector> extends Object implements StreamConnector
Implements aStreamConnectorwhich wraps a specific StreamConnector instance.- Author:
- Lyubomir Marinov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jitsi.service.neomedia.StreamConnector
StreamConnector.Protocol
-
-
Field Summary
Fields Modifier and Type Field Description protected TstreamConnectorThe StreamConnector wrapped by this instance.
-
Constructor Summary
Constructors Constructor Description StreamConnectorDelegate(T streamConnector)Initializes a new StreamConnectorDelegate which is to wrap a specific StreamConnector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Releases the resources allocated by this instance in the course of its execution and prepares it to be garbage collected.DatagramSocketgetControlSocket()Returns a reference to the DatagramSocket that a stream should use for control data (e.g.SocketgetControlTCPSocket()Returns a reference to the Socket that a stream should use for control data (e.g.DatagramSocketgetDataSocket()Returns a reference to the DatagramSocket that a stream should use for data (e.g.SocketgetDataTCPSocket()Returns a reference to the Socket that a stream should use for data (e.g.StreamConnector.ProtocolgetProtocol()Returns the protocol of this StreamConnector.booleanisRtcpmux()Returns true if this StreamConnector uses rtcp-mux, that is, if its data and control sockets share the same local address and port.voidstarted()Notifies this instance that utilization of its DatagramSockets for data and/or control traffic has started.voidstopped()Notifies this instance that utilization of its DatagramSockets for data and/or control traffic has temporarily stopped.
-
-
-
Field Detail
-
streamConnector
protected final T extends StreamConnector streamConnector
The StreamConnector wrapped by this instance.
-
-
Constructor Detail
-
StreamConnectorDelegate
public StreamConnectorDelegate(T streamConnector)
Initializes a new StreamConnectorDelegate which is to wrap a specific StreamConnector.- Parameters:
streamConnector- the StreamConnector to be wrapped by the new instance
-
-
Method Detail
-
close
public void close()
Releases the resources allocated by this instance in the course of its execution and prepares it to be garbage collected. CallsStreamConnector.close()on the StreamConnector wrapped by this instance.- Specified by:
closein interfaceStreamConnector
-
getControlSocket
public DatagramSocket getControlSocket()
Returns a reference to the DatagramSocket that a stream should use for control data (e.g. RTCP).- Specified by:
getControlSocketin interfaceStreamConnector- Returns:
- a reference to the DatagramSocket that a stream should use for control data (e.g. RTCP) or null if this StreamConnector does not handle UDP sockets.
-
getControlTCPSocket
public Socket getControlTCPSocket()
Returns a reference to the Socket that a stream should use for control data (e.g. RTCP).- Specified by:
getControlTCPSocketin interfaceStreamConnector- Returns:
- a reference to the Socket that a stream should use for control data (e.g. RTCP) or null if this StreamConnector does not handle TCP sockets.
-
getDataSocket
public DatagramSocket getDataSocket()
Returns a reference to the DatagramSocket that a stream should use for data (e.g. RTP) traffic.- Specified by:
getDataSocketin interfaceStreamConnector- Returns:
- a reference to the DatagramSocket that a stream should use for data (e.g. RTP) traffic or null if this StreamConnector does not handle UDP sockets.
-
getDataTCPSocket
public Socket getDataTCPSocket()
Returns a reference to the Socket that a stream should use for data (e.g. RTP) traffic.- Specified by:
getDataTCPSocketin interfaceStreamConnector- Returns:
- a reference to the Socket that a stream should use for data (e.g. RTP) traffic or null if this StreamConnector does not handle TCP sockets.
-
getProtocol
public StreamConnector.Protocol getProtocol()
Returns the protocol of this StreamConnector.- Specified by:
getProtocolin interfaceStreamConnector- Returns:
- the protocol of this StreamConnector
-
started
public void started()
Notifies this instance that utilization of its DatagramSockets for data and/or control traffic has started.- Specified by:
startedin interfaceStreamConnector
-
stopped
public void stopped()
Notifies this instance that utilization of its DatagramSockets for data and/or control traffic has temporarily stopped. This instance should be prepared to be started at a later time again though.- Specified by:
stoppedin interfaceStreamConnector
-
isRtcpmux
public boolean isRtcpmux()
Returns true if this StreamConnector uses rtcp-mux, that is, if its data and control sockets share the same local address and port.- Specified by:
isRtcpmuxin interfaceStreamConnector- Returns:
- true if this StreamConnector uses rtcp-mux, that is, if its data and control sockets share the same local address and port.
-
-