java.lang.Object
cloud.piranha.http.jdk.JdkHttpServer
- All Implemented Interfaces:
HttpServer
public class JdkHttpServer extends java.lang.Object implements HttpServer
The JDK implementation of HTTP Server.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
Constructors Constructor Description JdkHttpServer()
ConstructorJdkHttpServer(int serverPort, HttpServerProcessor processor, boolean ssl)
Constructor. -
Method Summary
Modifier and Type Method Description HttpServerProcessor
getHttpServerProcessor()
Get the http server processorint
getServerPort()
Get the server portboolean
getSSL()
Get the SSL flagboolean
isRunning()
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
JdkHttpServer
public JdkHttpServer()Constructor -
JdkHttpServer
Constructor.- Parameters:
serverPort
- the port number.processor
- the HTTP server processor.ssl
- the SSL enabled flag.
-
-
Method Details
-
isRunning
public boolean isRunning()Description copied from interface:HttpServer
Check if the server is running.- Specified by:
isRunning
in interfaceHttpServer
- Returns:
- true if it is, false otherwise.
-
start
public void start()Description copied from interface:HttpServer
Start the server.- Specified by:
start
in interfaceHttpServer
-
stop
public void stop()Description copied from interface:HttpServer
Stop the server.- Specified by:
stop
in interfaceHttpServer
-
getServerPort
public int getServerPort()Description copied from interface:HttpServer
Get the server port- Specified by:
getServerPort
in interfaceHttpServer
- Returns:
- the server port
-
setServerPort
public void setServerPort(int serverPort)Description copied from interface:HttpServer
Set the server port- Specified by:
setServerPort
in interfaceHttpServer
- Parameters:
serverPort
- the port
-
getSSL
public boolean getSSL()Description copied from interface:HttpServer
Get the SSL flag- Specified by:
getSSL
in interfaceHttpServer
- Returns:
- the server port
-
setSSL
public void setSSL(boolean ssl)Description copied from interface:HttpServer
Set the SSL flag- Specified by:
setSSL
in interfaceHttpServer
- Parameters:
ssl
- the SSL flag
-
getHttpServerProcessor
Description copied from interface:HttpServer
Get the http server processor- Specified by:
getHttpServerProcessor
in interfaceHttpServer
- Returns:
- the http server processor
-
setHttpServerProcessor
Description copied from interface:HttpServer
Set the http server processor- Specified by:
setHttpServerProcessor
in interfaceHttpServer
- Parameters:
httpServerProcessor
- the http server processor
-