Class WebServer

java.lang.Object
org.apache.pulsar.proxy.server.WebServer

public class WebServer extends Object
Manages web-service startup/stop on jetty server.
  • Field Details

    • externalServicePort

      protected int externalServicePort
  • Constructor Details

  • Method Details

    • getServiceUri

      public URI getServiceUri()
    • addServlet

      public void addServlet(String basePath, org.eclipse.jetty.servlet.ServletHolder servletHolder)
    • addServlet

      public void addServlet(String basePath, org.eclipse.jetty.servlet.ServletHolder servletHolder, List<org.apache.commons.lang3.tuple.Pair<String,Object>> attributes)
    • addServlet

      public void addServlet(String basePath, org.eclipse.jetty.servlet.ServletHolder servletHolder, List<org.apache.commons.lang3.tuple.Pair<String,Object>> attributes, boolean requireAuthentication)
    • addRestResource

      public void addRestResource(String basePath, String attribute, Object attributeValue, Class<?> resourceClass)
      Add a REST resource to the servlet context with authentication coverage.
      Parameters:
      basePath - The base path for the resource.
      attribute - An attribute associated with the resource.
      attributeValue - The value of the attribute.
      resourceClass - The class representing the resource.
      See Also:
    • addRestResource

      public void addRestResource(String basePath, String attribute, Object attributeValue, Class<?> resourceClass, boolean requireAuthentication)
      Add a REST resource to the servlet context.
      Parameters:
      basePath - The base path for the resource.
      attribute - An attribute associated with the resource.
      attributeValue - The value of the attribute.
      resourceClass - The class representing the resource.
      requireAuthentication - A boolean indicating whether authentication is required for this resource.
    • getExternalServicePort

      public int getExternalServicePort()
    • start

      public void start() throws Exception
      Throws:
      Exception
    • stop

      public void stop() throws Exception
      Throws:
      Exception
    • isStarted

      public boolean isStarted()
    • getListenPortHTTP

      public Optional<Integer> getListenPortHTTP()
    • getListenPortHTTPS

      public Optional<Integer> getListenPortHTTPS()
    • buildSslConfiguration

      protected PulsarSslConfiguration buildSslConfiguration(ProxyConfiguration config)
    • refreshSslContext

      protected void refreshSslContext()