Class AbstractNettyHttpServer

  • Direct Known Subclasses:
    NettyHttpServerImplementation

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

      Constructors 
      Constructor Description
      AbstractNettyHttpServer​(int maxRequestEntityLength)
      Instantiate.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract ProcessManager service​(io.netty.channel.ChannelHandlerContext context, io.netty.handler.codec.http.HttpRequest request)
      Services the HttpRequest.
      void startHttpServer​(int httpPort, int httpsPort, javax.net.ssl.SSLContext sslContext)
      Starts the HTTP Server.
      void stopHttpServer()
      Stops the HTTP server.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractNettyHttpServer

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

      • startHttpServer

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

        public void stopHttpServer()
                            throws java.lang.Exception
        Stops the HTTP server.
        Throws:
        java.lang.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 java.lang.Exception
        Services the HttpRequest.
        Parameters:
        context - ChannelHandlerContext.
        request - HttpRequest.
        Returns:
        ProcessManager.
        Throws:
        java.lang.Exception - If fails to service the HttpRequest.