Class TransportCandidate
- java.lang.Object
-
- org.jivesoftware.smackx.jingleold.nat.TransportCandidate
-
- Direct Known Subclasses:
ICECandidate
,TransportCandidate.Fixed
public abstract class TransportCandidate extends java.lang.Object
Transport candidate. A candidate represents the possible transport for data interchange between the two endpoints.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
TransportCandidate.CandidateEcho
static class
TransportCandidate.Channel
Type-safe enum for the transportElement channel.static class
TransportCandidate.Fixed
Fixed transport candidate.static class
TransportCandidate.Protocol
Type-safe enum for the transportElement protocol.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
password
-
Constructor Summary
Constructors Constructor Description TransportCandidate()
Empty constructor.TransportCandidate(java.lang.String ip, int port)
Constructor with IP address and port.TransportCandidate(java.lang.String ip, int port, int generation)
Constructor with IP address and port.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCandidateEcho(JingleSession session)
void
addListener(TransportResolverListener.Checker li)
Add a transport resolver listener.void
check(java.util.List<TransportCandidate> localCandidates)
Check if a transport candidate is usable.boolean
equals(java.lang.Object obj)
TransportCandidate.CandidateEcho
getCandidateEcho()
XMPPConnection
getConnection()
Get the XMPPConnection use to send or receive this candidate.int
getGeneration()
Get the generation for a transportElement definition.java.lang.String
getIp()
java.util.List<TransportResolverListener.Checker>
getListenersList()
Get the list of listeners.java.lang.String
getLocalIp()
Get local IP to bind to this candidate.java.lang.String
getName()
Get the name used for identifying this transportElement method (optional).java.lang.String
getPassword()
Get the password used by ICE or relayed candidate.int
getPort()
Get the port, or 0 for any port.java.lang.String
getSessionId()
Get the jingle's sessionId that is using this candidate.TransportCandidate
getSymmetric()
Get the symmetric candidate for this candidate if it exists.boolean
isNull()
Return true if the candidate is not valid.void
removeCandidateEcho()
void
setConnection(XMPPConnection connection)
Set the XMPPConnection use to send or receive this candidate.void
setGeneration(int generation)
Set the generation for a transportElement definition.void
setIp(java.lang.String ip)
Set the IP address.void
setLocalIp(java.lang.String localIp)
Set local IP to bind to this candidate.void
setName(java.lang.String name)
Set a name for identifying this transportElement.void
setPassword(java.lang.String password)
Set the password used by ICE or relayed candidate.void
setPort(int port)
Set the port, using 0 for any port.void
setSessionId(java.lang.String sessionId)
Set the jingle's sessionId that is using this candidate.void
setSymmetric(TransportCandidate symmetric)
Set the symmetric candidate for this candidate.
-
-
-
Field Detail
-
password
protected java.lang.String password
-
-
Constructor Detail
-
TransportCandidate
public TransportCandidate()
Empty constructor.
-
TransportCandidate
public TransportCandidate(java.lang.String ip, int port)
Constructor with IP address and port.- Parameters:
ip
- The IP address.port
- The port number.
-
TransportCandidate
public TransportCandidate(java.lang.String ip, int port, int generation)
Constructor with IP address and port.- Parameters:
ip
- The IP address.port
- The port number.generation
- The generation
-
-
Method Detail
-
addCandidateEcho
public void addCandidateEcho(JingleSession session) throws java.net.SocketException, java.net.UnknownHostException
- Throws:
java.net.SocketException
java.net.UnknownHostException
-
removeCandidateEcho
public void removeCandidateEcho()
-
getCandidateEcho
public TransportCandidate.CandidateEcho getCandidateEcho()
-
getIp
public java.lang.String getIp()
-
setIp
public void setIp(java.lang.String ip)
Set the IP address.- Parameters:
ip
- the IP address
-
getLocalIp
public java.lang.String getLocalIp()
Get local IP to bind to this candidate.- Returns:
- the local IP
-
setLocalIp
public void setLocalIp(java.lang.String localIp)
Set local IP to bind to this candidate.- Parameters:
localIp
- TODO javadoc me please
-
getSymmetric
public TransportCandidate getSymmetric()
Get the symmetric candidate for this candidate if it exists.- Returns:
- the symmetric candidate
-
setSymmetric
public void setSymmetric(TransportCandidate symmetric)
Set the symmetric candidate for this candidate.- Parameters:
symmetric
- TODO javadoc me please
-
getPassword
public java.lang.String getPassword()
Get the password used by ICE or relayed candidate.- Returns:
- a password
-
setPassword
public void setPassword(java.lang.String password)
Set the password used by ICE or relayed candidate.- Parameters:
password
- a password
-
getConnection
public XMPPConnection getConnection()
Get the XMPPConnection use to send or receive this candidate.- Returns:
- the connection
-
setConnection
public void setConnection(XMPPConnection connection)
Set the XMPPConnection use to send or receive this candidate.- Parameters:
connection
- TODO javadoc me please
-
getSessionId
public java.lang.String getSessionId()
Get the jingle's sessionId that is using this candidate.- Returns:
- the session ID
-
setSessionId
public void setSessionId(java.lang.String sessionId)
Set the jingle's sessionId that is using this candidate.- Parameters:
sessionId
- TODO javadoc me please
-
isNull
public boolean isNull()
Return true if the candidate is not valid.- Returns:
- true if the candidate is null.
-
getPort
public int getPort()
Get the port, or 0 for any port.- Returns:
- the port or 0
-
setPort
public void setPort(int port)
Set the port, using 0 for any port.- Parameters:
port
- the port
-
getGeneration
public int getGeneration()
Get the generation for a transportElement definition.- Returns:
- the generation
-
setGeneration
public void setGeneration(int generation)
Set the generation for a transportElement definition.- Parameters:
generation
- the generation number
-
getName
public java.lang.String getName()
Get the name used for identifying this transportElement method (optional).- Returns:
- a name used for identifying this transportElement (ie, "myrtpvoice1")
-
setName
public void setName(java.lang.String name)
Set a name for identifying this transportElement.- Parameters:
name
- the name used for the transportElement
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
check
public void check(java.util.List<TransportCandidate> localCandidates)
Check if a transport candidate is usable. The transport resolver should check if the transport candidate the other endpoint has provided is usable. Subclasses should provide better methods if they can...- Parameters:
localCandidates
- a list of local candidates.
-
getListenersList
public java.util.List<TransportResolverListener.Checker> getListenersList()
Get the list of listeners.- Returns:
- the list of listeners
-
addListener
public void addListener(TransportResolverListener.Checker li)
Add a transport resolver listener.- Parameters:
li
- The transport resolver listener to be added.
-
-