-
- All Implemented Interfaces:
public class IceMediaStreamThe class represents a media stream from the ICE perspective, i.e. a collection of components.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringPROPERTY_PAIR_CONSENT_FRESHNESS_CHANGEDpublic final static StringPROPERTY_PAIR_NOMINATEDpublic final static StringPROPERTY_PAIR_STATE_CHANGEDpublic final static StringPROPERTY_PAIR_VALIDATEDprivate final Stringnameprivate final CheckListcheckListprivate final AgentparentAgentprivate StringremoteUfragprivate StringremotePasswordprivate Loggerlogger
-
Method Summary
Modifier and Type Method Description StringgetName()Returns the name of this IceMediaStream. CheckListgetCheckList()Returns the list of CandidatePairs to be used in checks for this stream. AgentgetParentAgent()Returns a reference to the Agent that this stream belongs to. StringgetRemoteUfrag()Returns the user name that we received from the remote peer or null if we haven't received a user name from them yet. voidsetRemoteUfrag(String remoteUfrag)Specifies the user name that we received from the remote peer. StringgetRemotePassword()Returns the password that we received from the remote peer or null if we haven't received a password from them yet. voidsetRemotePassword(String remotePassword)Specifies the password that we received from the remote peer. LoggergetLogger()static IceMediaStreambuild(Agent parentAgent, String name)Use builder pattern to provide an immutable IceMediaStream instance. StringtoString()Returns a String representation of this media stream. ComponentgetComponent(int id)Returns the Component with the specified id or null if no such component exists in this stream. intgetComponentCount()Returns the number of Components currently registered with this stream. List<Integer>getComponentIDs()Returns the IDs of all Components currently registered with this stream. voidremoveComponent(Component component)Removes component and all its Candidates from the this stream and releases all associated resources that they had allocated (like sockets for example) LocalCandidatefindLocalCandidate(TransportAddress address, LocalCandidate base)Returns the local LocalCandidate with the specified address if it belongs to any of this stream's components or null otherwise. RemoteCandidatefindRemoteCandidate(TransportAddress remoteAddress)Returns the local Candidate with the specified remoteAddress if it belongs to any of this stream's s or null if it doesn't. CandidatePairfindCandidatePair(TransportAddress localAddress, TransportAddress remoteAddress)Returns the CandidatePair with the specified remote and local addresses or null if neither of the CheckLists in this stream contain such a pair. CandidatePairfindCandidatePair(String localUFrag, String remoteUFrag)Returns the CandidatePair with the specified remote and local addresses or null if neither of the CheckLists in this stream contain such a pair. voidaddPairChangeListener(PropertyChangeListener l)Adds l to the list of listeners registered for property changes if CandidatePairs. voidremovePairStateChangeListener(PropertyChangeListener l)Removes l from the list of listeners registered for property changes. -
-
Method Detail
-
getCheckList
CheckList getCheckList()
Returns the list of CandidatePairs to be used in checks for this stream.
-
getParentAgent
Agent getParentAgent()
Returns a reference to the Agent that this stream belongs to.
-
getRemoteUfrag
String getRemoteUfrag()
Returns the user name that we received from the remote peer or null if we haven't received a user name from them yet.
-
setRemoteUfrag
void setRemoteUfrag(String remoteUfrag)
Specifies the user name that we received from the remote peer.
- Parameters:
remoteUfrag- the user name that we received from the remote peer.
-
getRemotePassword
String getRemotePassword()
Returns the password that we received from the remote peer or null if we haven't received a password from them yet.
-
setRemotePassword
void setRemotePassword(String remotePassword)
Specifies the password that we received from the remote peer.
- Parameters:
remotePassword- the user name that we received from the remote peer.
-
getLogger
Logger getLogger()
-
build
static IceMediaStream build(Agent parentAgent, String name)
Use builder pattern to provide an immutable IceMediaStream instance.
- Parameters:
parentAgent- the agent that is handling the session that this media stream is a part ofname- the name of the media stream
-
getComponent
Component getComponent(int id)
Returns the Component with the specified id or null if no such component exists in this stream.
- Parameters:
id- the identifier of the component we are looking for.
-
getComponentCount
int getComponentCount()
Returns the number of Components currently registered with this stream.
-
getComponentIDs
List<Integer> getComponentIDs()
Returns the IDs of all Components currently registered with this stream.
-
removeComponent
void removeComponent(Component component)
Removes component and all its Candidates from the this stream and releases all associated resources that they had allocated (like sockets for example)
- Parameters:
component- the Component we'd like to remove and free.
-
findLocalCandidate
LocalCandidate findLocalCandidate(TransportAddress address, LocalCandidate base)
Returns the local LocalCandidate with the specified address if it belongs to any of this stream's components or null otherwise. If
baseis also specified, tries to find a candidate whose base matchesbase.- Parameters:
address- the TransportAddress we are looking for.base- an optional base to match.
-
findRemoteCandidate
RemoteCandidate findRemoteCandidate(TransportAddress remoteAddress)
Returns the local Candidate with the specified remoteAddress if it belongs to any of this stream's s or null if it doesn't.
- Parameters:
remoteAddress- the TransportAddress we are looking for.
-
findCandidatePair
CandidatePair findCandidatePair(TransportAddress localAddress, TransportAddress remoteAddress)
Returns the CandidatePair with the specified remote and local addresses or null if neither of the CheckLists in this stream contain such a pair.
- Parameters:
localAddress- the local TransportAddress of the pair we are looking for.remoteAddress- the remote TransportAddress of the pair we are looking for.
-
findCandidatePair
CandidatePair findCandidatePair(String localUFrag, String remoteUFrag)
Returns the CandidatePair with the specified remote and local addresses or null if neither of the CheckLists in this stream contain such a pair.
- Parameters:
localUFrag- local user fragmentremoteUFrag- remote user fragment
-
addPairChangeListener
void addPairChangeListener(PropertyChangeListener l)
Adds l to the list of listeners registered for property changes if CandidatePairs. We add such listeners in the stream, rather than having them in the candidate pair itself, because we don't want all pairs to keep lists of references to the same listeners.
- Parameters:
l- the listener to register.
-
removePairStateChangeListener
void removePairStateChangeListener(PropertyChangeListener l)
Removes l from the list of listeners registered for property changes.
- Parameters:
l- the listener to remove.
-
-
-
-