I have some revamps to the API which are about ready to commit.
The purpose is to modularize things to allow pluggable metadata handling
and pluggable backends (FNP, FCP, InternalClient, whatever).

This will break anything depending on Client but the adaptions to make
are minimal.  I have ported RequestClient, InsertClient, and
SimplifiedClient, so only outside packages will be affected.

The old way of using Client looked like:

    Client bc = new Client(clientCore, targetAddress);
    ClientKey ck = ClientUtil.getKey(uriString, params);
    RequestToken rt = bc.prepare(htl, ck, dataBucket, metaBucket);
    ... add listeners with rt.addEventListener() ...
    bc.makeRequest(rt);
    ... synchronized on a listener and wait for events ...

The new way:

    String uri;
    ClientFactory cf = new FNPClient(clientCore, targetAddress);
    DataRequest req  = new DataRequest(htl, uriString, metaBucket, dataBucket);
    ... add listeners with req.addEventListener(); ...
    Client c = cf.obtainClient(req);
    c.execute();
    ... synchronized on a listener and wait for events ...

The current list of Request types:
DataRequest, InsertRequest,
HandshakeRequest, ComputeCHKRequest, ComputeSVKRequest

As of now the last 3 are only relevant to FCP.  SimplifiedClient and the CLI
clients should probably start making use of the last two.

I haven't figured out how the pluggable metadata handling is going to work
yet.. it will involve something like a Handler class and several subclasses
(RedirectHandler, SplitFileHandler, etc.), where the desired handlers are
registered with the Request or the Client and the rest is automatic.

TODO:
    Handler framework
    FCPClient
    possibly InternalClient

...

There are also some bug fixes to FCPHandler and it has been brought up to
date with the spec.

P.S. is there any reason not to use an int for HTL instead of a long?

-- 

# tavin cole
# if code is law, then Freenet is a crowded theater


_______________________________________________
Devl mailing list
Devl at freenetproject.org
http://lists.freenetproject.org/mailman/listinfo/devl

Reply via email to