public class USKManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
USKManager.HintCallback |
Constructor and Description |
---|
USKManager(NodeClientCore core) |
Modifier and Type | Method and Description |
---|---|
void |
checkUSK(FreenetURI uri,
boolean persistent,
boolean isMetadata) |
int |
getBackgroundFetcherByUSKSize()
The result of that method will be displayed on the Statistic Toadlet : it will help catching #1147
Afterwards it should be removed: it's not usefull :)
|
freenet.client.async.USKFetcherTag |
getFetcher(USK usk,
FetchContext ctx,
boolean keepLast,
boolean persistent,
boolean realTime,
USKFetcherCallback callback,
boolean ownFetchContext,
ClientContext context,
boolean checkStoreOnly) |
freenet.client.async.USKFetcherTag |
getFetcherForInsertDontSchedule(USK usk,
short prioClass,
USKFetcherCallback cb,
RequestClient client,
ClientContext context,
boolean persistent,
boolean ignoreUSKDatehints) |
int |
getTemporaryBackgroundFetchersLRU()
The result of that method will be displayed on the Statistic Toadlet : it will help catching #1147
Afterwards it should be removed: it's not usefull :)
|
void |
hintCheck(FreenetURI uri,
java.lang.Object token,
ClientContext context,
short priority,
USKManager.HintCallback cb)
Simply check whether the block exists, in such a way that we don't fetch
the full content.
|
void |
hintUpdate(FreenetURI uri,
ClientContext context) |
void |
hintUpdate(FreenetURI uri,
ClientContext context,
short priority)
A non-authoritative hint that a specific edition *might* exist.
|
void |
hintUpdate(USK usk,
long edition,
ClientContext context)
A non-authoritative hint that a specific edition *might* exist.
|
void |
init(ClientContext context) |
long |
lookupKnownGood(USK usk)
Look up the latest known working version of the given USK.
|
long |
lookupLatestSlot(USK usk)
Look up the latest SSK slot, whether the data it links to has been successfully
fetched or not, of the given USK.
|
void |
onFinished(USKFetcher fetcher) |
void |
onFinished(USKFetcher fetcher,
boolean ignoreError) |
boolean |
persistent() |
void |
startTemporaryBackgroundFetcher(USK usk,
ClientContext context,
FetchContext fctx,
boolean prefetchContent,
boolean realTimeFlag) |
void |
subscribe(USK origUSK,
USKCallback cb,
boolean runBackgroundFetch,
boolean ignoreUSKDatehints,
RequestClient client)
Subscribe to a given USK.
|
void |
subscribe(USK origUSK,
USKCallback cb,
boolean runBackgroundFetch,
RequestClient client) |
USKRetriever |
subscribeContent(USK origUSK,
USKRetrieverCallback cb,
boolean runBackgroundFetch,
FetchContext fctx,
short prio,
RequestClient client)
Subscribe to a USK.
|
USKRetriever |
subscribeContentCustom(USK origUSK,
USKRetrieverCallback cb,
FetchContext fctx,
short prio,
RequestClient client)
Subscribe to a USK with a custom FetchContext.
|
USKSparseProxyCallback |
subscribeSparse(USK origUSK,
USKCallback cb,
boolean ignoreUSKDatehints,
RequestClient client)
Subscribe to a given USK, and poll it in the background, but only
report new editions when we've been through a round and are confident
that we won't find more in the near future.
|
USKSparseProxyCallback |
subscribeSparse(USK origUSK,
USKCallback cb,
RequestClient client) |
void |
unsubscribe(USK origUSK,
USKCallback cb) |
void |
unsubscribeContent(USK origUSK,
USKRetriever ret,
boolean runBackgroundFetch) |
public USKManager(NodeClientCore core)
public void init(ClientContext context)
public long lookupKnownGood(USK usk)
public long lookupLatestSlot(USK usk)
public freenet.client.async.USKFetcherTag getFetcher(USK usk, FetchContext ctx, boolean keepLast, boolean persistent, boolean realTime, USKFetcherCallback callback, boolean ownFetchContext, ClientContext context, boolean checkStoreOnly)
public freenet.client.async.USKFetcherTag getFetcherForInsertDontSchedule(USK usk, short prioClass, USKFetcherCallback cb, RequestClient client, ClientContext context, boolean persistent, boolean ignoreUSKDatehints)
public void hintUpdate(USK usk, long edition, ClientContext context)
usk
- edition
- context
- public void hintUpdate(FreenetURI uri, ClientContext context) throws java.net.MalformedURLException
java.net.MalformedURLException
public void hintUpdate(FreenetURI uri, ClientContext context, short priority) throws java.net.MalformedURLException
context
- java.net.MalformedURLException
- If the uri passed in is not a USK.public void hintCheck(FreenetURI uri, java.lang.Object token, ClientContext context, short priority, USKManager.HintCallback cb) throws java.net.MalformedURLException
java.net.MalformedURLException
public void startTemporaryBackgroundFetcher(USK usk, ClientContext context, FetchContext fctx, boolean prefetchContent, boolean realTimeFlag)
public USKSparseProxyCallback subscribeSparse(USK origUSK, USKCallback cb, boolean ignoreUSKDatehints, RequestClient client)
public USKSparseProxyCallback subscribeSparse(USK origUSK, USKCallback cb, RequestClient client)
public void subscribe(USK origUSK, USKCallback cb, boolean runBackgroundFetch, boolean ignoreUSKDatehints, RequestClient client)
public void subscribe(USK origUSK, USKCallback cb, boolean runBackgroundFetch, RequestClient client)
public void unsubscribe(USK origUSK, USKCallback cb)
public USKRetriever subscribeContent(USK origUSK, USKRetrieverCallback cb, boolean runBackgroundFetch, FetchContext fctx, short prio, RequestClient client)
origUSK
- The USK to poll.cb
- Callback, called when we have downloaded a new key.runBackgroundFetch
- If true, start a background fetcher for the key, which will run
forever until we unsubscribe. Note that internally we use subscribeSparse() in this case,
i.e. we will only download editions which we are confident about.fctx
- Fetcher context for actually fetching the keys. Not used by the USK polling.prio
- Priority for fetching the content (see constants in RequestScheduler).public USKRetriever subscribeContentCustom(USK origUSK, USKRetrieverCallback cb, FetchContext fctx, short prio, RequestClient client)
public void unsubscribeContent(USK origUSK, USKRetriever ret, boolean runBackgroundFetch)
public int getBackgroundFetcherByUSKSize()
public int getTemporaryBackgroundFetchersLRU()
public void onFinished(USKFetcher fetcher)
public void onFinished(USKFetcher fetcher, boolean ignoreError)
public boolean persistent()
public void checkUSK(FreenetURI uri, boolean persistent, boolean isMetadata)