public class UpdateOverMandatoryManager extends java.lang.Object implements RequestClient
Modifier and Type | Class and Description |
---|---|
static interface |
UpdateOverMandatoryManager.UOMDependencyFetcherCallback |
Modifier and Type | Field and Description |
---|---|
static long |
GRACE_TIME |
protected static int |
RANDOM_INSERT_BLOB
If we fetched the main jar locally, there is a 1 in RANDOM_INSERT_BLOB chance of inserting it.
|
Constructor and Description |
---|
UpdateOverMandatoryManager(NodeUpdateManager manager) |
Modifier and Type | Method and Description |
---|---|
void |
addDependency(byte[] expectedHash,
java.io.File filename) |
void |
disconnected(PeerNode pn) |
freenet.node.updater.UpdateOverMandatoryManager.UOMDependencyFetcher |
fetchDependency(byte[] expectedHash,
long size,
java.io.File saveTo,
boolean executable,
UpdateOverMandatoryManager.UOMDependencyFetcherCallback cb)
Try to fetch a dependency by hash.
|
boolean |
fetchingFromTwo() |
PeerNode[][] |
getNodesSayBlown() |
boolean |
handleAnnounce(Message m,
PeerNode source)
Handle a UOMAnnouncement message.
|
void |
handleFetchDependency(Message m,
PeerNode source) |
void |
handleRequestJar(Message m,
PeerNode source) |
boolean |
handleRequestRevocation(Message m,
PeerNode source)
A peer node requests us to send the binary blob of the revocation key.
|
boolean |
handleSendingMain(Message m,
PeerNode source) |
boolean |
handleSendingRevocation(Message m,
PeerNode source) |
protected void |
insertBlob(RandomAccessBucket bucket,
java.lang.String type,
short priority) |
boolean |
isFetchingMain() |
void |
killAlert() |
protected void |
maybeInsertMainJar(NodeUpdater mainUpdater,
PeerNode source,
int version)
Maybe insert the main jar blob.
|
protected void |
maybeNotRevoked() |
protected void |
maybeRequestMainJar() |
protected void |
peerMaybeFreeAllSlots(PeerNode fetchFrom)
A download succeeded from a peer.
|
boolean |
persistent()
Is this request persistent? **Must not change!**
|
protected void |
processMainJarBlob(java.io.File temp,
PeerNode source,
int version,
FreenetURI uri) |
boolean |
realTimeFlag()
Send the request with the real time flag enabled? Real-time requests are given
a higher priority in data transfers, but fewer of them are accepted.
|
protected boolean |
removeOldTempFiles() |
protected void |
startSomeDependencyFetchers() |
public static final long GRACE_TIME
protected static final int RANDOM_INSERT_BLOB
public UpdateOverMandatoryManager(NodeUpdateManager manager)
public boolean handleAnnounce(Message m, PeerNode source)
m
- The message to handle. Either a UOMAnnounce or a UOMAnnouncement.source
- The PeerNode which sent the message.protected void maybeRequestMainJar()
public PeerNode[][] getNodesSayBlown()
public boolean handleRequestRevocation(Message m, PeerNode source)
m
- The message requesting the transfer.source
- The node requesting the transfer.protected void maybeNotRevoked()
protected void insertBlob(RandomAccessBucket bucket, java.lang.String type, short priority)
public void killAlert()
protected void processMainJarBlob(java.io.File temp, PeerNode source, int version, FreenetURI uri)
protected void maybeInsertMainJar(NodeUpdater mainUpdater, PeerNode source, int version)
protected boolean removeOldTempFiles()
public boolean persistent()
RequestClient
persistent
in interface RequestClient
public void disconnected(PeerNode pn)
public boolean fetchingFromTwo()
public boolean realTimeFlag()
RequestClient
realTimeFlag
in interface RequestClient
public boolean isFetchingMain()
public void addDependency(byte[] expectedHash, java.io.File filename)
public freenet.node.updater.UpdateOverMandatoryManager.UOMDependencyFetcher fetchDependency(byte[] expectedHash, long size, java.io.File saveTo, boolean executable, UpdateOverMandatoryManager.UOMDependencyFetcherCallback cb)
expectedHash
- The hash of the expected file. Will be checked.size
- The length of the expected file.saveTo
- The file will be overwritten only if the download is
successful and the hash is correct.uomDependencyFetchCallback
- Callback to call when done.protected void startSomeDependencyFetchers()
protected void peerMaybeFreeAllSlots(PeerNode fetchFrom)