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-jdk7 Show documentation
Show all versions of sdk-jdk7 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.54.1)",
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.lite.ProtoLiteUtils.marshaller(
com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
com.hedera.hashgraph.sdk.proto.NodeAddress.getDefaultInstance()))
.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 interface AsyncService {
/**
*
* 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.
*
*/
default void getNodes(com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNodesMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service NetworkService.
*
**
* Provides cross network APIs like address book queries
*
*/
public static abstract class NetworkServiceImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return NetworkServiceGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service NetworkService.
*
**
* 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);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service NetworkService.
*
**
* 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);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service NetworkService.
*
**
* 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 AsyncService serviceImpl;
private final int methodId;
MethodHandlers(AsyncService 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();
}
}
}
public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
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>(
service, METHODID_GET_NODES)))
.build();
}
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)
.addMethod(getGetNodesMethod())
.build();
}
}
}
return result;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy