Package freenet.client.async

Examples of freenet.client.async.ClientGetter


  @Override
  public FetchResult fetchFromMetadata(Bucket initialMetadata) throws FetchException {
    if(initialMetadata == null) throw new NullPointerException();
    FetchContext context = getFetchContext();
    FetchWaiter fw = new FetchWaiter(this);
    ClientGetter get = new ClientGetter(fw, FreenetURI.EMPTY_CHK_URI, context, priorityClass, null, null, initialMetadata);
    try {
      core.clientContext.start(get);
    } catch (PersistenceDisabledException e) {
      // Impossible
    }
View Full Code Here


  @Override
  public FetchResult fetch(FreenetURI uri, long overrideMaxSize, RequestClient clientContext) throws FetchException {
    if(uri == null) throw new NullPointerException();
    FetchWaiter fw = new FetchWaiter(clientContext);
    FetchContext context = getFetchContext(overrideMaxSize);
    ClientGetter get = new ClientGetter(fw, uri, context, priorityClass, null, null, null);
    try {
      core.clientContext.start(get);
    } catch (PersistenceDisabledException e) {
      // Impossible
    }
View Full Code Here

  }
 
  @Override
  public ClientGetter fetch(FreenetURI uri, ClientGetCallback callback, FetchContext fctx, short prio) throws FetchException {
    if(uri == null) throw new NullPointerException();
    ClientGetter get = new ClientGetter(callback, uri, fctx, prio, null, null, null);
    try {
      core.clientContext.start(get);
    } catch (PersistenceDisabledException e) {
      // Impossible
    }
View Full Code Here

  }

  @Override
  public ClientGetter fetchFromMetadata(Bucket initialMetadata, ClientGetCallback callback, FetchContext fctx, short prio) throws FetchException {
    if(initialMetadata == null) throw new NullPointerException();
    ClientGetter get = new ClientGetter(callback, FreenetURI.EMPTY_CHK_URI, fctx, prio, null, null, initialMetadata);
    try {
      core.clientContext.start(get);
    } catch (PersistenceDisabledException e) {
      // Impossible
    }
View Full Code Here

  @Override
  public void prefetch(FreenetURI uri, long timeout, long maxSize, Set<String> allowedTypes, short prio) {
    FetchContext ctx = getFetchContext(maxSize);
    ctx.allowedMIMETypes = allowedTypes;
    final ClientGetter get = new ClientGetter(nullCallback, uri, ctx, prio, new NullBucket(), null, null);
    core.getTicker().queueTimedJob(new Runnable() {
      @Override
      public void run() {
        get.cancel(core.clientContext);
      }

    }, timeout);
    try {
      core.clientContext.start(get);
View Full Code Here

   * and above the level of individual block fetches.
   */
  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();

  }
View Full Code Here

                  return false;
              }
              try {
                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
View Full Code Here

            public RequestClient getRequestClient() {
                return UpdateOverMandatoryManager.this;
            }
    };

    ClientGetter cg = new ClientGetter(myCallback,
      updateManager.getRevocationURI(), tempContext, (short) 0, null, new BinaryBlobWriter(cleanedBlob), null);

    try {
      updateManager.node.clientCore.clientContext.start(cg);
    } catch(FetchException e1) {
View Full Code Here

                return UpdateOverMandatoryManager.this;
            }

    };

    ClientGetter cg = new ClientGetter(myCallback,
      uri, tempContext, (short) 0, null, new BinaryBlobWriter(cleanedBlob), null);

    try {
      updateManager.node.clientCore.clientContext.start(cg);
    } catch(FetchException e1) {
View Full Code Here

      FetchContext context = hlsc.getFetchContext();
      context.maxNonSplitfileRetries = -1;
      context.maxSplitfileBlockRetries = -1;
      context.maxTempLength = maxSize;
      context.maxOutputLength = maxSize;
      ClientGetter get = new ClientGetter(this, freenetURI, context,
          priority, null, null, null);
      try {
        node.clientCore.clientContext.start(get);
      } catch (PersistenceDisabledException e) {
        // Impossible
View Full Code Here

TOP

Related Classes of freenet.client.async.ClientGetter

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.