public abstract class NodeUpdater extends java.lang.Object implements ClientGetCallback, USKCallback, RequestClient
Modifier and Type | Field and Description |
---|---|
NodeClientCore |
core |
protected int |
fetchedVersion |
NodeUpdateManager |
manager |
protected Node |
node |
protected java.io.File |
tempBlobFile |
Modifier and Type | Method and Description |
---|---|
boolean |
canUpdateNow() |
int |
fetchingVersion() |
java.io.File |
getBlobFile() |
long |
getBlobSize() |
int |
getFetchedVersion() |
short |
getPollingPriorityNormal()
Priority at which the polling should run normally.
|
short |
getPollingPriorityProgress()
Priority at which the polling should run when starting, or immediately after making some progress.
|
RequestClient |
getRequestClient()
Get the RequestClient context object used to indicate which requests are related to each
other for scheduling purposes.
|
FreenetURI |
getUpdateKey() |
boolean |
isFetching() |
abstract java.lang.String |
jarName() |
protected abstract void |
maybeParseManifest(FetchResult result,
int build)
Called with locks held
|
protected void |
maybeProcessOldBlob() |
void |
maybeUpdate() |
void |
onChangeURI(FreenetURI uri)
Called when the fetch URI has changed.
|
void |
onFailure(FetchException e,
ClientGetter state)
Called on failed/canceled fetch.
|
void |
onFoundEdition(long l,
USK key,
ClientContext context,
boolean wasMetadata,
short codec,
byte[] data,
boolean newKnownGood,
boolean newSlotToo)
Found the latest edition.
|
void |
onResume(ClientContext context)
Called for a persistent request when the node is restarted.
|
protected abstract void |
onStartFetching() |
void |
onSuccess(FetchResult result,
ClientGetter state)
Called on successful fetch.
|
protected void |
parseDependencies(FetchResult result,
int build) |
protected void |
parseDependencies(java.util.Properties props,
int build)
Override if you want to deal with the file dependencies.properties
|
protected void |
parseManifest(FetchResult result) |
protected void |
parseManifestLine(java.lang.String line) |
boolean |
persistent()
Is this request persistent? **Must not change!**
|
void |
preKill()
Called before kill().
|
protected abstract void |
processSuccess(int fetched,
FetchResult result,
java.io.File blobFile)
We have fetched the jar! Do something after onSuccess().
|
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.
|
void |
setMinMax(int requiredExt,
int recommendedExt)
Called by NodeUpdateManager to re-set the min/max versions for ext when
a new freenet.jar has been downloaded.
|
public final NodeClientCore core
protected final Node node
public final NodeUpdateManager manager
protected int fetchedVersion
protected java.io.File tempBlobFile
public abstract java.lang.String jarName()
protected void maybeProcessOldBlob()
public RequestClient getRequestClient()
ClientBaseCallback
getRequestClient
in interface ClientBaseCallback
public void onFoundEdition(long l, USK key, ClientContext context, boolean wasMetadata, short codec, byte[] data, boolean newKnownGood, boolean newSlotToo)
USKCallback
onFoundEdition
in interface USKCallback
l
- The edition number.key
- A copy of the key with new edition setnewKnownGood
- If the highest known good edition (which has actually been
fetched with what it pointed to) has increased. Otherwise, the highest known
SSK slot has been increased, from which searches will start, but we do not
know whether it can actually be fetched successfully.newSlotToo
- If newKnownGood is set, this indicates whether it is also a
new highest known SSK slot. If newKnownGood is not set, there is always a new
highest known SSK slot.protected abstract void onStartFetching()
public void maybeUpdate()
public void onSuccess(FetchResult result, ClientGetter state)
ClientGetCallback
onSuccess
in interface ClientGetCallback
protected abstract void processSuccess(int fetched, FetchResult result, java.io.File blobFile)
protected abstract void maybeParseManifest(FetchResult result, int build)
result
- protected void parseManifest(FetchResult result)
protected void parseDependencies(FetchResult result, int build)
protected void parseDependencies(java.util.Properties props, int build)
protected void parseManifestLine(java.lang.String line)
public void onFailure(FetchException e, ClientGetter state)
ClientGetCallback
onFailure
in interface ClientGetCallback
public void preKill()
public FreenetURI getUpdateKey()
public boolean canUpdateNow()
public void onChangeURI(FreenetURI uri)
uri
- The new URI.public int getFetchedVersion()
public boolean isFetching()
public int fetchingVersion()
public long getBlobSize()
public java.io.File getBlobFile()
public short getPollingPriorityNormal()
USKCallback
getPollingPriorityNormal
in interface USKCallback
public short getPollingPriorityProgress()
USKCallback
getPollingPriorityProgress
in interface USKCallback
public boolean persistent()
RequestClient
persistent
in interface RequestClient
public void setMinMax(int requiredExt, int recommendedExt)
public boolean realTimeFlag()
RequestClient
realTimeFlag
in interface RequestClient
public void onResume(ClientContext context)
ClientBaseCallback
onResume
in interface ClientBaseCallback