U
- the peer extension class like for example CallPeerSipImpl
or CallPeerJabberImplpublic abstract class TransportManager<U extends MediaAwareCallPeer<?,?,?>>
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
TransportManager(U callPeer)
Creates a new instance of this transport manager, binding it to the
specified peer.
|
Modifier and Type | Method and Description |
---|---|
void |
closeStreamConnector(org.jitsi.service.neomedia.MediaType mediaType)
Closes the existing StreamConnector, if any, associated with a
specific MediaType and removes its reference from this
TransportManager.
|
protected void |
closeStreamConnector(org.jitsi.service.neomedia.MediaType mediaType,
org.jitsi.service.neomedia.StreamConnector streamConnector)
Closes a specific StreamConnector associated with a specific
MediaType.
|
protected org.ice4j.ice.Agent |
createIceAgent()
Creates the ICE agent that we would be using in this transport manager
for all negotiation.
|
protected org.ice4j.ice.IceMediaStream |
createIceStream(java.lang.String media,
org.ice4j.ice.Agent agent)
Creates an
IceMediaStream with the specified media
name. |
protected org.jitsi.service.neomedia.StreamConnector |
createStreamConnector(org.jitsi.service.neomedia.MediaType mediaType)
Creates a media StreamConnector for a stream of a specific
MediaType.
|
U |
getCallPeer()
Returns the
MediaAwareCallPeer that this transport manager is
serving. |
abstract long |
getHarvestingTime(java.lang.String harvesterName)
Returns the harvesting time (in ms) for the harvester given in parameter.
|
static java.lang.String |
getICECandidateExtendedType(org.ice4j.ice.Agent iceAgent,
java.lang.String streamName)
Returns the ICE candidate extended type selected by the given agent.
|
abstract java.lang.String |
getICECandidateExtendedType(java.lang.String streamName)
Returns the extended type of the candidate selected if this transport
manager is using ICE.
|
abstract java.net.InetSocketAddress |
getICELocalHostAddress(java.lang.String streamName)
Returns the ICE local host address.
|
abstract java.net.InetSocketAddress |
getICELocalReflexiveAddress(java.lang.String streamName)
Returns the ICE local reflexive address (server or peer reflexive).
|
abstract java.net.InetSocketAddress |
getICELocalRelayedAddress(java.lang.String streamName)
Returns the ICE local relayed address (server or peer relayed).
|
abstract java.net.InetSocketAddress |
getICERemoteHostAddress(java.lang.String streamName)
Returns the ICE remote host address.
|
abstract java.net.InetSocketAddress |
getICERemoteReflexiveAddress(java.lang.String streamName)
Returns the ICE remote reflexive address (server or peer reflexive).
|
abstract java.net.InetSocketAddress |
getICERemoteRelayedAddress(java.lang.String streamName)
Returns the ICE remote relayed address (server or peer relayed).
|
abstract java.lang.String |
getICEState()
Returns the current state of ICE processing.
|
protected abstract java.net.InetAddress |
getIntendedDestination(U peer)
Returns the InetAddress that is most likely to be used as a
next hop when contacting the specified destination.
|
java.net.InetAddress |
getLastUsedLocalHost()
Returns the InetAddress that we are using in one of our
StreamConnectors or, in case we don't have any connectors yet
the address returned by the our network address manager as the best local
address to use when contacting the CallPeer associated with this
MediaHandler.
|
abstract int |
getNbHarvesting()
Returns the number of harvesting for this agent.
|
abstract int |
getNbHarvesting(java.lang.String harvesterName)
Returns the number of harvesting time for the harvester given in
parameter.
|
protected static PortTracker |
getPortTracker(org.jitsi.service.neomedia.MediaType mediaType)
Returns the port tracker that we are supposed to use when binding ports
for the specified
MediaType . |
protected static PortTracker |
getPortTracker(java.lang.String mediaTypeStr)
Returns the port tracker that we are supposed to use when binding ports
for the
MediaType indicated by the string param. |
org.jitsi.service.neomedia.StreamConnector |
getStreamConnector(org.jitsi.service.neomedia.MediaType mediaType)
Returns the StreamConnector instance that this media handler
should use for streams of the specified mediaType.
|
abstract long |
getTotalHarvestingTime()
Returns the total harvesting time (in ms) for all harvesters.
|
protected static void |
initializePortNumbers()
Tries to set the ranges of the PortTrackers (e.g.
|
void |
sendHolePunchPacket(org.jitsi.service.neomedia.MediaStreamTarget target,
org.jitsi.service.neomedia.MediaType type)
Sends empty UDP packets to target destination data/control ports in order
to open ports on NATs or and help RTP proxies latch onto our RTP ports.
|
void |
sendHolePunchPacket(org.jitsi.service.neomedia.MediaStreamTarget target,
org.jitsi.service.neomedia.MediaType type,
org.jitsi.service.neomedia.RawPacket packet)
Sends empty UDP packets to target destination data/control ports in order
to open ports on NATs or and help RTP proxies latch onto our RTP ports.
|
protected void |
setTrafficClass(org.jitsi.service.neomedia.MediaStreamTarget target,
org.jitsi.service.neomedia.MediaType type)
Set traffic class (QoS) for the RTP socket.
|
protected TransportManager(U callPeer)
callPeer
- the MediaAwareCallPeer
whose traffic we will be
taking care of.protected static PortTracker getPortTracker(org.jitsi.service.neomedia.MediaType mediaType)
MediaType
.mediaType
- the media type that we want to obtain the port tracker
for. Use null to obtain the default port tracker.MediaType
.protected static PortTracker getPortTracker(java.lang.String mediaTypeStr)
MediaType
indicated by the string param. If we do not
recognize the string as a valid media type, we simply return the default
port tracker.mediaTypeStr
- the name of the media type that we want to obtain a
port tracker for.MediaType
with the specified name or the default tracker
in case the name doesn't ring a bell.public org.jitsi.service.neomedia.StreamConnector getStreamConnector(org.jitsi.service.neomedia.MediaType mediaType) throws OperationFailedException
mediaType
- the MediaType that we'd like to create a
connector for.OperationFailedException
- in case we failed to initialize our
connector.public void closeStreamConnector(org.jitsi.service.neomedia.MediaType mediaType)
mediaType
- the MediaType associated with the
StreamConnector to closeprotected void closeStreamConnector(org.jitsi.service.neomedia.MediaType mediaType, org.jitsi.service.neomedia.StreamConnector streamConnector)
mediaType
- the MediaType associated with the specified
streamConnectorstreamConnector
- the StreamConnector to be closedcloseStreamConnector(MediaType)
protected org.jitsi.service.neomedia.StreamConnector createStreamConnector(org.jitsi.service.neomedia.MediaType mediaType) throws OperationFailedException
mediaType
- the MediaType of the stream for which a
StreamConnector is to be createdOperationFailedException
- if the binding of the sockets failsprotected static void initializePortNumbers()
public java.net.InetAddress getLastUsedLocalHost()
public void sendHolePunchPacket(org.jitsi.service.neomedia.MediaStreamTarget target, org.jitsi.service.neomedia.MediaType type)
target
- MediaStreamTargettype
- the MediaType
of the connector we'd like to send the
hole punching packet through.public void sendHolePunchPacket(org.jitsi.service.neomedia.MediaStreamTarget target, org.jitsi.service.neomedia.MediaType type, org.jitsi.service.neomedia.RawPacket packet)
target
- MediaStreamTargettype
- the MediaType
of the connector we'd like to send the
hole punching packet through.packet
- (optional) use a pre-generated packet that will be sentprotected void setTrafficClass(org.jitsi.service.neomedia.MediaStreamTarget target, org.jitsi.service.neomedia.MediaType type)
target
- MediaStreamTargettype
- the MediaType
of the connector we'd like to set
traffic classprotected abstract java.net.InetAddress getIntendedDestination(U peer)
peer
- the CallPeer that we would contact.java.lang.IllegalArgumentException
- if destination is not a valid
host/ip/fqdnpublic U getCallPeer()
MediaAwareCallPeer
that this transport manager is
serving.MediaAwareCallPeer
that this transport manager is
serving.public abstract java.lang.String getICECandidateExtendedType(java.lang.String streamName)
streamName
- The stream name (AUDIO, VIDEO);public abstract java.lang.String getICEState()
public abstract java.net.InetSocketAddress getICELocalHostAddress(java.lang.String streamName)
streamName
- The stream name (AUDIO, VIDEO);public abstract java.net.InetSocketAddress getICERemoteHostAddress(java.lang.String streamName)
streamName
- The stream name (AUDIO, VIDEO);public abstract java.net.InetSocketAddress getICELocalReflexiveAddress(java.lang.String streamName)
streamName
- The stream name (AUDIO, VIDEO);public abstract java.net.InetSocketAddress getICERemoteReflexiveAddress(java.lang.String streamName)
streamName
- The stream name (AUDIO, VIDEO);public abstract java.net.InetSocketAddress getICELocalRelayedAddress(java.lang.String streamName)
streamName
- The stream name (AUDIO, VIDEO);public abstract java.net.InetSocketAddress getICERemoteRelayedAddress(java.lang.String streamName)
streamName
- The stream name (AUDIO, VIDEO);public abstract long getTotalHarvestingTime()
public abstract long getHarvestingTime(java.lang.String harvesterName)
harvesterName
- The class name if the harvester.public abstract int getNbHarvesting()
public abstract int getNbHarvesting(java.lang.String harvesterName)
harvesterName
- The class name if the harvester.public static java.lang.String getICECandidateExtendedType(org.ice4j.ice.Agent iceAgent, java.lang.String streamName)
iceAgent
- The ICE agent managing the ICE offer/answer exchange,
collecting and selecting the candidate.streamName
- The stream name (AUDIO, VIDEO);protected org.ice4j.ice.Agent createIceAgent()
protected org.ice4j.ice.IceMediaStream createIceStream(java.lang.String media, org.ice4j.ice.Agent agent) throws OperationFailedException
IceMediaStream
with the specified media
name.media
- the name of the stream we'd like to create.agent
- the ICE Agent
that we will be appending the stream
to.IceMediaStream
OperationFailedException
- if binding on the specified media stream
fails for some reason.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.