Class WebSocketWebResource
java.lang.Object
org.apache.pulsar.websocket.admin.WebSocketWebResource
- Direct Known Subclasses:
WebSocketProxyStatsBase
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthData()Gets a caller id (IP + role).protected booleanisAuthorized(TopicName topic) Checks if user is authorized to produce/consume on a given topic.protected WebSocketServiceservice()protected voidChecks whether the user has Pulsar Super-User access to the system.protected voidvalidateUserAccess(TopicName topic) Checks if user has super-user access or user is authorized to produce/consume on a given topic.
-
Field Details
-
ATTRIBUTE_PROXY_SERVICE_NAME
- See Also:
-
ADMIN_PATH_V1
- See Also:
-
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
-
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:
RestException- if not authorized
-
validateUserAccess
Checks if user has super-user access or user is authorized to produce/consume on a given topic.- Parameters:
topic-- Throws:
RestException
-
isAuthorized
Checks if user is authorized to produce/consume on a given topic.- Parameters:
topic-- Returns:
- Throws:
Exception
-