Class AuthenticationDataHttp
- java.lang.Object
-
- org.apache.pulsar.broker.authentication.AuthenticationDataHttp
-
- All Implemented Interfaces:
AuthenticationDataSource
- Direct Known Subclasses:
AuthenticationDataHttps
public class AuthenticationDataHttp extends java.lang.Object implements AuthenticationDataSource
-
-
Field Summary
Fields Modifier and Type Field Description protected java.net.SocketAddressremoteAddressprotected javax.servlet.http.HttpServletRequestrequestprotected java.lang.Stringsubscription
-
Constructor Summary
Constructors Constructor Description AuthenticationDataHttp(javax.servlet.http.HttpServletRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHttpAuthType()java.lang.StringgetHttpHeader(java.lang.String name)java.net.SocketAddressgetPeerAddress()java.lang.StringgetSubscription()Subscription name can be necessary for consumption.booleanhasDataFromHttp()Check if data from HTTP are available.booleanhasDataFromPeer()Check if data from peer are available.booleanhasSubscription()Check if subscription is defined available.voidsetSubscription(java.lang.String subscription)Subscription name can be necessary for consumption.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pulsar.broker.authentication.AuthenticationDataSource
authenticate, getCommandData, getTlsCertificates, hasDataFromCommand, hasDataFromTls
-
-
-
-
Method Detail
-
hasDataFromHttp
public boolean hasDataFromHttp()
Description copied from interface:AuthenticationDataSourceCheck if data from HTTP are available.- Specified by:
hasDataFromHttpin interfaceAuthenticationDataSource- Returns:
- true if this authentication data contain data from HTTP
-
getHttpAuthType
public java.lang.String getHttpAuthType()
- Specified by:
getHttpAuthTypein interfaceAuthenticationDataSource- Returns:
- a authentication scheme, or
nullif the request is not be authenticated.
-
getHttpHeader
public java.lang.String getHttpHeader(java.lang.String name)
- Specified by:
getHttpHeaderin interfaceAuthenticationDataSource- Returns:
- a
Stringcontaining the value of the specified header, ornullif the header does not exist.
-
hasDataFromPeer
public boolean hasDataFromPeer()
Description copied from interface:AuthenticationDataSourceCheck if data from peer are available.- Specified by:
hasDataFromPeerin interfaceAuthenticationDataSource- Returns:
- true if this authentication data contain data from peer
-
getPeerAddress
public java.net.SocketAddress getPeerAddress()
- Specified by:
getPeerAddressin interfaceAuthenticationDataSource- Returns:
- a
Stringcontaining the IP address of the client
-
hasSubscription
public boolean hasSubscription()
Description copied from interface:AuthenticationDataSourceCheck if subscription is defined available.- Specified by:
hasSubscriptionin interfaceAuthenticationDataSource- Returns:
- true if this authentication data contain subscription
-
setSubscription
public void setSubscription(java.lang.String subscription)
Description copied from interface:AuthenticationDataSourceSubscription name can be necessary for consumption.- Specified by:
setSubscriptionin interfaceAuthenticationDataSource
-
getSubscription
public java.lang.String getSubscription()
Description copied from interface:AuthenticationDataSourceSubscription name can be necessary for consumption.- Specified by:
getSubscriptionin interfaceAuthenticationDataSource- Returns:
- a
Stringcontaining the subscription name
-
-