Class WebSocketWebResource

java.lang.Object
org.apache.pulsar.websocket.admin.WebSocketWebResource
Direct Known Subclasses:
WebSocketProxyStatsBase

public class WebSocketWebResource extends Object
  • Field Details

    • ATTRIBUTE_PROXY_SERVICE_NAME

      public static final String ATTRIBUTE_PROXY_SERVICE_NAME
      See Also:
    • ADMIN_PATH_V1

      public static final String ADMIN_PATH_V1
      See Also:
    • ADMIN_PATH_V2

      public static final String ADMIN_PATH_V2
      See Also:
    • servletContext

      @Context protected javax.servlet.ServletContext servletContext
    • httpRequest

      @Context protected javax.servlet.http.HttpServletRequest httpRequest
    • uri

      @Context protected javax.ws.rs.core.UriInfo uri
  • Constructor Details

    • WebSocketWebResource

      public WebSocketWebResource()
  • Method Details

    • service

      protected WebSocketService service()
    • clientAppId

      public String clientAppId()
      Gets a caller id (IP + role).
      Returns:
      the web service caller identification
    • authData

      Throws:
      AuthenticationException
    • validateSuperUserAccess

      protected void validateSuperUserAccess()
      Checks whether the user has Pulsar Super-User access to the system.
      Throws:
      org.apache.pulsar.common.util.RestException - if not authorized
    • validateUserAccess

      protected void validateUserAccess(org.apache.pulsar.common.naming.TopicName topic)
      Checks if user has super-user access or user is authorized to produce/consume on a given topic.
      Parameters:
      topic -
      Throws:
      org.apache.pulsar.common.util.RestException
    • isAuthorized

      protected boolean isAuthorized(org.apache.pulsar.common.naming.TopicName topic) throws Exception
      Checks if user is authorized to produce/consume on a given topic.
      Parameters:
      topic -
      Returns:
      Throws:
      Exception