public class TrackerStorage extends Object implements PeerStatusListener, Digest
| Modifier and Type | Class and Description |
|---|---|
static class |
TrackerStorage.ReferrerType |
PeerStatusListener.Reason| Modifier and Type | Field and Description |
|---|---|
static int |
TRACKER_SIZE |
| Constructor and Description |
|---|
TrackerStorage(IdentityManagement identityManagement,
int trackerTimoutSeconds,
Replication replication,
Maintenance maintenance) |
| Modifier and Type | Method and Description |
|---|---|
Map<Number160,TrackerData> |
activePeers(Number160 locationKey,
Number160 domainKey) |
void |
addActive(Number160 locationKey,
Number160 domainKey,
PeerAddress remotePeer,
byte[] attachement,
int offset,
int length) |
DigestInfo |
digest(Number320 key) |
DigestInfo |
digest(Number320 key,
Collection<Number160> contentKeys) |
int |
getPrimanyFactor() |
int |
getSecondaryFactor() |
int |
getTrackerTimoutSeconds() |
boolean |
isFillPrimaryStorageFast() |
boolean |
isSecondaryTracker(Number160 locationKey,
Number160 domainKey)
A peer is a secondary tracker if the peers stores itself on the tracker
as well.
|
Map<Number160,TrackerData> |
meshPeers(Number160 locationKey,
Number160 domainKey) |
boolean |
moveFromSecondaryToMesh(PeerAddress peerAddress,
PeerAddress referrer,
Number160 locationKey,
Number160 domainKey,
PublicKey publicKey) |
void |
peerFail(PeerAddress peerAddress)
Called if the peer does not send answer in time.
|
void |
peerOffline(PeerAddress peerAddress,
PeerStatusListener.Reason reason)
Called if the peer does not send multiple answer in time.
|
void |
peerOnline(PeerAddress peerAddress)
Called if the peer is online and we verified it.
|
boolean |
put(Number160 locationKey,
Number160 domainKey,
PeerAddress peerAddress,
PublicKey publicKey,
byte[] attachement) |
boolean |
put(Number160 locationKey,
Number160 domainKey,
PeerAddress peerAddress,
PublicKey publicKey,
byte[] attachement,
int offset,
int length) |
boolean |
putReferred(Number160 locationKey,
Number160 domainKey,
PeerAddress peerAddress,
PeerAddress referrer,
byte[] attachement,
int offset,
int length,
TrackerStorage.ReferrerType type) |
boolean |
removeActive(Number160 locationKey,
Number160 domainKey,
Number160 remotePeerId) |
void |
removeReferred(Number160 locationKey,
Number160 domainKey,
Number160 key,
PeerAddress referrer) |
Collection<Number160> |
responsibleDomains(Number160 locationKey) |
Map<Number160,TrackerData> |
secondaryPeers(Number160 locationKey,
Number160 domainKey) |
void |
setFillPrimaryStorageFast(boolean fillPrimaryStorageFast) |
void |
setPrimanyFactor(int primanyFactor) |
void |
setSecondaryFactor(int secondaryFactor) |
int |
sizePrimary(Number160 locationKey,
Number160 domainKey) |
int |
sizeSecondary(Number160 locationKey,
Number160 domainKey) |
public static final int TRACKER_SIZE
public TrackerStorage(IdentityManagement identityManagement, int trackerTimoutSeconds, Replication replication, Maintenance maintenance)
public Map<Number160,TrackerData> activePeers(Number160 locationKey, Number160 domainKey)
public Map<Number160,TrackerData> meshPeers(Number160 locationKey, Number160 domainKey)
public Map<Number160,TrackerData> secondaryPeers(Number160 locationKey, Number160 domainKey)
public void addActive(Number160 locationKey, Number160 domainKey, PeerAddress remotePeer, byte[] attachement, int offset, int length)
public boolean removeActive(Number160 locationKey, Number160 domainKey, Number160 remotePeerId)
public boolean put(Number160 locationKey, Number160 domainKey, PeerAddress peerAddress, PublicKey publicKey, byte[] attachement)
public boolean put(Number160 locationKey, Number160 domainKey, PeerAddress peerAddress, PublicKey publicKey, byte[] attachement, int offset, int length)
public boolean putReferred(Number160 locationKey, Number160 domainKey, PeerAddress peerAddress, PeerAddress referrer, byte[] attachement, int offset, int length, TrackerStorage.ReferrerType type)
public boolean moveFromSecondaryToMesh(PeerAddress peerAddress, PeerAddress referrer, Number160 locationKey, Number160 domainKey, PublicKey publicKey)
public void setSecondaryFactor(int secondaryFactor)
public int getSecondaryFactor()
public void setPrimanyFactor(int primanyFactor)
public int getPrimanyFactor()
public void peerOffline(PeerAddress peerAddress, PeerStatusListener.Reason reason)
PeerStatusListenerpeerOffline in interface PeerStatusListenerpeerAddress - The address of the peer that went offlinepublic void peerFail(PeerAddress peerAddress)
PeerStatusListenerpeerFail in interface PeerStatusListenerpeerAddress - The address of the peer that failedpublic void peerOnline(PeerAddress peerAddress)
PeerStatusListenerpeerOnline in interface PeerStatusListenerpeerAddress - The address of the peer that is online.public DigestInfo digest(Number320 key)
public DigestInfo digest(Number320 key, Collection<Number160> contentKeys)
public void removeReferred(Number160 locationKey, Number160 domainKey, Number160 key, PeerAddress referrer)
public void setFillPrimaryStorageFast(boolean fillPrimaryStorageFast)
public boolean isFillPrimaryStorageFast()
public int getTrackerTimoutSeconds()
public boolean isSecondaryTracker(Number160 locationKey, Number160 domainKey)
locationKey - domainKey - public Collection<Number160> responsibleDomains(Number160 locationKey)
Copyright © 2011. All Rights Reserved.