Package com.subgraph.orchid

Examples of com.subgraph.orchid.ConsensusDocument


  }
 
  private class DownloadConsensusTask implements Runnable {
    public void run() {
      try {
        final ConsensusDocument consensus = downloader.downloadCurrentConsensus(useMicrodescriptors());
        setCurrentConsensus(consensus);
        directory.addConsensusDocument(consensus, false);
       
      } catch (DirectoryRequestFailedException e) {
        logger.warning("Failed to download current consensus document: "+ e.getMessage());
View Full Code Here


  private boolean useMicrodescriptors() {
    return config.getUseMicrodescriptors() != AutoBoolValue.FALSE;
  }

  List< List<HexDigest> > getDescriptorDigestsToDownload() {
    final ConsensusDocument consensus = directory.getCurrentConsensusDocument();
    if(consensus == null || !consensus.isLive()) {
      return Collections.emptyList();
    }
    final List<Router> downloadables = directory.getRoutersWithDownloadableDescriptors();
    if(!canDownloadDescriptors(downloadables.size())) {
      return Collections.emptyList();
View Full Code Here

      throw new IllegalArgumentException("getUseNTorHandshake() returned "+ config.getUseNTorHandshake());
    }
  }
 
  boolean isNtorEnabledInConsensus() {
    ConsensusDocument consensus = directory.getCurrentConsensusDocument();
    return (consensus != null) && (consensus.getUseNTorHandshake());
  }
View Full Code Here

      return chooseNodeByBandwidth(candidates, rule);
    }
  }
 
  private Router chooseNodeByBandwidthWeights(List<Router> candidates, WeightRule rule) {
    final ConsensusDocument consensus = directory.getCurrentConsensusDocument();
    if(consensus == null) {
      return null;
    }
    final BandwidthWeightedRouters bwr = computeWeightedBandwidths(candidates, consensus, rule);
    return bwr.chooseRandomRouterByWeight();
View Full Code Here

  }
 
 
 
  private void refreshFromDirectory() {
    ConsensusDocument consensus = directory.getCurrentConsensusDocument();
    if(currentConsensus == consensus) {
      return;
    }
    currentConsensus = consensus;
    hsDirectories.clear();
View Full Code Here

TOP

Related Classes of com.subgraph.orchid.ConsensusDocument

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.