Class AbstractNettyHttpServer

java.lang.Object
net.officefloor.server.http.netty.AbstractNettyHttpServer
Direct Known Subclasses:
NettyHttpServerImplementation

public abstract class AbstractNettyHttpServer extends Object
Abstract Netty HTTP server.
Author:
Daniel Sagenschneider
  • Constructor Details

    • AbstractNettyHttpServer

      public AbstractNettyHttpServer(int maxRequestEntityLength)
      Instantiate.
      Parameters:
      maxRequestEntityLength - Maximum length of the request entity.
  • Method Details

    • startHttpServer

      public void startHttpServer(int httpPort, int httpsPort, SSLContext sslContext) throws Exception
      Starts the HTTP Server.
      Parameters:
      httpPort - HTTP port.
      httpsPort - HTTPS secure port.
      sslContext - SSLContext. May be null.
      Throws:
      Exception - If fails to start the HTTP Server.
    • stopHttpServer

      public void stopHttpServer() throws Exception
      Stops the HTTP server.
      Throws:
      Exception - If fails to stop the HTTP Server.
    • service

      protected abstract ProcessManager service(io.netty.channel.ChannelHandlerContext context, io.netty.handler.codec.http.HttpRequest request) throws Exception
      Services the HttpRequest.
      Parameters:
      context - ChannelHandlerContext.
      request - HttpRequest.
      Returns:
      ProcessManager.
      Throws:
      Exception - If fails to service the HttpRequest.