Esempio n. 1
0
  private HostableConduit startConduit(
      final String basePublicUrl,
      VFSResource root,
      TempDirAllocator allocator,
      ConduitDiscoveryResult conduit) {
    final URI publicUri = URI(basePublicUrl + conduit.hostingPath);
    final ConduitLog log = logStreamForConduit(conduit.localPath.getName());
    ConduitOrchestrator orchestrator =
        new ConduitOrchestrator(
            conduit.name,
            log.stream,
            publicUri,
            sshPortForConduitNamed(conduit.name),
            conduit.localPath,
            allocator,
            database);
    orchestrator.start();

    ConduitHttpResource httpResource = new ConduitHttpResource(conduit.hostingPath, orchestrator);

    // For basic read-only "GET" access
    this.log.info("Serving " + conduit.localPath + " at " + conduit.hostingPath);
    root.addVResource(conduit.hostingPath, conduit.localPath);
    return new HostableConduit(conduit, httpResource, orchestrator, log);
  }
Esempio n. 2
0
 private HostableConduit(
     ConduitDiscoveryResult config,
     ConduitHttpResource handler,
     ConduitOrchestrator controller,
     ConduitLog log) {
   super();
   this.name = config.name;
   this.hostingPath = config.hostingPath;
   this.localPath = config.localPath;
   this.httpResource = handler;
   this.orchestrator = controller;
   this.p4path = controller.p4Path();
   this.log = log;
 }