public class FoundationsRegistry extends Object
Modifier and Type | Field and Description |
---|---|
private Map<String,String> |
foundations
Contains mappings between a type+baseIP+server+transport
Strings and the foundation that has been assigned to them.
|
private int |
lastAssignedFoundation
The foundation number that was last assigned to a Candidate
|
private int |
lastAssignedRemoteFoundation
The foundation number that was last assigned to a PEER-REFLEXIVE
RemoteCandidate
|
Constructor and Description |
---|
FoundationsRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
assignFoundation(Candidate<?> candidate)
Assigns to candidate the foundation that corresponds to its
base, type and transport properties or a new one if no foundation has
been generated yet for the specific combination.
|
String |
obtainFoundationForPeerReflexiveCandidate()
Returns an (as far as you care) random foundation that could be assigned
to a learned PEER-REFLEXIVE candidate.
|
int |
size()
Returns the number of foundation Strings that are currently
tracked by the registry.
|
private int lastAssignedFoundation
private int lastAssignedRemoteFoundation
public void assignFoundation(Candidate<?> candidate)
candidate
- the Candidate that we'd like to assign a
foundation to.public String obtainFoundationForPeerReflexiveCandidate()
public int size()
Copyright © 2018. All rights reserved.