public class BrokerInterceptors extends Object implements BrokerInterceptor
BrokerInterceptor.BrokerInterceptorDisabledDISABLED| Constructor and Description |
|---|
BrokerInterceptors(Map<String,BrokerInterceptorWithClassLoader> interceptors) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeSendMessage(Subscription subscription,
Entry entry,
long[] ackSet,
org.apache.pulsar.common.api.proto.MessageMetadata msgMetadata)
Intercept messages before sending them to the consumers.
|
void |
close()
Close this broker interceptor.
|
void |
initialize(PulsarService pulsarService)
Initialize the broker interceptor.
|
static BrokerInterceptor |
load(ServiceConfiguration conf)
Load the broker event interceptor for the given interceptor list.
|
void |
onConnectionClosed(ServerCnx cnx)
Called by the broker while connection closed.
|
void |
onPulsarCommand(org.apache.pulsar.common.api.proto.BaseCommand command,
ServerCnx cnx)
Called by the broker while new command incoming.
|
void |
onWebserviceRequest(javax.servlet.ServletRequest request)
Called by the web service while new request incoming.
|
void |
onWebserviceResponse(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Intercept the webservice response before send to client.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonFilterpublic BrokerInterceptors(Map<String,BrokerInterceptorWithClassLoader> interceptors)
public static BrokerInterceptor load(ServiceConfiguration conf) throws IOException
conf - the pulsar broker service configurationIOExceptionpublic void beforeSendMessage(Subscription subscription, Entry entry, long[] ackSet, org.apache.pulsar.common.api.proto.MessageMetadata msgMetadata)
BrokerInterceptorbeforeSendMessage in interface BrokerInterceptorsubscription - pulsar subscriptionentry - entryackSet - entry ack bitset. it is either null or an array of long-based bitsets.msgMetadata - message metadata. The message metadata will be recycled after this call.public void onPulsarCommand(org.apache.pulsar.common.api.proto.BaseCommand command,
ServerCnx cnx)
throws org.apache.pulsar.common.intercept.InterceptException
BrokerInterceptoronPulsarCommand in interface BrokerInterceptororg.apache.pulsar.common.intercept.InterceptExceptionpublic void onConnectionClosed(ServerCnx cnx)
BrokerInterceptoronConnectionClosed in interface BrokerInterceptorpublic void onWebserviceRequest(javax.servlet.ServletRequest request)
throws IOException,
javax.servlet.ServletException,
org.apache.pulsar.common.intercept.InterceptException
BrokerInterceptoronWebserviceRequest in interface BrokerInterceptorIOExceptionjavax.servlet.ServletExceptionorg.apache.pulsar.common.intercept.InterceptExceptionpublic void onWebserviceResponse(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws IOException,
javax.servlet.ServletException
BrokerInterceptoronWebserviceResponse in interface BrokerInterceptorIOExceptionjavax.servlet.ServletExceptionpublic void initialize(PulsarService pulsarService) throws Exception
BrokerInterceptorinitialize in interface BrokerInterceptorException - when fail to initialize the broker interceptor.public void close()
BrokerInterceptorclose in interface AutoCloseableclose in interface BrokerInterceptorCopyright © 2017–2022 Apache Software Foundation. All rights reserved.