org.vertx.java.core.http.impl

## Class DefaultHttpServer

- java.lang.Object
- - org.vertx.java.core.http.impl.DefaultHttpServer

All Implemented Interfaces:
  HttpServer

    public class DefaultHttpServer
    extends java.lang.Object
    implements HttpServer

### Nested Class Summary

Nested Classes
`class` `DefaultHttpServer.ServerHandler`

### Constructor Summary

Constructors
Constructor and Description
`DefaultHttpServer(VertxInternal vertx)`

### Method Summary

Methods
`void` `close()` Close the server.
`void` `close(Handler<java.lang.Void> done)` Close the server.
`java.lang.Integer` `getAcceptBacklog()`
`java.lang.String` `getKeyStorePassword()`
`java.lang.String` `getKeyStorePath()`
`java.lang.Integer` `getReceiveBufferSize()`
`java.lang.Integer` `getSendBufferSize()`
`java.lang.Integer` `getTrafficClass()`
`java.lang.String` `getTrustStorePassword()`
`java.lang.String` `getTrustStorePath()`
`java.lang.Boolean` `isReuseAddress()`
`java.lang.Boolean` `isSoLinger()`
`boolean` `isSSL()`
`java.lang.Boolean` `isTCPKeepAlive()`
`java.lang.Boolean` `isTCPNoDelay()`
`HttpServer` `listen(int port)` Tell the server to start listening on all available interfaces and port `port`
`HttpServer` `listen(int port, java.lang.String host)` Tell the server to start listening on port `port` and hostname or ip address given by `host`.
`Handler<HttpServerRequest>` `requestHandler()` Get the request handler
`HttpServer` `requestHandler(Handler<HttpServerRequest> requestHandler)` Set the request handler for the server to `requestHandler`.
`HttpServer` `setAcceptBacklog(int backlog)` Set the accept backlog
`HttpServer` `setClientAuthRequired(boolean required)` Set `required` to true if you want the server to request client authentication from any connecting clients.
`HttpServer` `setKeyStorePassword(java.lang.String pwd)` Set the password for the SSL key store.
`HttpServer` `setKeyStorePath(java.lang.String path)` Set the path to the SSL key store.
`HttpServer` `setReceiveBufferSize(int size)` Set the TCP receive buffer size for connections created by this instance to `size` in bytes.
`HttpServer` `setReuseAddress(boolean reuse)` Set the TCP reuseAddress setting for connections created by this instance to `reuse`.
`HttpServer` `setSendBufferSize(int size)` Set the TCP send buffer size for connections created by this instance to `size` in bytes.
`HttpServer` `setSoLinger(boolean linger)` Set the TCP soLinger setting for connections created by this instance to `linger`.
`HttpServer` `setSSL(boolean ssl)` If `ssl` is `true`, this signifies that any connections will be SSL connections.
`HttpServer` `setTCPKeepAlive(boolean keepAlive)` Set the TCP keepAlive setting for connections created by this instance to `keepAlive`.
`HttpServer` `setTCPNoDelay(boolean tcpNoDelay)` If `tcpNoDelay` is set to `true` then Nagle's algorithm will turned off for the TCP connections created by this instance.
`HttpServer` `setTrafficClass(int trafficClass)` Set the TCP trafficClass setting for connections created by this instance to `trafficClass`.
`HttpServer` `setTrustStorePassword(java.lang.String pwd)` Set the password for the SSL trust store.
`HttpServer` `setTrustStorePath(java.lang.String path)` Set the path to the SSL trust store.
`Handler<ServerWebSocket>` `websocketHandler()` Get the websocket handler
`HttpServer` `websocketHandler(Handler<ServerWebSocket> wsHandler)` Set the websocket handler for the server to `wsHandler`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DefaultHttpServer

    public DefaultHttpServer(VertxInternal vertx)

### Method Detail

#### requestHandler

    public HttpServer requestHandler(Handler<HttpServerRequest> requestHandler)

Description copied from interface: `HttpServer`
Set the request handler for the server to `requestHandler`. As HTTP requests are received by the server, instances of `HttpServerRequest` will be created and passed to this handler.

Specified by:
  `requestHandler` in interface `HttpServer`
Returns:
  a reference to this, so methods can be chained.

#### requestHandler

    public Handler<HttpServerRequest> requestHandler()

Description copied from interface: `HttpServer`
Get the request handler

Specified by:
  `requestHandler` in interface `HttpServer`
Returns:
  The request handler

#### websocketHandler

    public HttpServer websocketHandler(Handler<ServerWebSocket> wsHandler)

Description copied from interface: `HttpServer`
Set the websocket handler for the server to `wsHandler`. If a websocket connect handshake is successful a new `WebSocket` instance will be created and passed to the handler.

Specified by:
  `websocketHandler` in interface `HttpServer`
Returns:
  a reference to this, so methods can be chained.

#### websocketHandler

    public Handler<ServerWebSocket> websocketHandler()

Description copied from interface: `HttpServer`
Get the websocket handler

Specified by:
  `websocketHandler` in interface `HttpServer`
Returns:
  The websocket handler

#### listen

    public HttpServer listen(int port)

Description copied from interface: `HttpServer`
Tell the server to start listening on all available interfaces and port `port`

Specified by:
  `listen` in interface `HttpServer`
Returns:
  a reference to this, so methods can be chained.

#### listen

    public HttpServer listen(int port,
                    java.lang.String host)

Description copied from interface: `HttpServer`
Tell the server to start listening on port `port` and hostname or ip address given by `host`.

Specified by:
  `listen` in interface `HttpServer`
Returns:
  a reference to this, so methods can be chained.

#### close

    public void close()

Description copied from interface: `HttpServer`
Close the server. Any open HTTP connections will be closed.

Specified by:
  `close` in interface `HttpServer`

#### close

    public void close(Handler<java.lang.Void> done)

Description copied from interface: `HttpServer`
Close the server. Any open HTTP connections will be closed. The `doneHandler` will be called when the close is complete.

Specified by:
  `close` in interface `HttpServer`

#### setSSL

    public HttpServer setSSL(boolean ssl)

Description copied from interface: `HttpServer`
If `ssl` is `true`, this signifies that any connections will be SSL connections.

Specified by:
  `setSSL` in interface `HttpServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setKeyStorePath

    public HttpServer setKeyStorePath(java.lang.String path)

Description copied from interface: `HttpServer`
Set the path to the SSL key store. This method should only be used in SSL mode, i.e. after `HttpServer.setSSL(boolean)` has been set to `true`.

The SSL key store is a standard Java Key Store, and should contain the server certificate.

Specified by:
  `setKeyStorePath` in interface `HttpServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setKeyStorePassword

    public HttpServer setKeyStorePassword(java.lang.String pwd)

Description copied from interface: `HttpServer`
Set the password for the SSL key store. This method should only be used in SSL mode, i.e. after `HttpServer.setSSL(boolean)` has been set to `true`.

Specified by:
  `setKeyStorePassword` in interface `HttpServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setTrustStorePath

    public HttpServer setTrustStorePath(java.lang.String path)

Description copied from interface: `HttpServer`
Set the path to the SSL trust store. This method should only be used in SSL mode, i.e. after `HttpServer.setSSL(boolean)` has been set to `true`.

The trust store is a standard Java Key Store, and should contain the certificates of any clients that the server trusts - this is only necessary if client authentication is enabled.

Specified by:
  `setTrustStorePath` in interface `HttpServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setTrustStorePassword

    public HttpServer setTrustStorePassword(java.lang.String pwd)

Description copied from interface: `HttpServer`
Set the password for the SSL trust store. This method should only be used in SSL mode, i.e. after `HttpServer.setSSL(boolean)` has been set to `true`.

Specified by:
  `setTrustStorePassword` in interface `HttpServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setClientAuthRequired

    public HttpServer setClientAuthRequired(boolean required)

Description copied from interface: `HttpServer`
Set `required` to true if you want the server to request client authentication from any connecting clients. This is an extra level of security in SSL, and requires clients to provide client certificates. Those certificates must be added to the server trust store.

Specified by:
  `setClientAuthRequired` in interface `HttpServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setTCPNoDelay

    public HttpServer setTCPNoDelay(boolean tcpNoDelay)

Description copied from interface: `HttpServer`
If `tcpNoDelay` is set to `true` then Nagle's algorithm will turned off for the TCP connections created by this instance.

