Class GrpcMethod
java.lang.Object
com.codename1.backend.grpc.GrpcMethod
One method a GrpcServer serves: its path, its shape, the codecs of its
messages and the code that runs it.
The build generates these from @GrpcService beans, so nothing is looked up
by name at run time. They can also be built by hand with the factories.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRuns a bidirectional streaming method.static interfaceRuns a client streaming method.static interfaceRuns a server streaming method.static interfaceRuns a unary method. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intStreams both ways.static final intA stream of requests, one response.static final intOne request, a stream of responses.static final intOne request, one response. -
Method Summary
Modifier and TypeMethodDescriptionstatic GrpcMethodbidiStreaming(String service, String method, ProtoCodec req, ProtoCodec resp, GrpcMethod.BidiStreaming invoker) static GrpcMethodclientStreaming(String service, String method, ProtoCodec req, ProtoCodec resp, GrpcMethod.ClientStreaming invoker) intgetKind()getPath()static GrpcMethodserverStreaming(String service, String method, ProtoCodec req, ProtoCodec resp, GrpcMethod.ServerStreaming invoker) static GrpcMethodunary(String service, String method, ProtoCodec req, ProtoCodec resp, GrpcMethod.Unary invoker)
-
Field Details
-
UNARY
public static final int UNARYOne request, one response.- See Also:
-
SERVER_STREAMING
public static final int SERVER_STREAMINGOne request, a stream of responses.- See Also:
-
CLIENT_STREAMING
public static final int CLIENT_STREAMINGA stream of requests, one response.- See Also:
-
BIDI_STREAMING
public static final int BIDI_STREAMINGStreams both ways.- See Also:
-
-
Method Details
-
unary
public static GrpcMethod unary(String service, String method, ProtoCodec req, ProtoCodec resp, GrpcMethod.Unary invoker) - Parameters:
service- the fully qualified service,package.Servicemethod- the method namereq- the request codecresp- the response codecinvoker- the code- Returns:
- the method
-
serverStreaming
public static GrpcMethod serverStreaming(String service, String method, ProtoCodec req, ProtoCodec resp, GrpcMethod.ServerStreaming invoker) - Parameters:
service- the fully qualified service,package.Servicemethod- the method namereq- the request codecresp- the response codecinvoker- the code- Returns:
- the method
-
clientStreaming
public static GrpcMethod clientStreaming(String service, String method, ProtoCodec req, ProtoCodec resp, GrpcMethod.ClientStreaming invoker) - Parameters:
service- the fully qualified service,package.Servicemethod- the method namereq- the request codecresp- the response codecinvoker- the code- Returns:
- the method
-
bidiStreaming
public static GrpcMethod bidiStreaming(String service, String method, ProtoCodec req, ProtoCodec resp, GrpcMethod.BidiStreaming invoker) - Parameters:
service- the fully qualified service,package.Servicemethod- the method namereq- the request codecresp- the response codecinvoker- the code- Returns:
- the method
-
getPath
- Returns:
/package.Service/Method
-
getKind
public int getKind()- Returns:
- one of
UNARY,SERVER_STREAMING,CLIENT_STREAMING,BIDI_STREAMING
-