Example usage for io.vertx.core.http HttpServer actualPort

List of usage examples for io.vertx.core.http HttpServer actualPort

Introduction

In this page you can find the example usage for io.vertx.core.http HttpServer actualPort.

Prototype

int actualPort();

Source Link

Document

The actual port the server is listening on.

Usage

From source file:org.eclipse.hono.adapter.http.AbstractVertxBasedHttpProtocolAdapter.java

License:Open Source License

/**
 * Sets the http server instance configured to serve requests over a TLS secured socket.
 * <p>/*from ww  w  . jav  a2 s .c  om*/
 * If no server is set using this method, then a server instance is created during
 * startup of this adapter based on the <em>config</em> properties and the server options
 * returned by {@link #getHttpServerOptions()}.
 * 
 * @param server The http server.
 * @throws NullPointerException if server is {@code null}.
 * @throws IllegalArgumentException if the server is already started and listening on an address/port.
 */
@Autowired(required = false)
public final void setHttpServer(final HttpServer server) {
    Objects.requireNonNull(server);
    if (server.actualPort() > 0) {
        throw new IllegalArgumentException("http server must not be started already");
    } else {
        this.server = server;
    }
}

From source file:org.eclipse.hono.adapter.http.AbstractVertxBasedHttpProtocolAdapter.java

License:Open Source License

/**
 * Sets the http server instance configured to serve requests over a plain socket.
 * <p>/*from ww w . j  a  va  2s  . co  m*/
 * If no server is set using this method, then a server instance is created during
 * startup of this adapter based on the <em>config</em> properties and the server options
 * returned by {@link #getInsecureHttpServerOptions()}.
 * 
 * @param server The http server.
 * @throws NullPointerException if server is {@code null}.
 * @throws IllegalArgumentException if the server is already started and listening on an address/port.
 */
@Autowired(required = false)
public final void setInsecureHttpServer(final HttpServer server) {
    Objects.requireNonNull(server);
    if (server.actualPort() > 0) {
        throw new IllegalArgumentException("http server must not be started already");
    } else {
        this.insecureServer = server;
    }
}