
com.daml.ledger.api.v1.CommandCompletionServiceGrpc Maven / Gradle / Ivy
package com.daml.ledger.api.v1;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*
* Allows clients to observe the status of their submissions.
* Commands may be submitted via the Command Submission Service.
* The on-ledger effects of their submissions are disclosed by the Transaction Service.
* Commands may fail in 2 distinct manners:
* 1. Failure communicated synchronously in the gRPC error of the submission.
* 2. Failure communicated asynchronously in a Completion, see ``completion.proto``.
* Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY
* choose to produce a completion event for a rejection of a duplicate command.
* Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful.
* Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions.
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: com/daml/ledger/api/v1/command_completion_service.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class CommandCompletionServiceGrpc {
private CommandCompletionServiceGrpc() {}
public static final String SERVICE_NAME = "com.daml.ledger.api.v1.CommandCompletionService";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getCompletionStreamMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CompletionStream",
requestType = com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamRequest.class,
responseType = com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
public static io.grpc.MethodDescriptor getCompletionStreamMethod() {
io.grpc.MethodDescriptor getCompletionStreamMethod;
if ((getCompletionStreamMethod = CommandCompletionServiceGrpc.getCompletionStreamMethod) == null) {
synchronized (CommandCompletionServiceGrpc.class) {
if ((getCompletionStreamMethod = CommandCompletionServiceGrpc.getCompletionStreamMethod) == null) {
CommandCompletionServiceGrpc.getCompletionStreamMethod = getCompletionStreamMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "CompletionStream"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamResponse.getDefaultInstance()))
.setSchemaDescriptor(new CommandCompletionServiceMethodDescriptorSupplier("CompletionStream"))
.build();
}
}
}
return getCompletionStreamMethod;
}
private static volatile io.grpc.MethodDescriptor getCompletionEndMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CompletionEnd",
requestType = com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndRequest.class,
responseType = com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getCompletionEndMethod() {
io.grpc.MethodDescriptor getCompletionEndMethod;
if ((getCompletionEndMethod = CommandCompletionServiceGrpc.getCompletionEndMethod) == null) {
synchronized (CommandCompletionServiceGrpc.class) {
if ((getCompletionEndMethod = CommandCompletionServiceGrpc.getCompletionEndMethod) == null) {
CommandCompletionServiceGrpc.getCompletionEndMethod = getCompletionEndMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "CompletionEnd"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndResponse.getDefaultInstance()))
.setSchemaDescriptor(new CommandCompletionServiceMethodDescriptorSupplier("CompletionEnd"))
.build();
}
}
}
return getCompletionEndMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static CommandCompletionServiceStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public CommandCompletionServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CommandCompletionServiceStub(channel, callOptions);
}
};
return CommandCompletionServiceStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static CommandCompletionServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public CommandCompletionServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CommandCompletionServiceBlockingStub(channel, callOptions);
}
};
return CommandCompletionServiceBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static CommandCompletionServiceFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public CommandCompletionServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CommandCompletionServiceFutureStub(channel, callOptions);
}
};
return CommandCompletionServiceFutureStub.newStub(factory, channel);
}
/**
*
* Allows clients to observe the status of their submissions.
* Commands may be submitted via the Command Submission Service.
* The on-ledger effects of their submissions are disclosed by the Transaction Service.
* Commands may fail in 2 distinct manners:
* 1. Failure communicated synchronously in the gRPC error of the submission.
* 2. Failure communicated asynchronously in a Completion, see ``completion.proto``.
* Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY
* choose to produce a completion event for a rejection of a duplicate command.
* Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful.
* Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions.
*
*/
public static abstract class CommandCompletionServiceImplBase implements io.grpc.BindableService {
/**
*
* Subscribe to command completion events.
*
*/
public void completionStream(com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCompletionStreamMethod(), responseObserver);
}
/**
*
* Returns the offset after the latest completion.
*
*/
public void completionEnd(com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCompletionEndMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getCompletionStreamMethod(),
io.grpc.stub.ServerCalls.asyncServerStreamingCall(
new MethodHandlers<
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamRequest,
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamResponse>(
this, METHODID_COMPLETION_STREAM)))
.addMethod(
getCompletionEndMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndRequest,
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndResponse>(
this, METHODID_COMPLETION_END)))
.build();
}
}
/**
*
* Allows clients to observe the status of their submissions.
* Commands may be submitted via the Command Submission Service.
* The on-ledger effects of their submissions are disclosed by the Transaction Service.
* Commands may fail in 2 distinct manners:
* 1. Failure communicated synchronously in the gRPC error of the submission.
* 2. Failure communicated asynchronously in a Completion, see ``completion.proto``.
* Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY
* choose to produce a completion event for a rejection of a duplicate command.
* Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful.
* Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions.
*
*/
public static final class CommandCompletionServiceStub extends io.grpc.stub.AbstractAsyncStub {
private CommandCompletionServiceStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected CommandCompletionServiceStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CommandCompletionServiceStub(channel, callOptions);
}
/**
*
* Subscribe to command completion events.
*
*/
public void completionStream(com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncServerStreamingCall(
getChannel().newCall(getCompletionStreamMethod(), getCallOptions()), request, responseObserver);
}
/**
*
* Returns the offset after the latest completion.
*
*/
public void completionEnd(com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCompletionEndMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*
* Allows clients to observe the status of their submissions.
* Commands may be submitted via the Command Submission Service.
* The on-ledger effects of their submissions are disclosed by the Transaction Service.
* Commands may fail in 2 distinct manners:
* 1. Failure communicated synchronously in the gRPC error of the submission.
* 2. Failure communicated asynchronously in a Completion, see ``completion.proto``.
* Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY
* choose to produce a completion event for a rejection of a duplicate command.
* Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful.
* Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions.
*
*/
public static final class CommandCompletionServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
private CommandCompletionServiceBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected CommandCompletionServiceBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CommandCompletionServiceBlockingStub(channel, callOptions);
}
/**
*
* Subscribe to command completion events.
*
*/
public java.util.Iterator completionStream(
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamRequest request) {
return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
getChannel(), getCompletionStreamMethod(), getCallOptions(), request);
}
/**
*
* Returns the offset after the latest completion.
*
*/
public com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndResponse completionEnd(com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCompletionEndMethod(), getCallOptions(), request);
}
}
/**
*
* Allows clients to observe the status of their submissions.
* Commands may be submitted via the Command Submission Service.
* The on-ledger effects of their submissions are disclosed by the Transaction Service.
* Commands may fail in 2 distinct manners:
* 1. Failure communicated synchronously in the gRPC error of the submission.
* 2. Failure communicated asynchronously in a Completion, see ``completion.proto``.
* Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY
* choose to produce a completion event for a rejection of a duplicate command.
* Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful.
* Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions.
*
*/
public static final class CommandCompletionServiceFutureStub extends io.grpc.stub.AbstractFutureStub {
private CommandCompletionServiceFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected CommandCompletionServiceFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CommandCompletionServiceFutureStub(channel, callOptions);
}
/**
*
* Returns the offset after the latest completion.
*
*/
public com.google.common.util.concurrent.ListenableFuture completionEnd(
com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCompletionEndMethod(), getCallOptions()), request);
}
}
private static final int METHODID_COMPLETION_STREAM = 0;
private static final int METHODID_COMPLETION_END = 1;
private static final class MethodHandlers implements
io.grpc.stub.ServerCalls.UnaryMethod,
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
private final CommandCompletionServiceImplBase serviceImpl;
private final int methodId;
MethodHandlers(CommandCompletionServiceImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
case METHODID_COMPLETION_STREAM:
serviceImpl.completionStream((com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionStreamRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_COMPLETION_END:
serviceImpl.completionEnd((com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.CompletionEndRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
private static abstract class CommandCompletionServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
CommandCompletionServiceBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.daml.ledger.api.v1.CommandCompletionServiceOuterClass.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("CommandCompletionService");
}
}
private static final class CommandCompletionServiceFileDescriptorSupplier
extends CommandCompletionServiceBaseDescriptorSupplier {
CommandCompletionServiceFileDescriptorSupplier() {}
}
private static final class CommandCompletionServiceMethodDescriptorSupplier
extends CommandCompletionServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
CommandCompletionServiceMethodDescriptorSupplier(String methodName) {
this.methodName = methodName;
}
@java.lang.Override
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
return getServiceDescriptor().findMethodByName(methodName);
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (CommandCompletionServiceGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new CommandCompletionServiceFileDescriptorSupplier())
.addMethod(getCompletionStreamMethod())
.addMethod(getCompletionEndMethod())
.build();
}
}
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy