 package ibgroup.web.core.clientportal.gw;
 import ibgroup.http.GatewayHttpProxy;
 import ibgroup.http.GwWebsocketHandler;
 import ibgroup.utils.OptionUtils;
 import io.vertx.core.AbstractVerticle;
 import io.vertx.core.AsyncResult;
 import io.vertx.core.Future;
 import io.vertx.core.Handler;
 import io.vertx.core.http.HttpServer;
 import io.vertx.core.http.HttpServerOptions;
 import io.vertx.core.logging.Logger;
 import io.vertx.core.logging.LoggerFactory;
 import io.vertx.core.net.JksOptions;
 
 public class GatewayVerticle extends AbstractVerticle {
/* 16 */   private static final Logger logger = LoggerFactory.getLogger(GatewayVerticle.class);
   
   private Config config;
   private HttpServer httpServer;
   
   public void start(Future<Void> fut) {
/* 22 */     this.config = OptionUtils.loadSharedGlobalConfig(this.vertx);
/* 23 */     HttpServerOptions options = new HttpServerOptions();
/* 24 */     GatewayHttpProxy gatewayHttpProxy = new GatewayHttpProxy(this.vertx, this.config);
/* 25 */     if (this.config.getListenSsl()) {
/* 26 */       options.setSsl(true).setKeyStoreOptions(getJksOptions());
     }
/* 28 */     this.httpServer = this.vertx.createHttpServer(options);
/* 29 */     this.httpServer.requestHandler(gatewayHttpProxy.getRouter()::accept);
/* 30 */     this.httpServer.websocketStream().handler((Handler)new GwWebsocketHandler(this.vertx, this.config));
     
/* 32 */     logger.info("version: ed4af2592e9dd4a784d5403843bd18292fd441ea Fri, 9 Nov 2018 13:23:18 -0500");
/* 33 */     logger.info("Java Version: " + System.getProperty("java.version"));
/* 34 */     System.out.println("Java Version: " + System.getProperty("java.version"));
/* 35 */     System.out.println("****************************************************");
/* 36 */     System.out.println("version: ed4af2592e9dd4a784d5403843bd18292fd441ea Fri, 9 Nov 2018 13:23:18 -0500");
/* 37 */     System.out.println("****************************************************");
/* 38 */     System.out.println("This is a Beta release of the Client Portal Gateway");
/* 39 */     System.out.println("for any issues, please contact api@ibkr.com");
/* 40 */     System.out.println("and include a copy of your logs");
/* 41 */     System.out.println("****************************************************");
/* 42 */     System.out.println("https://www.interactivebrokers.com/api/doc.html");
/* 43 */     System.out.println("****************************************************");
/* 44 */     System.out.println("Open " + (this.config.getListenSsl() ? "https://" : "http://") + "localhost:" + this.config
/* 45 */         .getListenPort() + " to login");
/* 46 */     System.out.println("App demo is available after you login under: " + (
/* 47 */         this.config.getListenSsl() ? "https://" : "http://") + "localhost:" + this.config
/* 48 */         .getListenPort() + "/demo/");
/* 49 */     this.httpServer.listen(this.config.getListenPort(), res -> {
           if (res.succeeded()) {
             fut.complete();
           } else {
             fut.fail(res.cause().getMessage());
             System.err.println("Server listen failed " + res.cause().getMessage());
           } 
         });
   }
 
 
   
   public void stop(Future<Void> stopFuture) {}
 
   
   private JksOptions getJksOptions() {
/* 65 */     return (new JksOptions()).setPath(this.config.getSslCert()).setPassword(this.config.getSslPwd());
   }
 }


/* Location:              C:\Users\iuzeri\AppData\Local\Temp\ibrk_cpwa_gateway\dist\ibgroup.web.core.iblink.router.clientportal.gw.jar!\ibgroup\web\core\clientportal\gw\GatewayVerticle.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */