Package com.subgraph.orchid

Examples of com.subgraph.orchid.OpenFailedException


  }

  private void validateHostname(String hostname) throws OpenFailedException {
    maybeRejectInternalAddress(hostname);
    if(hostname.toLowerCase().endsWith(".onion")) {
      throw new OpenFailedException("Hidden services not supported");
    } else if(hostname.toLowerCase().endsWith(".exit")) {
      throw new OpenFailedException(".exit addresses are not supported");
    }
  }
View Full Code Here


  }
 
  private void maybeRejectInternalAddress(IPv4Address address) throws OpenFailedException {
    final InetAddress inetAddress = address.toInetAddress();
    if(inetAddress.isSiteLocalAddress() && config.getClientRejectInternalAddress()) {
      throw new OpenFailedException("Rejecting stream target with internal address: "+ address);
    }
  }
View Full Code Here

        failCount += 1;
      } catch (TimeoutException e) {
        circuit.markForClose();
      }
    }
    throw new OpenFailedException("Retry count exceeded opening directory stream");
  }
View Full Code Here

      if(tryOpenCircuit(circuit, true, true)) {
        return circuit;
      }
      failCount += 1;
    }
    throw new OpenFailedException("Could not create circuit for directory stream");
  }
View Full Code Here

  }

  public DirectoryCircuit openDirectoryCircuitTo(List<Router> path) throws OpenFailedException {
    final DirectoryCircuit circuit = CircuitImpl.createDirectoryCircuitTo(this, path);
    if(!tryOpenCircuit(circuit, true, false)) {
      throw new OpenFailedException("Could not create directory circuit for path");
    }
    return circuit;
  }
View Full Code Here

  }

  public ExitCircuit openExitCircuitTo(List<Router> paththrows OpenFailedException {
    final ExitCircuit circuit = CircuitImpl.createExitCircuitTo(this, path);
    if(!tryOpenCircuit(circuit, false, false)) {
      throw new OpenFailedException("Could not create exit circuit for path");
    }
    return circuit;
  }
View Full Code Here

  }

  public InternalCircuit openInternalCircuitTo(List<Router> path) throws OpenFailedException {
    final InternalCircuit circuit = CircuitImpl.createInternalCircuitTo(this, path);
    if(!tryOpenCircuit(circuit, false, false)) {
      throw new OpenFailedException("Could not create internal circuit for path");
    }
    return circuit;
  }
View Full Code Here

    final HiddenServiceCircuit circuit = getCircuitTo(hs);
   
    try {
      return circuit.openStream(port, HS_STREAM_TIMEOUT);
    } catch (StreamConnectFailedException e) {
      throw new OpenFailedException("Failed to open stream to hidden service "+ hs.getOnionAddressForLogging() + " reason "+ e.getReason());
    }
  }
View Full Code Here

 
  private synchronized HiddenServiceCircuit getCircuitTo(HiddenService hs) throws OpenFailedException {
    if(hs.getCircuit() == null) {
      final HiddenServiceCircuit c = openCircuitTo(hs);
      if(c == null) {
        throw new OpenFailedException("Failed to open circuit to "+ hs.getOnionAddressForLogging());
      }
      hs.setCircuit(c);
    }
    return hs.getCircuit();
  }
View Full Code Here

      final HiddenServiceCircuit c = openRendezvousCircuit(hs, descriptor);
      if(c != null) {
        return c;
      }
    }
    throw new OpenFailedException("Failed to open circuit to "+ hs.getOnionAddressForLogging());
  }
View Full Code Here

TOP

Related Classes of com.subgraph.orchid.OpenFailedException

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.