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 TypeMethodDescriptionvoidclose()Close this protocol.default intReturn 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 theSerializerto use to serialize response data.intReturn the minimum version of the protocol this instance supports.intReturn the version of the protocol.voidinit(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 voidHandle an error.voidHandle 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 theSerializerto use to serialize response data.- Returns:
- the
Serializerto 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 parentGrpcServicerequest- the init request to use to initialise the protocolnVersion- the actual version of the protocol to useclientUUID- the clientUUIDobserver- theStreamObserverto send non-request related responses (e.g. events)
-
onRequest
Handle a request.- Parameters:
request- the request to handleobserver- theStreamObserverto send the responses to
-
close
void close()Close this protocol. -
onError
Handle an error.- Parameters:
t- the exception that was thrown
-