APIHTTP store

HTTP store

An implementation of the HTTP store specification.

Instance creation

HttpStore httpStore = new HTTPStore(url);
var httpStore = cn.HTTPStore(url);
my $httpStore = CN::HTTPStore->new($url);

Instantiates a HTTP store for a url of the form:

http://HOST:PORT/PATH/TO/STORE
https://HOST:PORT/PATH/TO/STORE

The port is optional, and defaults to 80 for HTTP, and 443 for HTTPS.

Store behavior

Each store request results in one HTTP request.

Reachability

HTTPStoreState storeState = HTTPStoreManager.getOrCreate(url);
int reachable = storeState.isReachable();

Returns the current reachability estimate for the store. The estimate is based on the success of recent requests, and can take one of the following values:

1 The store is probably reachable. A recent request was successful.
0 It is not known whether the store is reachable. There have not been any requests recently.
-1 The store is probably not reachable. The last request failed.

Threading

The Java implementation creates up to 3 threads per URL, and dispatches store accesses onto these threads. If a store is slow, this does not affect operations on other stores.