org.hyperledger.protos.PeerGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fabric-java-sdk Show documentation
Show all versions of fabric-java-sdk Show documentation
This is a fork of Hyperledger Fabric fabric-sdk-java
package org.hyperledger.protos;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.MethodDescriptor.generateFullMethodName;
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;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
/**
*
* Interface exported by the server.
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 0.15.0)",
comments = "Source: fabric.proto")
public class PeerGrpc {
private PeerGrpc() {}
public static final String SERVICE_NAME = "protos.Peer";
// Static method descriptors that strictly reflect the proto.
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor METHOD_CHAT =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
generateFullMethodName(
"protos.Peer", "Chat"),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Fabric.Message.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Fabric.Message.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor METHOD_PROCESS_TRANSACTION =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"protos.Peer", "ProcessTransaction"),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Fabric.Transaction.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Fabric.Response.getDefaultInstance()));
/**
* Creates a new async stub that supports all call types for the service
*/
public static PeerStub newStub(io.grpc.Channel channel) {
return new PeerStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static PeerBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new PeerBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
*/
public static PeerFutureStub newFutureStub(
io.grpc.Channel channel) {
return new PeerFutureStub(channel);
}
/**
*
* Interface exported by the server.
*
*/
@java.lang.Deprecated public static interface Peer {
/**
*
* Accepts a stream of Message during chat session, while receiving
* other Message (e.g. from other peers).
*
*/
public io.grpc.stub.StreamObserver chat(
io.grpc.stub.StreamObserver responseObserver);
/**
*
* Process a transaction from a remote source.
*
*/
public void processTransaction(org.hyperledger.protos.Fabric.Transaction request,
io.grpc.stub.StreamObserver responseObserver);
}
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1469")
public static abstract class PeerImplBase implements Peer, io.grpc.BindableService {
@java.lang.Override
public io.grpc.stub.StreamObserver chat(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_CHAT, responseObserver);
}
@java.lang.Override
public void processTransaction(org.hyperledger.protos.Fabric.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_PROCESS_TRANSACTION, responseObserver);
}
@java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
return PeerGrpc.bindService(this);
}
}
/**
*
* Interface exported by the server.
*
*/
@java.lang.Deprecated public static interface PeerBlockingClient {
/**
*
* Process a transaction from a remote source.
*
*/
public org.hyperledger.protos.Fabric.Response processTransaction(org.hyperledger.protos.Fabric.Transaction request);
}
/**
*
* Interface exported by the server.
*
*/
@java.lang.Deprecated public static interface PeerFutureClient {
/**
*
* Process a transaction from a remote source.
*
*/
public com.google.common.util.concurrent.ListenableFuture processTransaction(
org.hyperledger.protos.Fabric.Transaction request);
}
public static class PeerStub extends io.grpc.stub.AbstractStub
implements Peer {
private PeerStub(io.grpc.Channel channel) {
super(channel);
}
private PeerStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected PeerStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new PeerStub(channel, callOptions);
}
@java.lang.Override
public io.grpc.stub.StreamObserver chat(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
getChannel().newCall(METHOD_CHAT, getCallOptions()), responseObserver);
}
@java.lang.Override
public void processTransaction(org.hyperledger.protos.Fabric.Transaction request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_PROCESS_TRANSACTION, getCallOptions()), request, responseObserver);
}
}
public static class PeerBlockingStub extends io.grpc.stub.AbstractStub
implements PeerBlockingClient {
private PeerBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private PeerBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected PeerBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new PeerBlockingStub(channel, callOptions);
}
@java.lang.Override
public org.hyperledger.protos.Fabric.Response processTransaction(org.hyperledger.protos.Fabric.Transaction request) {
return blockingUnaryCall(
getChannel(), METHOD_PROCESS_TRANSACTION, getCallOptions(), request);
}
}
public static class PeerFutureStub extends io.grpc.stub.AbstractStub
implements PeerFutureClient {
private PeerFutureStub(io.grpc.Channel channel) {
super(channel);
}
private PeerFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected PeerFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new PeerFutureStub(channel, callOptions);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture processTransaction(
org.hyperledger.protos.Fabric.Transaction request) {
return futureUnaryCall(
getChannel().newCall(METHOD_PROCESS_TRANSACTION, getCallOptions()), request);
}
}
@java.lang.Deprecated public static abstract class AbstractPeer extends PeerImplBase {}
private static final int METHODID_PROCESS_TRANSACTION = 0;
private static final int METHODID_CHAT = 1;
private static 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 Peer serviceImpl;
private final int methodId;
public MethodHandlers(Peer 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_PROCESS_TRANSACTION:
serviceImpl.processTransaction((org.hyperledger.protos.Fabric.Transaction) 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) {
case METHODID_CHAT:
return (io.grpc.stub.StreamObserver) serviceImpl.chat(
(io.grpc.stub.StreamObserver) responseObserver);
default:
throw new AssertionError();
}
}
}
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
return new io.grpc.ServiceDescriptor(SERVICE_NAME,
METHOD_CHAT,
METHOD_PROCESS_TRANSACTION);
}
@java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService(
final Peer serviceImpl) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
METHOD_CHAT,
asyncBidiStreamingCall(
new MethodHandlers<
org.hyperledger.protos.Fabric.Message,
org.hyperledger.protos.Fabric.Message>(
serviceImpl, METHODID_CHAT)))
.addMethod(
METHOD_PROCESS_TRANSACTION,
asyncUnaryCall(
new MethodHandlers<
org.hyperledger.protos.Fabric.Transaction,
org.hyperledger.protos.Fabric.Response>(
serviceImpl, METHODID_PROCESS_TRANSACTION)))
.build();
}
}