Specified by:
  `setTCPNoDelay` in interface `HttpServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setSendBufferSize

    public HttpServer setSendBufferSize(int size)

Description copied from interface: `HttpServer`
Set the TCP send buffer size for connections created by this instance to `size` in bytes.

Specified by:
  `setSendBufferSize` in interface `HttpServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setReceiveBufferSize

    public HttpServer setReceiveBufferSize(int size)

Description copied from interface: `HttpServer`
Set the TCP receive buffer size for connections created by this instance to `size` in bytes.

Specified by:
  `setReceiveBufferSize` in interface `HttpServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setTCPKeepAlive

    public HttpServer setTCPKeepAlive(boolean keepAlive)

Description copied from interface: `HttpServer`
Set the TCP keepAlive setting for connections created by this instance to `keepAlive`.

Specified by:
  `setTCPKeepAlive` in interface `HttpServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setReuseAddress

    public HttpServer setReuseAddress(boolean reuse)

Description copied from interface: `HttpServer`
Set the TCP reuseAddress setting for connections created by this instance to `reuse`.

Specified by:
  `setReuseAddress` in interface `HttpServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setSoLinger

    public HttpServer setSoLinger(boolean linger)

Description copied from interface: `HttpServer`
Set the TCP soLinger setting for connections created by this instance to `linger`.

Specified by:
  `setSoLinger` in interface `HttpServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setTrafficClass

    public HttpServer setTrafficClass(int trafficClass)

Description copied from interface: `HttpServer`
Set the TCP trafficClass setting for connections created by this instance to `trafficClass`.

Specified by:
  `setTrafficClass` in interface `HttpServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setAcceptBacklog

    public HttpServer setAcceptBacklog(int backlog)

Description copied from interface: `HttpServer`
Set the accept backlog

Specified by:
  `setAcceptBacklog` in interface `HttpServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### isTCPNoDelay

    public java.lang.Boolean isTCPNoDelay()

Specified by:
  `isTCPNoDelay` in interface `HttpServer`
Returns:
  true if Nagle's algorithm is disabled.

#### getSendBufferSize

    public java.lang.Integer getSendBufferSize()

Specified by:
  `getSendBufferSize` in interface `HttpServer`
Returns:
  The TCP send buffer size

#### getReceiveBufferSize

    public java.lang.Integer getReceiveBufferSize()

Specified by:
  `getReceiveBufferSize` in interface `HttpServer`
Returns:
  The TCP receive buffer size

#### isTCPKeepAlive

    public java.lang.Boolean isTCPKeepAlive()

Specified by:
  `isTCPKeepAlive` in interface `HttpServer`
Returns:
  true if TCP keep alive is enabled

#### isReuseAddress

    public java.lang.Boolean isReuseAddress()

Specified by:
  `isReuseAddress` in interface `HttpServer`
Returns:
  The value of TCP reuse address

#### isSoLinger

    public java.lang.Boolean isSoLinger()

Specified by:
  `isSoLinger` in interface `HttpServer`
Returns:
  the value of TCP so linger

#### getTrafficClass

    public java.lang.Integer getTrafficClass()

Specified by:
  `getTrafficClass` in interface `HttpServer`
Returns:
  the value of TCP traffic class

#### getAcceptBacklog

    public java.lang.Integer getAcceptBacklog()

Specified by:
  `getAcceptBacklog` in interface `HttpServer`
Returns:
  the accept backlog

#### isSSL

    public boolean isSSL()

Specified by:
  `isSSL` in interface `HttpServer`
Returns:
  true if this server will make SSL connections

#### getKeyStorePath

    public java.lang.String getKeyStorePath()

Specified by:
  `getKeyStorePath` in interface `HttpServer`
Returns:
  The path to the key store

#### getKeyStorePassword

    public java.lang.String getKeyStorePassword()

Specified by:
  `getKeyStorePassword` in interface `HttpServer`
Returns:
  The keystore password

#### getTrustStorePath

    public java.lang.String getTrustStorePath()

Specified by:
  `getTrustStorePath` in interface `HttpServer`
Returns:
  The trust store path

#### getTrustStorePassword

    public java.lang.String getTrustStorePassword()

Specified by:
  `getTrustStorePassword` in interface `HttpServer`
Returns:
  The trust store password