Class HttpServerImpl
java.lang.Object
com.github.toolarium.network.server.impl.HttpServerImpl
- All Implemented Interfaces:
IHttpServer
Defines a http server
NIO: see samples http://www.java2s.com/example/java/network/echo-server-via-serversocketchannel.html http://www.java2s.com/example/java/network/echo-client-via-socketchannel.html
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the http server informationvoidinit(IHttpServerLogger httpServerLogger, IHttpAccessLogger httpAccessLogger) Initialise http servervoidstart(IHttpService inputHttpService, int port) Start the servervoidstart(IHttpService inputHttpService, int port, SSLContext sslContext) Start the servervoidstop()Stop the server
-
Constructor Details
-
HttpServerImpl
public HttpServerImpl()Constructor for HttpServer
-
-
Method Details
-
init
Description copied from interface:IHttpServerInitialise http server- Specified by:
initin interfaceIHttpServer- Parameters:
httpServerLogger- the server loggerhttpAccessLogger- the access logger- See Also:
-
start
Description copied from interface:IHttpServerStart the server- Specified by:
startin interfaceIHttpServer- Parameters:
inputHttpService- the http serviceport- the port- Throws:
IOException- In case of an I/O error- See Also:
-
start
public void start(IHttpService inputHttpService, int port, SSLContext sslContext) throws IOException Description copied from interface:IHttpServerStart the server- Specified by:
startin interfaceIHttpServer- Parameters:
inputHttpService- the http serviceport- the portsslContext- the ssl context- Throws:
IOException- In case of an I/O error- See Also:
-
stop
Description copied from interface:IHttpServerStop the server- Specified by:
stopin interfaceIHttpServer- Throws:
IOException- In case of an I/O error- See Also:
-
getHttpServerInformation
Description copied from interface:IHttpServerGet the http server information- Specified by:
getHttpServerInformationin interfaceIHttpServer- Returns:
- the http server information
- See Also:
-