Package com.oracle.coherence.grpc
Interface GrpcServiceProtocol<Req extends com.google.protobuf.Message,Resp extends com.google.protobuf.Message>
- Type Parameters:
Req
- the type of the request messagesResp
- the type of the response messages
- All Known Subinterfaces:
NamedCacheProtocol<Req,
,Resp> NamedQueueProtocol<Req,
Resp>
- All Known Implementing Classes:
BaseProxyProtocol
,NamedCacheProxyProtocol
,NamedQueueProxyProtocol
public interface GrpcServiceProtocol<Req extends com.google.protobuf.Message,Resp extends com.google.protobuf.Message>
A Coherence gRPC message protocol.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this protocol.default int
Return the priority for this protocol.Return the name of this protocol.Return the type of the request messages.Return the type of the response messages.Return theSerializer
to use to serialize response data.int
Return the minimum version of the protocol this instance supports.int
Return the version of the protocol.void
init
(GrpcService service, com.oracle.coherence.grpc.messages.proxy.v1.InitRequest request, int nVersion, UUID clientUUID, io.grpc.stub.StreamObserver<Resp> observer) Initialise this protocol.default void
Handle an error.void
Handle a request.
-
Field Details
-
PRIORITY_NORMAL
static final int PRIORITY_NORMALThe default normal priority.- See Also:
-
-
Method Details
-
getPriority
default int getPriority()Return the priority for this protocol.- Returns:
- the priority for this protocol
-
getProtocol
String getProtocol()Return the name of this protocol.- Returns:
- the name of this protocol
-
getVersion
int getVersion()Return the version of the protocol.- Returns:
- the version of the protocol
-
getSupportedVersion
int getSupportedVersion()Return the minimum version of the protocol this instance supports.- Returns:
- the minimum version of the protocol this instance supports
-
getRequestType
Return the type of the request messages.- Returns:
- the type of the request messages
-
getResponseType
Return the type of the response messages.- Returns:
- the type of the response messages
-
getSerializer
Serializer getSerializer()Return theSerializer
to use to serialize response data.- Returns:
- the
Serializer
to use to serialize response data
-
init
void init(GrpcService service, com.oracle.coherence.grpc.messages.proxy.v1.InitRequest request, int nVersion, UUID clientUUID, io.grpc.stub.StreamObserver<Resp> observer) Initialise this protocol.- Parameters:
service
- the parentGrpcService
request
- the init request to use to initialise the protocolnVersion
- the actual version of the protocol to useclientUUID
- the clientUUID
observer
- theStreamObserver
to send non-request related responses (e.g. events)
-
onRequest
Handle a request.- Parameters:
request
- the request to handleobserver
- theStreamObserver
to send the responses to
-
close
void close()Close this protocol. -
onError
Handle an error.- Parameters:
t
- the exception that was thrown
-