Class WebSocketWebResource

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.pulsar.broker.authentication.AuthenticationDataHttps authData()  
      java.lang.String clientAppId()
      Gets a caller id (IP + role)
      protected boolean isAuthorized​(org.apache.pulsar.common.naming.TopicName topic)
      Checks if user is authorized to produce/consume on a given topic
      protected WebSocketService service()  
      protected void validateSuperUserAccess()
      Checks whether the user has Pulsar Super-User access to the system.
      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
      • Methods inherited from class java.lang.Object

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

      • ATTRIBUTE_PROXY_SERVICE_NAME

        public static final java.lang.String ATTRIBUTE_PROXY_SERVICE_NAME
        See Also:
        Constant Field Values
      • 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 Detail

      • WebSocketWebResource

        public WebSocketWebResource()
    • Method Detail

      • clientAppId

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

        public org.apache.pulsar.broker.authentication.AuthenticationDataHttps authData()
      • 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 java.lang.Exception
        Checks if user is authorized to produce/consume on a given topic
        Parameters:
        topic -
        Returns:
        Throws:
        java.lang.Exception