| Constructor and Description |
|---|
PeerMapKadImpl(Number160 self,
int bagSize,
int cacheSize,
int cacheTimeout,
int maxFail,
int[] maintenanceTimeoutsSeconds)
Deprecated.
|
PeerMapKadImpl(Number160 self,
P2PConfiguration configuration)
Creates the bag for the peers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAddressFilter(InetAddress address) |
void |
addPeerMapChangeListener(PeerMapChangeListener peerMapChangeListener) |
void |
addPeerOfflineListener(PeerStatusListener peerListener) |
SortedSet<PeerAddress> |
closePeers(Number160 id,
int atLeast)
Returns close peer from the set to a given key.
|
boolean |
contains(PeerAddress peerAddress) |
Comparator<PeerAddress> |
createPeerComparator() |
Comparator<PeerAddress> |
createPeerComparator(Number160 id)
Creates a comparator that orders to peers according to their distance to
the specified id.
|
Collection<PeerAddress> |
getAll()
Return all addresses from the neighbor list.
|
Statistics |
getStatistics() |
int |
isCloser(Number160 id,
Number160 rn,
Number160 rn2)
Returns -1 if the first key is closer to the key, if the second is
closer, then 1 is returned.
|
int |
isCloser(Number160 id,
PeerAddress rn,
PeerAddress rn2)
Returns -1 if the first remote node is closer to the key, if the second
is closer, then 1 is returned.
|
boolean |
isPeerRemovedTemporarly(PeerAddress remoteNode)
Checks if this peer has been removed.
|
boolean |
peerFound(PeerAddress remotePeer,
PeerAddress referrer)
Adds a neighbor to the neighbor list.
|
boolean |
peerOffline(PeerAddress remotePeer,
boolean force)
Remove a peer from the list.
|
Collection<PeerAddress> |
peersForMaintenance() |
void |
removePeerMapChangeListener(PeerMapChangeListener peerMapChangeListener) |
void |
removePeerOfflineListener(PeerStatusListener peerListener) |
Number160 |
self()
Each node that has a bag has an ID itself to define what is close.
|
int |
size()
The peerCount keeps track of the total number of peer in the system.
|
String |
toString() |
void |
updateExistingPeerAddress(PeerAddress peerAddress) |
public PeerMapKadImpl(Number160 self, P2PConfiguration configuration)
self - The peer ID of this peerconfiguration - Configuration settings for this map@Deprecated public PeerMapKadImpl(Number160 self, int bagSize, int cacheSize, int cacheTimeout, int maxFail, int[] maintenanceTimeoutsSeconds)
PeerMapKadImpl(Number160, P2PConfiguration)public void addPeerMapChangeListener(PeerMapChangeListener peerMapChangeListener)
addPeerMapChangeListener in interface PeerMappublic void removePeerMapChangeListener(PeerMapChangeListener peerMapChangeListener)
removePeerMapChangeListener in interface PeerMappublic void addPeerOfflineListener(PeerStatusListener peerListener)
addPeerOfflineListener in interface PeerMappublic void removePeerOfflineListener(PeerStatusListener peerListener)
removePeerOfflineListener in interface PeerMappublic Statistics getStatistics()
getStatistics in interface PeerMappublic int size()
public Number160 self()
PeerMappublic boolean peerFound(PeerAddress remotePeer, PeerAddress referrer)
PeerMappublic boolean peerOffline(PeerAddress remotePeer, boolean force)
PeerMappeerOffline in interface PeerMapremotePeer - The node that should be removedpublic Collection<PeerAddress> peersForMaintenance()
peersForMaintenance in interface PeerMappublic boolean isPeerRemovedTemporarly(PeerAddress remoteNode)
PeerMapisPeerRemovedTemporarly in interface PeerMapremoteNode - The node to checkpublic void updateExistingPeerAddress(PeerAddress peerAddress)
public boolean contains(PeerAddress peerAddress)
public SortedSet<PeerAddress> closePeers(Number160 id, int atLeast)
PeerMapclosePeers in interface PeerMapid - The key that should be close to the keys in the mapatLeast - The number we want to find at leastpublic int isCloser(Number160 id, PeerAddress rn, PeerAddress rn2)
PeerMapisCloser in interface PeerMapid - The key to search forrn - The remote node on the routing path to node close to
keyrn2 - An other remote node on the routing path to node
close to keypublic int isCloser(Number160 id, Number160 rn, Number160 rn2)
PeerMappublic Comparator<PeerAddress> createPeerComparator(Number160 id)
PeerMapcreatePeerComparator in interface PeerMapid - The id that defines the metricpublic Comparator<PeerAddress> createPeerComparator()
createPeerComparator in interface PeerMappublic Collection<PeerAddress> getAll()
PeerMappublic void addAddressFilter(InetAddress address)
addAddressFilter in interface PeerMapCopyright © 2011. All Rights Reserved.