![JAR search and dependency download from the Maven repository](/logo.png)
org.hyperledger.protos.OpenchainGrpc 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: api.proto")
public class OpenchainGrpc {
private OpenchainGrpc() {}
public static final String SERVICE_NAME = "protos.Openchain";
// 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_GET_BLOCKCHAIN_INFO =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"protos.Openchain", "GetBlockchainInfo"),
io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Fabric.BlockchainInfo.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor METHOD_GET_BLOCK_BY_NUMBER =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"protos.Openchain", "GetBlockByNumber"),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Api.BlockNumber.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Fabric.Block.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor METHOD_GET_BLOCK_COUNT =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"protos.Openchain", "GetBlockCount"),
io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Api.BlockCount.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor METHOD_GET_PEERS =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"protos.Openchain", "GetPeers"),
io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Fabric.PeersMessage.getDefaultInstance()));
/**
* Creates a new async stub that supports all call types for the service
*/
public static OpenchainStub newStub(io.grpc.Channel channel) {
return new OpenchainStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static OpenchainBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new OpenchainBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
*/
public static OpenchainFutureStub newFutureStub(
io.grpc.Channel channel) {
return new OpenchainFutureStub(channel);
}
/**
*
* Interface exported by the server.
*
*/
@java.lang.Deprecated public static interface Openchain {
/**
*
* GetBlockchainInfo returns information about the blockchain ledger such as
* height, current block hash, and previous block hash.
*
*/
public void getBlockchainInfo(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver);
/**
*
* GetBlockByNumber returns the data contained within a specific block in the
* blockchain. The genesis block is block zero.
*
*/
public void getBlockByNumber(org.hyperledger.protos.Api.BlockNumber request,
io.grpc.stub.StreamObserver responseObserver);
/**
*
* GetBlockCount returns the current number of blocks in the blockchain data
* structure.
*
*/
public void getBlockCount(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver);
/**
*
* GetPeers returns a list of all peer nodes currently connected to the target
* peer.
*
*/
public void getPeers(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver);
}
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1469")
public static abstract class OpenchainImplBase implements Openchain, io.grpc.BindableService {
@java.lang.Override
public void getBlockchainInfo(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_GET_BLOCKCHAIN_INFO, responseObserver);
}
@java.lang.Override
public void getBlockByNumber(org.hyperledger.protos.Api.BlockNumber request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_GET_BLOCK_BY_NUMBER, responseObserver);
}
@java.lang.Override
public void getBlockCount(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_GET_BLOCK_COUNT, responseObserver);
}
@java.lang.Override
public void getPeers(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_GET_PEERS, responseObserver);
}
@java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
return OpenchainGrpc.bindService(this);
}
}
/**
*
* Interface exported by the server.
*
*/
@java.lang.Deprecated public static interface OpenchainBlockingClient {
/**
*
* GetBlockchainInfo returns information about the blockchain ledger such as
* height, current block hash, and previous block hash.
*
*/
public org.hyperledger.protos.Fabric.BlockchainInfo getBlockchainInfo(com.google.protobuf.Empty request);
/**
*
* GetBlockByNumber returns the data contained within a specific block in the
* blockchain. The genesis block is block zero.
*
*/
public org.hyperledger.protos.Fabric.Block getBlockByNumber(org.hyperledger.protos.Api.BlockNumber request);
/**
*
* GetBlockCount returns the current number of blocks in the blockchain data
* structure.
*
*/
public org.hyperledger.protos.Api.BlockCount getBlockCount(com.google.protobuf.Empty request);
/**
*
* GetPeers returns a list of all peer nodes currently connected to the target
* peer.
*
*/
public org.hyperledger.protos.Fabric.PeersMessage getPeers(com.google.protobuf.Empty request);
}
/**
*
* Interface exported by the server.
*
*/
@java.lang.Deprecated public static interface OpenchainFutureClient {
/**
*
* GetBlockchainInfo returns information about the blockchain ledger such as
* height, current block hash, and previous block hash.
*
*/
public com.google.common.util.concurrent.ListenableFuture getBlockchainInfo(
com.google.protobuf.Empty request);
/**
*
* GetBlockByNumber returns the data contained within a specific block in the
* blockchain. The genesis block is block zero.
*
*/
public com.google.common.util.concurrent.ListenableFuture getBlockByNumber(
org.hyperledger.protos.Api.BlockNumber request);
/**
*
* GetBlockCount returns the current number of blocks in the blockchain data
* structure.
*
*/
public com.google.common.util.concurrent.ListenableFuture getBlockCount(
com.google.protobuf.Empty request);
/**
*
* GetPeers returns a list of all peer nodes currently connected to the target
* peer.
*
*/
public com.google.common.util.concurrent.ListenableFuture getPeers(
com.google.protobuf.Empty request);
}
public static class OpenchainStub extends io.grpc.stub.AbstractStub
implements Openchain {
private OpenchainStub(io.grpc.Channel channel) {
super(channel);
}
private OpenchainStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected OpenchainStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new OpenchainStub(channel, callOptions);
}
@java.lang.Override
public void getBlockchainInfo(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_GET_BLOCKCHAIN_INFO, getCallOptions()), request, responseObserver);
}
@java.lang.Override
public void getBlockByNumber(org.hyperledger.protos.Api.BlockNumber request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_GET_BLOCK_BY_NUMBER, getCallOptions()), request, responseObserver);
}
@java.lang.Override
public void getBlockCount(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_GET_BLOCK_COUNT, getCallOptions()), request, responseObserver);
}
@java.lang.Override
public void getPeers(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_GET_PEERS, getCallOptions()), request, responseObserver);
}
}
public static class OpenchainBlockingStub extends io.grpc.stub.AbstractStub
implements OpenchainBlockingClient {
private OpenchainBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private OpenchainBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected OpenchainBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new OpenchainBlockingStub(channel, callOptions);
}
@java.lang.Override
public org.hyperledger.protos.Fabric.BlockchainInfo getBlockchainInfo(com.google.protobuf.Empty request) {
return blockingUnaryCall(
getChannel(), METHOD_GET_BLOCKCHAIN_INFO, getCallOptions(), request);
}
@java.lang.Override
public org.hyperledger.protos.Fabric.Block getBlockByNumber(org.hyperledger.protos.Api.BlockNumber request) {
return blockingUnaryCall(
getChannel(), METHOD_GET_BLOCK_BY_NUMBER, getCallOptions(), request);
}
@java.lang.Override
public org.hyperledger.protos.Api.BlockCount getBlockCount(com.google.protobuf.Empty request) {
return blockingUnaryCall(
getChannel(), METHOD_GET_BLOCK_COUNT, getCallOptions(), request);
}
@java.lang.Override
public org.hyperledger.protos.Fabric.PeersMessage getPeers(com.google.protobuf.Empty request) {
return blockingUnaryCall(
getChannel(), METHOD_GET_PEERS, getCallOptions(), request);
}
}
public static class OpenchainFutureStub extends io.grpc.stub.AbstractStub
implements OpenchainFutureClient {
private OpenchainFutureStub(io.grpc.Channel channel) {
super(channel);
}
private OpenchainFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected OpenchainFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new OpenchainFutureStub(channel, callOptions);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture getBlockchainInfo(
com.google.protobuf.Empty request) {
return futureUnaryCall(
getChannel().newCall(METHOD_GET_BLOCKCHAIN_INFO, getCallOptions()), request);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture getBlockByNumber(
org.hyperledger.protos.Api.BlockNumber request) {
return futureUnaryCall(
getChannel().newCall(METHOD_GET_BLOCK_BY_NUMBER, getCallOptions()), request);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture getBlockCount(
com.google.protobuf.Empty request) {
return futureUnaryCall(
getChannel().newCall(METHOD_GET_BLOCK_COUNT, getCallOptions()), request);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture getPeers(
com.google.protobuf.Empty request) {
return futureUnaryCall(
getChannel().newCall(METHOD_GET_PEERS, getCallOptions()), request);
}
}
@java.lang.Deprecated public static abstract class AbstractOpenchain extends OpenchainImplBase {}
private static final int METHODID_GET_BLOCKCHAIN_INFO = 0;
private static final int METHODID_GET_BLOCK_BY_NUMBER = 1;
private static final int METHODID_GET_BLOCK_COUNT = 2;
private static final int METHODID_GET_PEERS = 3;
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 Openchain serviceImpl;
private final int methodId;
public MethodHandlers(Openchain 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_GET_BLOCKCHAIN_INFO:
serviceImpl.getBlockchainInfo((com.google.protobuf.Empty) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_GET_BLOCK_BY_NUMBER:
serviceImpl.getBlockByNumber((org.hyperledger.protos.Api.BlockNumber) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_GET_BLOCK_COUNT:
serviceImpl.getBlockCount((com.google.protobuf.Empty) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_GET_PEERS:
serviceImpl.getPeers((com.google.protobuf.Empty) 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();
}
}
}
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
return new io.grpc.ServiceDescriptor(SERVICE_NAME,
METHOD_GET_BLOCKCHAIN_INFO,
METHOD_GET_BLOCK_BY_NUMBER,
METHOD_GET_BLOCK_COUNT,
METHOD_GET_PEERS);
}
@java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService(
final Openchain serviceImpl) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
METHOD_GET_BLOCKCHAIN_INFO,
asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
org.hyperledger.protos.Fabric.BlockchainInfo>(
serviceImpl, METHODID_GET_BLOCKCHAIN_INFO)))
.addMethod(
METHOD_GET_BLOCK_BY_NUMBER,
asyncUnaryCall(
new MethodHandlers<
org.hyperledger.protos.Api.BlockNumber,
org.hyperledger.protos.Fabric.Block>(
serviceImpl, METHODID_GET_BLOCK_BY_NUMBER)))
.addMethod(
METHOD_GET_BLOCK_COUNT,
asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
org.hyperledger.protos.Api.BlockCount>(
serviceImpl, METHODID_GET_BLOCK_COUNT)))
.addMethod(
METHOD_GET_PEERS,
asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
org.hyperledger.protos.Fabric.PeersMessage>(
serviceImpl, METHODID_GET_PEERS)))
.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy