Interface GrpcServiceProtocol<Req extends com.google.protobuf.Message,Resp extends com.google.protobuf.Message>

Type Parameters:
Req - the type of the request messages
Resp - 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
    Modifier and Type
    Field
    Description
    static final int
    The default normal priority.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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 the Serializer 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
    onRequest(Req request, io.grpc.stub.StreamObserver<Resp> observer)
    Handle a request.
  • Field Details

    • PRIORITY_NORMAL

      static final int PRIORITY_NORMAL
      The 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

      Class<Req> getRequestType()
      Return the type of the request messages.
      Returns:
      the type of the request messages
    • getResponseType

      Class<Resp> getResponseType()
      Return the type of the response messages.
      Returns:
      the type of the response messages
    • getSerializer

      Serializer getSerializer()
      Return the Serializer 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 parent GrpcService
      request - the init request to use to initialise the protocol
      nVersion - the actual version of the protocol to use
      clientUUID - the client UUID
      observer - the StreamObserver to send non-request related responses (e.g. events)
    • onRequest

      void onRequest(Req request, io.grpc.stub.StreamObserver<Resp> observer)
      Handle a request.
      Parameters:
      request - the request to handle
      observer - the StreamObserver to send the responses to
    • close

      void close()
      Close this protocol.
    • onError

      default void onError(Throwable t)
      Handle an error.
      Parameters:
      t - the exception that was thrown