Package org.apache.pulsar.proxy.server
Class WebServer
java.lang.Object
org.apache.pulsar.proxy.server.WebServer
Manages web-service startup/stop on jetty server.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebServer(ProxyConfiguration config, AuthenticationService authenticationService) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRestResource(String basePath, String attribute, Object attributeValue, Class<?> resourceClass) Add a REST resource to the servlet context with authentication coverage.voidaddRestResource(String basePath, String attribute, Object attributeValue, Class<?> resourceClass, boolean requireAuthentication) Add a REST resource to the servlet context.voidaddServlet(String basePath, org.eclipse.jetty.servlet.ServletHolder servletHolder) voidaddServlet(String basePath, org.eclipse.jetty.servlet.ServletHolder servletHolder, List<org.apache.commons.lang3.tuple.Pair<String, Object>> attributes) voidaddServlet(String basePath, org.eclipse.jetty.servlet.ServletHolder servletHolder, List<org.apache.commons.lang3.tuple.Pair<String, Object>> attributes, boolean requireAuthentication) intbooleanvoidstart()voidstop()
-
Field Details
-
externalServicePort
protected int externalServicePort
-
-
Constructor Details
-
WebServer
-
-
Method Details
-
getServiceUri
-
addServlet
-
addServlet
-
addServlet
-
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
- Throws:
Exception
-
stop
- Throws:
Exception
-
isStarted
public boolean isStarted() -
getListenPortHTTP
-
getListenPortHTTPS
-