com.hedera.hashgraph.sdk.proto.mirror.NetworkServiceGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-full Show documentation
Show all versions of sdk-full Show documentation
Hedera™ Hashgraph SDK for Java
The newest version!
package com.hedera.hashgraph.sdk.proto.mirror;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*
**
* Provides cross network APIs like address book queries
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.50.2)",
comments = "Source: mirror/mirror_network_service.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class NetworkServiceGrpc {
private NetworkServiceGrpc() {}
public static final String SERVICE_NAME = "com.hedera.mirror.api.proto.NetworkService";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getGetNodesMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "getNodes",
requestType = com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.class,
responseType = com.hedera.hashgraph.sdk.proto.NodeAddress.class,
methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
public static io.grpc.MethodDescriptor getGetNodesMethod() {
io.grpc.MethodDescriptor getGetNodesMethod;
if ((getGetNodesMethod = NetworkServiceGrpc.getGetNodesMethod) == null) {
synchronized (NetworkServiceGrpc.class) {
if ((getGetNodesMethod = NetworkServiceGrpc.getGetNodesMethod) == null) {
NetworkServiceGrpc.getGetNodesMethod = getGetNodesMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "getNodes"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.hedera.hashgraph.sdk.proto.NodeAddress.getDefaultInstance()))
.setSchemaDescriptor(new NetworkServiceMethodDescriptorSupplier("getNodes"))
.build();
}
}
}
return getGetNodesMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static NetworkServiceStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public NetworkServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new NetworkServiceStub(channel, callOptions);
}
};
return NetworkServiceStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static NetworkServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public NetworkServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new NetworkServiceBlockingStub(channel, callOptions);
}
};
return NetworkServiceBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static NetworkServiceFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public NetworkServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new NetworkServiceFutureStub(channel, callOptions);
}
};
return NetworkServiceFutureStub.newStub(factory, channel);
}
/**
*
**
* Provides cross network APIs like address book queries
*
*/
public static abstract class NetworkServiceImplBase implements io.grpc.BindableService {
/**
*
* Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The
* response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on
* the network since it is reconstructed from a normalized database table.
*
*/
public void getNodes(com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNodesMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getGetNodesMethod(),
io.grpc.stub.ServerCalls.asyncServerStreamingCall(
new MethodHandlers<
com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery,
com.hedera.hashgraph.sdk.proto.NodeAddress>(
this, METHODID_GET_NODES)))
.build();
}
}
/**
*
**
* Provides cross network APIs like address book queries
*
*/
public static final class NetworkServiceStub extends io.grpc.stub.AbstractAsyncStub {
private NetworkServiceStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected NetworkServiceStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new NetworkServiceStub(channel, callOptions);
}
/**
*
* Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The
* response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on
* the network since it is reconstructed from a normalized database table.
*
*/
public void getNodes(com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncServerStreamingCall(
getChannel().newCall(getGetNodesMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*
**
* Provides cross network APIs like address book queries
*
*/
public static final class NetworkServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
private NetworkServiceBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected NetworkServiceBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new NetworkServiceBlockingStub(channel, callOptions);
}
/**
*
* Query for an address book and return its nodes. The nodes are returned in ascending order by node ID. The
* response is not guaranteed to be a byte-for-byte equivalent to the NodeAddress in the Hedera file on
* the network since it is reconstructed from a normalized database table.
*
*/
public java.util.Iterator getNodes(
com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery request) {
return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
getChannel(), getGetNodesMethod(), getCallOptions(), request);
}
}
/**
*
**
* Provides cross network APIs like address book queries
*
*/
public static final class NetworkServiceFutureStub extends io.grpc.stub.AbstractFutureStub {
private NetworkServiceFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected NetworkServiceFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new NetworkServiceFutureStub(channel, callOptions);
}
}
private static final int METHODID_GET_NODES = 0;
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 NetworkServiceImplBase serviceImpl;
private final int methodId;
MethodHandlers(NetworkServiceImplBase 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_NODES:
serviceImpl.getNodes((com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery) 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 NetworkServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
NetworkServiceBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.hedera.hashgraph.sdk.proto.mirror.MirrorNetworkService.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("NetworkService");
}
}
private static final class NetworkServiceFileDescriptorSupplier
extends NetworkServiceBaseDescriptorSupplier {
NetworkServiceFileDescriptorSupplier() {}
}
private static final class NetworkServiceMethodDescriptorSupplier
extends NetworkServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
NetworkServiceMethodDescriptorSupplier(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 (NetworkServiceGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new NetworkServiceFileDescriptorSupplier())
.addMethod(getGetNodesMethod())
.build();
}
}
}
return result;
}
}