Package freenet.client

Examples of freenet.client.FetchContext


        }
    }

    // Fetch our revocation key from the datastore plus the binary blob

    FetchContext seedContext = updateManager.node.clientCore.makeClient((short) 0, true, false).getFetchContext();
    FetchContext tempContext = new FetchContext(seedContext, FetchContext.IDENTICAL_MASK, true, blocks);
    // If it is too big, we get a TOO_BIG. This is fatal so we will blow, which is the right thing as it means the top block is valid.
    tempContext.maxOutputLength = NodeUpdateManager.MAX_REVOCATION_KEY_LENGTH;
    tempContext.maxTempLength = NodeUpdateManager.MAX_REVOCATION_KEY_TEMP_LENGTH;
    tempContext.localRequestOnly = true;
View Full Code Here


        }
    }

    // Fetch the jar from the datastore plus the binary blob

    FetchContext seedContext = updateManager.node.clientCore.makeClient((short) 0, true, false).getFetchContext();
    FetchContext tempContext = new FetchContext(seedContext, FetchContext.IDENTICAL_MASK, true, blocks);
    tempContext.localRequestOnly = true;

    File f;
    FileBucket b = null;
    try {
View Full Code Here

    this.isFetching = false;
    this.blobFilenamePrefix = blobFilenamePrefix;
    this.maxDeployVersion = max;
    this.minDeployVersion = min;

    FetchContext tempContext = core.makeClient((short) 0, true, false).getFetchContext();
    tempContext.allowSplitfiles = true;
    tempContext.dontEnterImplicitArchives = false;
    this.ctx = tempContext;

  }
View Full Code Here

            targetFile = new File(dis.readUTF());
        } else {
            targetFile = null;
        }
        binaryBlob = dis.readBoolean();
        FetchContext fctx = null;
        try {
            DataInputStream innerDIS =
                new DataInputStream(checker.checksumReaderWithLength(dis, context.tempBucketFactory, 65536));
            try {
                fctx = new FetchContext(innerDIS);
            } catch (IOException e) {
                Logger.error(this, "Unable to read fetch settings, will use default settings: "+e, e);
            } finally {
                innerDIS.close();
            }
View Full Code Here

    return f;
  }

  private void innerMakePersistentGlobalRequest(FreenetURI fetchURI, boolean filterData, boolean persistRebootOnly, ReturnType returnType, String id, File returnFilename,
      boolean realTimeFlag) throws IdentifierCollisionException, NotAllowedException, IOException {
      FetchContext defaultFetchContext = core.clientContext.getDefaultPersistentFetchContext();
    final ClientGet cg =
      new ClientGet(persistRebootOnly ? globalRebootClient : globalForeverClient, fetchURI, defaultFetchContext.localRequestOnly,
          defaultFetchContext.ignoreStore, filterData, QUEUE_MAX_RETRIES,
          QUEUE_MAX_RETRIES, QUEUE_MAX_DATA_SIZE, returnType, persistRebootOnly, id,
          Integer.MAX_VALUE, RequestStarter.BULK_SPLITFILE_PRIORITY_CLASS, returnFilename, null, false, realTimeFlag, false, core);
View Full Code Here

    private final File tempFile;
    private UOMDependencyFetcher uomFetcher;
    private final boolean executable;
   
    DependencyJarFetcher(File filename, FreenetURI chk, long expectedLength, byte[] expectedHash, JarFetcherCallback cb, boolean essential, boolean executable) throws FetchException {
      FetchContext myCtx = new FetchContext(dependencyCtx, FetchContext.IDENTICAL_MASK);
      File parent = filename.getParentFile();
      if(parent == null) parent = new File(".");
      try {
        tempFile = File.createTempFile(filename.getName(), NodeUpdateManager.TEMP_FILE_SUFFIX, parent);
      } catch (InsufficientDiskSpaceException e) {
View Full Code Here

              }
            }
          }
         
        });
        FetchContext context = hlsc.getFetchContext();
        if(desperate) {
          context.maxNonSplitfileRetries = -1;
          context.maxSplitfileBlockRetries = -1;
        }
        FetchWaiter fw = new FetchWaiter(node.nonPersistentClientBulk);
View Full Code Here

      this.writeHTMLReply(ctx, 400, l10n("invalidKeyTitle"), pageNode.generate());
      return;
    }

    FetchContext fctx = getFetchContext(maxSize);
    // max-size=-1 => use default
    maxSize = fctx.maxOutputLength;

    //We should run the ContentFilter by default
    String forceString = httprequest.getParam("force");
View Full Code Here

        new DiskSpaceCheckingRandomAccessBufferFactory(raff, persistentTempDir.dir(),
                minDiskFreeLongTerm + tempBucketFactory.getMaxRamUsed());
    persistentRAFFactory = new MaybeEncryptedRandomAccessBufferFactory(persistentDiskChecker, nodeConfig.getBoolean("encryptPersistentTempBuckets"));
    persistentTempBucketFactory.setDiskSpaceChecker(persistentDiskChecker);
    HighLevelSimpleClient client = makeClient((short)0, false, false);
    FetchContext defaultFetchContext = client.getFetchContext();
    InsertContext defaultInsertContext = client.getInsertContext(false);
    int maxMemoryLimitedJobThreads = Runtime.getRuntime().availableProcessors() / 2; // Some disk I/O ... tunable REDFLAG
    maxMemoryLimitedJobThreads = Math.min(maxMemoryLimitedJobThreads, node.nodeStats.getThreadLimit()/20);
    maxMemoryLimitedJobThreads = Math.max(1, maxMemoryLimitedJobThreads);
        // FIXME review thread limits. This isn't just memory, it's CPU and disk as well, so we don't want it too big??
View Full Code Here

  public void setDownloadCache(DownloadCache cache) {
    this.downloadCache = cache;
  }

    public FetchContext getDefaultPersistentFetchContext() {
        return new FetchContext(defaultPersistentFetchContext, FetchContext.IDENTICAL_MASK);
    }
View Full Code Here

TOP

Related Classes of freenet.client.FetchContext

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.