Package org.openrdf.http.client

Examples of org.openrdf.http.client.SizeClient


      Resource... contexts)
    throws StoreException
  {
    StatementPattern pattern = new StatementPattern(subj, pred, obj, includeInferred, contexts);
    CachedSize cached = cachedSizes.get(pattern);
    SizeClient client = this.client.size();
    if (cached != null && cached.isSizeAvailable()) {
      // Only calculate size if cached value is old
      client.ifNoneMatch(cached.getETag());
    }
    Long size = client.get(subj, pred, obj, includeInferred, contexts);
    int maxAge = client.getMaxAge();
    if (size == null) {
      assert cached != null : "Server did not return a size value";
      cached.refreshed(now, maxAge);
    }
    else {
      cached = new CachedSize(size, client.getETag());
      cached.refreshed(now, maxAge);
      cachedSizes.put(pattern, cached);
    }
    containsFreshValues |= maxAge > 0;
    assert cached.isSizeAvailable();
View Full Code Here

TOP

Related Classes of org.openrdf.http.client.SizeClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.