public interface HighLevelSimpleClient
Modifier and Type | Method and Description |
---|---|
void |
addEventHook(ClientEventListener listener)
Add a ClientEventListener.
|
HighLevelSimpleClient |
clone() |
FetchResult |
fetch(FreenetURI uri)
Blocking fetch of a URI
|
ClientGetter |
fetch(FreenetURI uri,
ClientGetCallback callback,
FetchContext fctx,
short prio)
Non-blocking fetch of a URI with a configurable max-size (in bytes), context object, callback and context.
|
FetchResult |
fetch(FreenetURI uri,
long maxSize)
Blocking fetch of a URI with a configurable max-size.
|
ClientGetter |
fetch(FreenetURI uri,
long maxSize,
ClientGetCallback callback,
FetchContext fctx)
Non-blocking fetch of a URI with a configurable max-size (in bytes), context object, callback and context.
|
ClientGetter |
fetch(FreenetURI uri,
long maxSize,
ClientGetCallback callback,
FetchContext fctx,
short priorityClass)
Non-blocking fetch of a URI with a configurable max-size (in bytes), context object, callback and context.
|
FetchResult |
fetch(FreenetURI uri,
long maxSize,
RequestClient context)
Blocking fetch of a URI with a configurable max-size and context object.
|
FetchResult |
fetchFromMetadata(Bucket initialMetadata)
Blocking fetch from metadata
|
ClientGetter |
fetchFromMetadata(Bucket initialMetadata,
ClientGetCallback callback,
FetchContext fctx,
short prio)
Non-blocking fetch of a URI with a configurable max-size (in bytes), context object, callback and context.
|
FreenetURI[] |
generateKeyPair(java.lang.String docName)
Generates a new key pair, consisting of the insert URI at index 0 and the
request URI at index 1.
|
FetchContext |
getFetchContext()
Get the FetchContext so you can customise the search process.
|
FetchContext |
getFetchContext(long size) |
FetchContext |
getFetchContext(long size,
java.lang.String schemeHostAndPort) |
InsertContext |
getInsertContext(boolean forceNonPersistent)
Get an InsertContext.
|
FreenetURI |
insert(InsertBlock insert,
boolean getCHKOnly,
java.lang.String filenameHint)
Blocking insert.
|
FreenetURI |
insert(InsertBlock insert,
boolean getCHKOnly,
java.lang.String filenameHint,
short priority)
Blocking insert.
|
ClientPutter |
insert(InsertBlock insert,
java.lang.String filenameHint,
boolean isMetadata,
InsertContext ctx,
ClientPutCallback cb)
Non-blocking insert.
|
ClientPutter |
insert(InsertBlock insert,
java.lang.String filenameHint,
boolean isMetadata,
InsertContext ctx,
ClientPutCallback cb,
short priority)
Non-blocking insert.
|
FreenetURI |
insert(InsertBlock insert,
java.lang.String filenameHint,
short priority,
InsertContext ctx)
Blocking insert.
|
FreenetURI |
insertManifest(FreenetURI insertURI,
java.util.HashMap<java.lang.String,java.lang.Object> bucketsByName,
java.lang.String defaultName)
Blocking insert of multiple files as a manifest (or zip manifest, etc).
|
FreenetURI |
insertManifest(FreenetURI insertURI,
java.util.HashMap<java.lang.String,java.lang.Object> bucketsByName,
java.lang.String defaultName,
short priorityClass)
Blocking insert of multiple files as a manifest (or zip manifest, etc).
|
FreenetURI |
insertManifest(FreenetURI insertURI,
java.util.HashMap<java.lang.String,java.lang.Object> bucketsByName,
java.lang.String defaultName,
short priorityClass,
byte[] forceCryptoKey)
Blocking insert of multiple files as a manifest, with a crypto key override.
|
FreenetURI |
insertRedirect(FreenetURI insertURI,
FreenetURI target)
Blocking insert of a redirect.
|
void |
prefetch(FreenetURI uri,
long timeout,
long maxSize,
java.util.Set<java.lang.String> allowedTypes)
Prefetch a key at a very low priority.
|
void |
prefetch(FreenetURI uri,
long timeout,
long maxSize,
java.util.Set<java.lang.String> allowedTypes,
short prio)
Prefetch a key at the given priority.
|
void |
setMaxIntermediateLength(long maxIntermediateLength)
Set the maximum length of any intermediate data, e.g.
|
void |
setMaxLength(long maxLength)
Set the maximum length of the fetched data.
|
void setMaxLength(long maxLength)
void setMaxIntermediateLength(long maxIntermediateLength)
FetchResult fetch(FreenetURI uri) throws FetchException
FetchException
- If there is an error fetching the dataFetchResult fetchFromMetadata(Bucket initialMetadata) throws FetchException
FetchException
- If there is an error fetching the dataFetchResult fetch(FreenetURI uri, long maxSize) throws FetchException
maxSize
- The maximum size in bytes of the return data or any intermediary data processed
to obtain the final output (e.g. containers).FetchException
FetchResult fetch(FreenetURI uri, long maxSize, RequestClient context) throws FetchException
context
- Used mainly for scheduling, we round-robin between request clients within a given
priority and retry count. Also indicates whether the request is persistent, and if so, can remove it.FetchException
ClientGetter fetch(FreenetURI uri, ClientGetCallback callback, FetchContext fctx, short prio) throws FetchException
callback
- Will be called when the request completes, fails, etc. If the request is persistent
this will be called on the database thread with a container parameter.fctx
- Fetch context so you can customise the search process.FetchException
ClientGetter fetchFromMetadata(Bucket initialMetadata, ClientGetCallback callback, FetchContext fctx, short prio) throws FetchException
callback
- Will be called when the request completes, fails, etc. If the request is persistent
this will be called on the database thread with a container parameter.fctx
- Fetch context so you can customise the search process.FetchException
ClientGetter fetch(FreenetURI uri, long maxSize, ClientGetCallback callback, FetchContext fctx) throws FetchException
callback
- Will be called when the request completes, fails, etc. If the request is persistent
this will be called on the database thread with a container parameter.fctx
- Fetch context so you can customise the search process.maxSize
- IGNORED. FIXME DEPRECATEFetchException
ClientGetter fetch(FreenetURI uri, long maxSize, ClientGetCallback callback, FetchContext fctx, short priorityClass) throws FetchException
callback
- Will be called when the request completes, fails, etc. If the request is persistent
this will be called on the database thread with a container parameter.fctx
- Fetch context so you can customise the search process.priorityClass
- What priority to start at. It is much more efficient to specify it here than to change it later.FetchException
FreenetURI insert(InsertBlock insert, boolean getCHKOnly, java.lang.String filenameHint) throws InsertException
filenameHint
- If set, insert a single-file manifest containing only this file, under the given filename.InsertException
- If there is an error inserting the dataFreenetURI insert(InsertBlock insert, boolean getCHKOnly, java.lang.String filenameHint, short priority) throws InsertException
filenameHint
- If set, insert a single-file manifest containing only this file, under the given filename.InsertException
- If there is an error inserting the dataFreenetURI insert(InsertBlock insert, java.lang.String filenameHint, short priority, InsertContext ctx) throws InsertException
filenameHint
- If set, insert a single-file manifest containing only this file, under the given filename.InsertException
- If there is an error inserting the dataClientPutter insert(InsertBlock insert, java.lang.String filenameHint, boolean isMetadata, InsertContext ctx, ClientPutCallback cb) throws InsertException
isMetadata
- If true, insert metadata.cb
- Will be called when the insert completes. If the request is persistent
this will be called on the database thread with a container parameter.ctx
- Insert context so you can customise the insertion process.InsertException
ClientPutter insert(InsertBlock insert, java.lang.String filenameHint, boolean isMetadata, InsertContext ctx, ClientPutCallback cb, short priority) throws InsertException
isMetadata
- If true, insert metadata.cb
- Will be called when the insert completes. If the request is persistent
this will be called on the database thread with a container parameter.ctx
- Insert context so you can customise the insertion process.InsertException
FreenetURI insertRedirect(FreenetURI insertURI, FreenetURI target) throws InsertException
InsertException
FreenetURI insertManifest(FreenetURI insertURI, java.util.HashMap<java.lang.String,java.lang.Object> bucketsByName, java.lang.String defaultName) throws InsertException
InsertException
FreenetURI insertManifest(FreenetURI insertURI, java.util.HashMap<java.lang.String,java.lang.Object> bucketsByName, java.lang.String defaultName, short priorityClass) throws InsertException
InsertException
FreenetURI insertManifest(FreenetURI insertURI, java.util.HashMap<java.lang.String,java.lang.Object> bucketsByName, java.lang.String defaultName, short priorityClass, byte[] forceCryptoKey) throws InsertException
InsertException
FetchContext getFetchContext()
FetchContext getFetchContext(long size)
FetchContext getFetchContext(long size, java.lang.String schemeHostAndPort)
InsertContext getInsertContext(boolean forceNonPersistent)
forceNonPersistent
- If true, force the request to use the non-persistent
bucket pool.void addEventHook(ClientEventListener listener)
FreenetURI[] generateKeyPair(java.lang.String docName)
docName
- The document namevoid prefetch(FreenetURI uri, long timeout, long maxSize, java.util.Set<java.lang.String> allowedTypes)
allowedTypes
- Kill the request if the MIME type is not one of these types. Normally null.void prefetch(FreenetURI uri, long timeout, long maxSize, java.util.Set<java.lang.String> allowedTypes, short prio)
allowedTypes
- Kill the request if the MIME type is not one of these types. Normally null.HighLevelSimpleClient clone()