public abstract class LocalCandidate extends Candidate<LocalCandidate>
Modifier and Type | Field and Description |
---|---|
private static Logger |
classLogger
The Logger used by the LocalCandidate class for logging
output.
|
private CandidateExtendedType |
extendedType
The type of method used to discover this candidate ("host", "upnp", "stun
peer reflexive", "stun server reflexive", "turn relayed", "google turn
relayed", "google tcp turn relayed" or "jingle node").
|
private boolean |
isSSL
Whether this LocalCandidate uses SSL.
|
private Logger |
logger
The
Logger used by LocalCandidate instances. |
private String |
ufrag
Ufrag for the local candidate.
|
MAX_LOCAL_PREFERENCE, MAX_TYPE_PREFERENCE, MIN_LOCAL_PREFERENCE, MIN_TYPE_PREFERENCE, priority
Constructor and Description |
---|
LocalCandidate(TransportAddress transportAddress,
Component parentComponent,
CandidateType type,
CandidateExtendedType extendedType,
LocalCandidate relatedCandidate)
Creates a LocalCandidate instance for the specified transport
address and properties.
|
Modifier and Type | Method and Description |
---|---|
protected StunDatagramPacketFilter |
createStunDatagramPacketFilter(TransportAddress serverAddress)
Creates a new StunDatagramPacketFilter which is to capture STUN
messages and make them available to the DatagramSocket returned
by
getStunSocket(TransportAddress) . |
protected LocalCandidate |
findRelatedCandidate(TransportAddress relatedAddress)
Find the candidate corresponding to the address given in parameter.
|
protected void |
free()
Frees resources allocated by this candidate such as its
DatagramSocket, for example.
|
protected abstract IceSocketWrapper |
getCandidateIceSocketWrapper() |
protected IceSocketWrapper |
getCandidateIceSocketWrapper(SocketAddress remoteAddress) |
DatagramSocket |
getDatagramSocket()
Deprecated.
This should be used by the library only. Users of ice4j
should use
Component.getSocket() instead. |
CandidateExtendedType |
getExtendedType()
Returns the type of method used to discover this candidate ("host",
"upnp", "stun peer reflexive", "stun server reflexive", "turn relayed",
"google turn relayed", "google tcp turn relayed" or "jingle node").
|
protected IceSocketWrapper |
getIceSocketWrapper() |
Socket |
getSocket()
Deprecated.
This should be used by the library only. Users of ice4j
should use
Component.getSocket() instead. |
IceSocketWrapper |
getStunSocket(TransportAddress serverAddress)
Creates if necessary and returns a DatagramSocket that would
capture all STUN packets arriving on this candidate's socket.
|
StunStack |
getStunStack()
Gets the StunStack associated with this Candidate.
|
String |
getUfrag()
Get the local ufrag.
|
boolean |
isDefault()
Determines whether this Candidate is the default one for its
parent component.
|
boolean |
isSSL()
Gets the value of the 'ssl' flag.
|
void |
setExtendedType(CandidateExtendedType extendedType)
Sets the type of method used to discover this candidate ("host", "upnp",
"stun peer reflexive", "stun server reflexive", "turn relayed", "google
turn relayed", "google tcp turn relayed" or "jingle node").
|
void |
setSSL(boolean isSSL)
Sets the value of the 'ssl' flag.
|
void |
setUfrag(String ufrag)
Set the local ufrag.
|
canReach, compareTo, computeGTalkPriority, computeGTalkPriorityForType, computePriority, computePriorityForType, equals, getBase, getDefaultPreference, getFoundation, getHostAddress, getMappedAddress, getParentComponent, getPriority, getReflexiveAddress, getRelatedAddress, getRelatedCandidate, getRelayedAddress, getRelayServerAddress, getStunServerAddress, getTcpType, getTransport, getTransportAddress, getType, hashCode, isVirtual, setBase, setCandidateType, setFoundation, setMappedAddress, setRelayServerAddress, setStunServerAddress, setTcpType, setVirtual, toShortString, toString
private static final Logger classLogger
DefaultNominator
, because it doesn't take into account the
per-instance log level. Instances should use logger
instead.private CandidateExtendedType extendedType
private String ufrag
private boolean isSSL
private Logger logger
Logger
used by LocalCandidate
instances.public LocalCandidate(TransportAddress transportAddress, Component parentComponent, CandidateType type, CandidateExtendedType extendedType, LocalCandidate relatedCandidate)
transportAddress
- the transport address that this candidate is
encapsulating.parentComponent
- the Component that this candidate
belongs to.type
- the CandidateType for this Candidate.extendedType
- The type of method used to discover this candidate
("host", "upnp", "stun peer reflexive", "stun server reflexive", "turn
relayed", "google turn relayed", "google tcp turn relayed" or "jingle
node").relatedCandidate
- the relatedCandidate: null for a host candidate,
the base address (host candidate) for a reflexive candidate, the mapped
address (the mapped address of the TURN allocate response) for a relayed
candidate.@Deprecated public DatagramSocket getDatagramSocket()
Component.getSocket()
instead.@Deprecated public Socket getSocket()
Component.getSocket()
instead.protected IceSocketWrapper getIceSocketWrapper()
IceSocketWrapper
instance of the Component
which owns this LocalCandidate
. Note that this IS NOT an
instance specific to this LocalCandidate
. See
getCandidateIceSocketWrapper()
.protected abstract IceSocketWrapper getCandidateIceSocketWrapper()
IceSocketWrapper
instance, if any, associated with
this candidate. Note that this IS NOT the instance which should be used
for reading and writing by the application, and SHOULD NOT be used from
outside ice4j (even if a subclass exposes it as public). Also see
getIceSocketWrapper()
.protected IceSocketWrapper getCandidateIceSocketWrapper(SocketAddress remoteAddress)
remoteAddress
- the remote address for which to return an
associated socket.IceSocketWrapper
instance for this candidate,
associated with a particular remote address.public IceSocketWrapper getStunSocket(TransportAddress serverAddress)
serverAddress
- the address of the source we'd like to receive
packets from or null if we'd like to intercept all STUN packets.public StunStack getStunStack()
protected StunDatagramPacketFilter createStunDatagramPacketFilter(TransportAddress serverAddress)
getStunSocket(TransportAddress)
.serverAddress
- the address of the source we'd like to receive
packets from or null if we'd like to intercept all STUN packetsgetStunSocket(TransportAddress)
protected void free()
public boolean isDefault()
isDefault
in class Candidate<LocalCandidate>
public void setUfrag(String ufrag)
ufrag
- local ufragpublic String getUfrag()
getUfrag
in class Candidate<LocalCandidate>
public CandidateExtendedType getExtendedType()
public void setExtendedType(CandidateExtendedType extendedType)
extendedType
- The type of method used to discover this candidate
("host", "upnp", "stun peer reflexive", "stun server reflexive", "turn
relayed", "google turn relayed", "google tcp turn relayed" or "jingle
node").protected LocalCandidate findRelatedCandidate(TransportAddress relatedAddress)
findRelatedCandidate
in class Candidate<LocalCandidate>
relatedAddress
- The related address:
- null for a host candidate,
- the base address (host candidate) for a reflexive candidate,
- the mapped address (the mapped address of the TURN allocate response)
for a relayed candidate.
- null for a peer reflexive candidate : there is no way to know the
related address.public boolean isSSL()
public void setSSL(boolean isSSL)
isSSL
- the value to set.Copyright © 2018. All rights reserved.