Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package service;
import static service.ServiceServiceGrpc.getServiceDescriptor;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
@javax.annotation.Generated(
value = "by Mutiny Grpc generator",
comments = "Source: service.proto")
public final class MutinyServiceServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc {
private MutinyServiceServiceGrpc() {}
public static MutinyServiceServiceStub newMutinyStub(io.grpc.Channel channel) {
return new MutinyServiceServiceStub(channel);
}
public static final class MutinyServiceServiceStub extends io.grpc.stub.AbstractStub<MutinyServiceServiceStub> implements io.quarkus.grpc.runtime.MutinyStub {
private ServiceServiceGrpc.ServiceServiceStub delegateStub;
private MutinyServiceServiceStub(io.grpc.Channel channel) {
super(channel);
delegateStub = ServiceServiceGrpc.newStub(channel);
}
private MutinyServiceServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
delegateStub = ServiceServiceGrpc.newStub(channel).build(channel, callOptions);
}
@Override
protected MutinyServiceServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new MutinyServiceServiceStub(channel, callOptions);
}
public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> createService(context.ContextOuterClass.Service request) {
return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createService);
}
public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> updateService(context.ContextOuterClass.Service request) {
return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::updateService);
}
public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> deleteService(context.ContextOuterClass.ServiceId request) {
return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::deleteService);
}
}
public static abstract class ServiceServiceImplBase implements io.grpc.BindableService {
private String compression;
/**
* Set whether the server will try to use a compressed response.
*
* @param compression the compression, e.g {@code gzip}
*/
public ServiceServiceImplBase withCompression(String compression) {
this.compression = compression;
return this;
}
public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> createService(context.ContextOuterClass.Service request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> updateService(context.ContextOuterClass.Service request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> deleteService(context.ContextOuterClass.ServiceId request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
service.ServiceServiceGrpc.getCreateServiceMethod(),
asyncUnaryCall(
new MethodHandlers<
context.ContextOuterClass.Service,
context.ContextOuterClass.ServiceId>(
this, METHODID_CREATE_SERVICE, compression)))
.addMethod(
service.ServiceServiceGrpc.getUpdateServiceMethod(),
asyncUnaryCall(
new MethodHandlers<
context.ContextOuterClass.Service,
context.ContextOuterClass.ServiceId>(
this, METHODID_UPDATE_SERVICE, compression)))
.addMethod(
service.ServiceServiceGrpc.getDeleteServiceMethod(),
asyncUnaryCall(
new MethodHandlers<
context.ContextOuterClass.ServiceId,
context.ContextOuterClass.Empty>(
this, METHODID_DELETE_SERVICE, compression)))
.build();
}
}
private static final int METHODID_CREATE_SERVICE = 0;
private static final int METHODID_UPDATE_SERVICE = 1;
private static final int METHODID_DELETE_SERVICE = 2;
private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final ServiceServiceImplBase serviceImpl;
private final int methodId;
private final String compression;
MethodHandlers(ServiceServiceImplBase serviceImpl, int methodId, String compression) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
this.compression = compression;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
case METHODID_CREATE_SERVICE:
io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Service) request,
(io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId>) responseObserver,
compression,
serviceImpl::createService);
break;
case METHODID_UPDATE_SERVICE:
io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Service) request,
(io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId>) responseObserver,
compression,
serviceImpl::updateService);
break;
case METHODID_DELETE_SERVICE:
io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request,
(io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver,
compression,
serviceImpl::deleteService);
break;
default:
throw new java.lang.AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
default:
throw new java.lang.AssertionError();
}
}
}
}