public class GoogleTurnCandidateHarvest extends StunCandidateHarvest
Modifier and Type | Field and Description |
---|---|
private static Logger |
logger
The Logger used by the TurnCandidateHarvest class and
its instances for logging output.
|
private String |
password
The gingle candidates password necessary to use the TURN server.
|
private Request |
requestToStartResolvingCandidate
The Request created by the last call to
createRequestToStartResolvingCandidate() . |
harvester, hostCandidate, SEND_KEEP_ALIVE_MESSAGE_INTERVAL_NOT_SPECIFIED
Constructor and Description |
---|
GoogleTurnCandidateHarvest(GoogleTurnCandidateHarvester harvester,
HostCandidate hostCandidate,
String password)
Initializes a new TurnCandidateHarvest which is to represent the
harvesting of TURN Candidates for a specific
HostCandidate performed by a specific
TurnCandidateHarvester.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addShortTermCredentialAttributes(Request request)
Adds the Attributes to a specific Request which support
the STUN short-term credential mechanism if the mechanism in question is
utilized by this StunCandidateHarvest (i.e.
|
void |
close(GoogleRelayedCandidateDatagramSocket relayedCandidateSocket)
Notifies this TurnCandidateHarvest that a specific
RelayedCandidateDatagramSocket is closing and that this instance
is to delete the associated TURN Allocation.
|
protected boolean |
completedResolvingCandidate(Request request,
Response response)
Completes the harvesting of Candidates for
StunCandidateHarvest.hostCandidate . |
protected void |
createCandidates(Response response)
Creates new Candidates determined by a specific STUN
Response.
|
private void |
createRelayedCandidate(Response response)
Creates a RelayedCandidate using the
XOR-RELAYED-ADDRESS attribute in a specific STUN
Response for the actual TransportAddress of the new
candidate.
|
protected GoogleRelayedCandidate |
createRelayedCandidate(TransportAddress transportAddress,
TransportAddress mappedAddress)
Creates a new RelayedCandidate instance which is to represent a
specific TransportAddress harvested through
StunCandidateHarvest.hostCandidate and the TURN server associated with
StunCandidateHarvest.harvester . |
protected Request |
createRequestToStartResolvingCandidate()
Creates a new Request which is to be sent to
StunCandidateHarvester.stunServer in order to start resolving
StunCandidateHarvest.hostCandidate . |
protected boolean |
processErrorOrFailure(Response response,
Request request,
TransactionID transactionID)
Notifies this StunCandidateHarvest that a specific
Request has either received an error Response or has
failed to receive any Response.
|
protected void |
processSuccess(Response response,
Request request,
TransactionID transactionID)
Handles a specific STUN success Response to a specific STUN
Request.
|
addCandidate, close, containsCandidate, createKeepAliveMessage, createRequestToRetry, createServerReflexiveCandidate, createServerReflexiveCandidate, getCandidateCount, getCandidates, getMappedAddress, processFailure, processResponse, sendKeepAliveMessage, sendKeepAliveMessage, sendRequest, setSendKeepAliveMessageInterval, startResolvingCandidate
processTimeout, processUnreachable
private static final Logger logger
private Request requestToStartResolvingCandidate
createRequestToStartResolvingCandidate()
.private String password
public GoogleTurnCandidateHarvest(GoogleTurnCandidateHarvester harvester, HostCandidate hostCandidate, String password)
harvester
- the TurnCandidateHarvester which is performing
the TURN harvestinghostCandidate
- the HostCandidate for which TURN
Candidates are to be harvestedpassword
- The gingle candidates password necessary to use this TURN
server.protected void createCandidates(Response response)
createCandidates
in class StunCandidateHarvest
response
- the received STUN ResponseStunCandidateHarvest.createCandidates(Response)
private void createRelayedCandidate(Response response)
response
- the STUN Response which is supposed to contain
the address we should use for the new candidateprotected GoogleRelayedCandidate createRelayedCandidate(TransportAddress transportAddress, TransportAddress mappedAddress)
StunCandidateHarvest.hostCandidate
and the TURN server associated with
StunCandidateHarvest.harvester
.transportAddress
- the TransportAddress to be represented
by the new RelayedCandidate instancemappedAddress
- the mapped TransportAddress reported by the
TURN server with the delivery of the relayed transportAddress to
be represented by the new RelayedCandidate instanceStunCandidateHarvest.hostCandidate
and the TURN server associated with
StunCandidateHarvest.harvester
protected Request createRequestToStartResolvingCandidate()
StunCandidateHarvester.stunServer
in order to start resolving
StunCandidateHarvest.hostCandidate
.createRequestToStartResolvingCandidate
in class StunCandidateHarvest
StunCandidateHarvester.stunServer
in order to start resolving
StunCandidateHarvest.hostCandidate
StunCandidateHarvest.createRequestToStartResolvingCandidate()
protected boolean addShortTermCredentialAttributes(Request request)
addShortTermCredentialAttributes
in class StunCandidateHarvest
request
- the Request to which to add the
Attributes supporting the STUN short-term credential mechanism
if the mechanism in question is utilized by this
StunCandidateHarvestprotected boolean completedResolvingCandidate(Request request, Response response)
StunCandidateHarvest.hostCandidate
. Notifies StunCandidateHarvest.harvester
about the completion
of the harvesting of Candidate for hostCandidate
performed by this StunCandidateHarvest.completedResolvingCandidate
in class StunCandidateHarvest
request
- the Request sent by this
StunCandidateHarvest with which the harvesting of
Candidates for hostCandidate has completedresponse
- the Response received by this
StunCandidateHarvest, if any, with which the harvesting of
Candidates for hostCandidate has completedStunCandidateHarvest.completedResolvingCandidate(Request, Response)
public void close(GoogleRelayedCandidateDatagramSocket relayedCandidateSocket)
Note: The method is part of the internal API of RelayedCandidateDatagramSocket and TurnCandidateHarvest and is not intended for public use.
relayedCandidateSocket
- the RelayedCandidateDatagramSocket
which notifies this instance and which requests that the associated TURN
Allocation be deletedprotected boolean processErrorOrFailure(Response response, Request request, TransactionID transactionID)
processErrorOrFailure
in class StunCandidateHarvest
response
- the error Response which has been received for
requestrequest
- the Request to which Response respondstransactionID
- the TransactionID of response and
request because response and request only have
it as a byte array and TransactionID is required for
the applicationData property valueStunCandidateHarvest.processErrorOrFailure(Response, Request,
TransactionID)
protected void processSuccess(Response response, Request request, TransactionID transactionID)
processSuccess
in class StunCandidateHarvest
response
- the received STUN success Response which is to
be handledrequest
- the STUN Request to which response
respondstransactionID
- the TransactionID of response and
request because response and request only have
it as a byte array and TransactionID is required for
the applicationData property valueStunCandidateHarvest.processSuccess(Response, Request,
TransactionID)
Copyright © 2018. All rights reserved.