Package freenet.client

Examples of freenet.client.FetchWaiter.waitForCompletion()


        try {
          node.clientCore.clientContext.start(get);
        } catch (PersistenceDisabledException e) {
          // Impossible
        }
        FetchResult res = fw.waitForCompletion();
        return res.asBucket().getInputStream();
      } catch (FetchException e) {
        if ((e.getMode() == FetchExceptionMode.PERMANENT_REDIRECT) || (e.getMode() == FetchExceptionMode.TOO_MANY_PATH_COMPONENTS)) {
          uri = e.newURI;
          continue;
View Full Code Here


              inserted++;
              try {
                t1 = System.currentTimeMillis();
                FetchWaiter fw = new FetchWaiter(requestContext);
                client.fetch(insertedURIs[j], 32768, fw, fctx);
                fw.waitForCompletion();
                t2 = System.currentTimeMillis();
               
                System.out.println("PULL-TIME FOR BLOCK "+j+": " + (t2 - t1));
                csvLine.add(String.valueOf(t2 - t1));
                pulled++;
View Full Code Here

  FetchResult fetch(FreenetURI uri, long maxSize, RequestClient clientContext, FetchContext fctx) throws FetchException {
    // For now, just run it blocking.
    FetchWaiter fw = new FetchWaiter(clientContext);
    @SuppressWarnings("unused")
    ClientGetter getter = client.fetch(uri, 1, fw, fctx);
    return fw.waitForCompletion();

  }
  /**
   * Returns a default FetchContext
   * @param maxSize The maximum allowable size of the fetch's result
View Full Code Here

                FetchContext context = client.getFetchContext();
              FetchWaiter fw = new FetchWaiter((RequestClient)client);
              ClientGetter get = new ClientGetter(fw, uri, context, RequestStarter.INTERACTIVE_PRIORITY_CLASS, null, null, null);
              get.setMetaSnoop(new DumperSnoopMetadata());
                get.start(n.clientCore.clientContext);
          FetchResult result = fw.waitForCompletion();
          ClientMetadata cm = result.getMetadata();
                  outsb.append("Content MIME type: ").append(cm.getMIMEType());
          Bucket data = result.asBucket();
          // FIXME limit it above
          if(data.size() > 32*1024) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.