- All Known Implementing Classes:
DefaultHttpServer
,GrizzlyHttpServer
,JdkHttpServer
,NettyHttpServer
,UndertowHttpServer
public interface HttpServer
The HTTP Server API.
This API makes it possible to interact with an HTTP server implementation on a very basic level. It supports the following:
- Starting the server.
- Stopping the server.
- Checking if the server is running.
- Set/get the port of the server.
- Set/get the SSL flag.
- Set/get the HttpServerProcessor.
- Author:
- Manfred Riem ([email protected])
-
Method Summary
Modifier and TypeMethodDescriptionReturns the http server processor.int
Returns the server port.boolean
getSSL()
Get the SSL flagboolean
Check if the server is running.void
setHttpServerProcessor
(HttpServerProcessor httpServerProcessor) Set the http server processorvoid
setServerPort
(int serverPort) Set the server portvoid
setSSL
(boolean ssl) Set the SSL flagvoid
start()
Start the server.void
stop()
Stop the server.
-
Method Details
-
isRunning
boolean isRunning()Check if the server is running.- Returns:
- true if it is, false otherwise.
-
start
void start()Start the server. -
stop
void stop()Stop the server. -
getServerPort
int getServerPort()Returns the server port.- Returns:
- the server port
-
setServerPort
void setServerPort(int serverPort) Set the server port- Parameters:
serverPort
- the port
-
getSSL
boolean getSSL()Get the SSL flag- Returns:
- the server port
-
setSSL
void setSSL(boolean ssl) Set the SSL flag- Parameters:
ssl
- the SSL flag
-
getHttpServerProcessor
HttpServerProcessor getHttpServerProcessor()Returns the http server processor.- Returns:
- the http server processor
-
setHttpServerProcessor
Set the http server processor- Parameters:
httpServerProcessor
- the http server processor
-