Go to the documentation of this file.
19 #ifndef GRPCPP_SUPPORT_INTERCEPTOR_H
20 #define GRPCPP_SUPPORT_INTERCEPTOR_H
34 class ChannelInterface;
37 namespace experimental {
116 virtual void Hijack() = 0;
174 virtual std::multimap<std::string, std::string>*
187 virtual std::multimap<grpc::string_ref, grpc::string_ref>*
196 virtual std::multimap<grpc::string_ref, grpc::string_ref>*
230 #endif // GRPCPP_SUPPORT_INTERCEPTOR_H
virtual Status * GetRecvStatus()=0
Returns a modifiable view of the received status on PRE_RECV_STATUS and POST_RECV_STATUS interception...
virtual void Intercept(InterceptorBatchMethods *methods)=0
The one public method of an Interceptor interface.
virtual bool QueryInterceptionHookPoint(InterceptionHookPoints type)=0
Determine whether the current batch has an interception hook point of type type.
virtual void FailHijackedRecvMessage()=0
On a hijacked RPC, an interceptor can decide to fail a PRE_RECV_MESSAGE op.
@ PRE_SEND_INITIAL_METADATA
The first three in this list are for clients and servers.
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
virtual std::multimap< std::string, std::string > * GetSendInitialMetadata()=0
Returns a modifiable multimap of the initial metadata to be sent.
@ POST_RECV_INITIAL_METADATA
The following two are for all clients and servers.
virtual void FailHijackedSendMessage()=0
On a hijacked RPC/ to-be hijacked RPC, this can be called to fail a SEND MESSAGE op.
virtual const void * GetSendMessage()=0
Returns a non-modifiable pointer to the non-serialized form of the message to be sent.
virtual void Hijack()=0
Indicate that the interceptor has hijacked the RPC (only valid if the batch contains send_initial_met...
virtual void * GetRecvMessage()=0
Returns a pointer to the modifiable received message.
virtual bool GetSendMessageStatus()=0
Checks whether the SEND MESSAGE op succeeded.
@ PRE_SEND_CANCEL
This is a special hook point available to both clients and servers when TryCancel() is performed.
virtual void ModifySendMessage(const void *message)=0
Overwrites the message to be sent with message.
Did it work? If it didn't, why?
Definition: status.h:34
virtual std::unique_ptr< ChannelInterface > GetInterceptedChannel()=0
Gets an intercepted channel.
virtual std::multimap< grpc::string_ref, grpc::string_ref > * GetRecvTrailingMetadata()=0
Returns a modifiable multimap of the received trailing metadata on PRE_RECV_STATUS and POST_RECV_STAT...
virtual std::multimap< grpc::string_ref, grpc::string_ref > * GetRecvInitialMetadata()=0
Returns a modifiable multimap of the received initial metadata.
A sequence of bytes.
Definition: byte_buffer.h:60
virtual ~Interceptor()
Definition: interceptor.h:220
virtual ByteBuffer * GetSerializedSendMessage()=0
Send Message Methods GetSerializedSendMessage and GetSendMessage/ModifySendMessage are the available ...
virtual ~InterceptorBatchMethods()
Definition: interceptor.h:97
Interface for an interceptor.
Definition: interceptor.h:218
virtual Status GetSendStatus()=0
Returns the status to be sent. Valid for PRE_SEND_STATUS interceptions.
virtual void ModifySendStatus(const Status &status)=0
Overwrites the status with status.
Class that is passed as an argument to the Intercept method of the application's Interceptor interfac...
Definition: interceptor.h:95
virtual std::multimap< std::string, std::string > * GetSendTrailingMetadata()=0
Returns a modifiable multimap of the trailing metadata to be sent.
virtual void Proceed()=0
Signal that the interceptor is done intercepting the current batch of the RPC.
::absl::Status Status
Definition: config_protobuf.h:106
InterceptionHookPoints
An enumeration of different possible points at which the Intercept method of the Interceptor interfac...
Definition: interceptor.h:56
@ PRE_RECV_INITIAL_METADATA
The following three are for hijacked clients only.