Class WebSocketWebResource
- java.lang.Object
-
- org.apache.pulsar.websocket.admin.WebSocketWebResource
-
- Direct Known Subclasses:
WebSocketProxyStatsBase
public class WebSocketWebResource extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringADMIN_PATH_V1static java.lang.StringADMIN_PATH_V2static java.lang.StringATTRIBUTE_PROXY_SERVICE_NAMEprotected javax.servlet.http.HttpServletRequesthttpRequestprotected javax.servlet.ServletContextservletContextprotected javax.ws.rs.core.UriInfouri
-
Constructor Summary
Constructors Constructor Description WebSocketWebResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.pulsar.broker.authentication.AuthenticationDataHttpsauthData()java.lang.StringclientAppId()Gets a caller id (IP + role).protected booleanisAuthorized(org.apache.pulsar.common.naming.TopicName topic)Checks if user is authorized to produce/consume on a given topic.protected WebSocketServiceservice()protected voidvalidateSuperUserAccess()Checks whether the user has Pulsar Super-User access to the system.protected voidvalidateUserAccess(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.
-
-
-
Field Detail
-
ATTRIBUTE_PROXY_SERVICE_NAME
public static final java.lang.String ATTRIBUTE_PROXY_SERVICE_NAME
- See Also:
- Constant Field Values
-
ADMIN_PATH_V1
public static final java.lang.String ADMIN_PATH_V1
- See Also:
- Constant Field Values
-
ADMIN_PATH_V2
public static final java.lang.String ADMIN_PATH_V2
- 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
-
-
Method Detail
-
service
protected WebSocketService service()
-
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.ExceptionChecks if user is authorized to produce/consume on a given topic.- Parameters:
topic-- Returns:
- Throws:
java.lang.Exception
-
-