public RuntimeValue createVertxWebsocketComponent()

in extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java [48:81]


    public RuntimeValue<VertxWebsocketComponent> createVertxWebsocketComponent(
            RuntimeValue<Vertx> vertx,
            RuntimeValue<Router> router,
            LaunchMode launchMode,
            HttpConfiguration httpConfig) {

        boolean sslEnabled = false;
        int httpPort = httpConfig.determinePort(launchMode);
        int httpsPort = httpConfig.determineSslPort(launchMode);

        ServerSslConfig ssl = httpConfig.ssl;
        if (ssl != null) {
            CertificateConfig certificate = ssl.certificate;
            if (certificate != null) {
                if (certificate.files.isPresent() && certificate.keyFiles.isPresent()) {
                    sslEnabled = true;
                }

                if (certificate.keyStoreFile.isPresent() && certificate.keyStorePassword.isPresent()) {
                    sslEnabled = true;
                }
            }
        }

        HOST = httpConfig.host;
        PORT = sslEnabled ? httpsPort : httpPort;

        QuarkusVertxWebsocketComponent component = new QuarkusVertxWebsocketComponent();
        component.setVertx(vertx.getValue());
        component.setRouter(router.getValue());
        component.setDefaultHost(HOST);
        component.setDefaultPort(PORT);
        return new RuntimeValue<>(component);
    }