org.hyperledger.protos.TCAAGrpc 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;
/**
*
* admin service
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 0.15.0)",
comments = "Source: ca/ca.proto")
public class TCAAGrpc {
private TCAAGrpc() {}
public static final String SERVICE_NAME = "protos.TCAA";
// 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_REVOKE_CERTIFICATE =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"protos.TCAA", "RevokeCertificate"),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Ca.TCertRevokeReq.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Ca.CAStatus.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor METHOD_REVOKE_CERTIFICATE_SET =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"protos.TCAA", "RevokeCertificateSet"),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Ca.TCertRevokeSetReq.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Ca.CAStatus.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor METHOD_PUBLISH_CRL =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"protos.TCAA", "PublishCRL"),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Ca.TCertCRLReq.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(org.hyperledger.protos.Ca.CAStatus.getDefaultInstance()));
/**
* Creates a new async stub that supports all call types for the service
*/
public static TCAAStub newStub(io.grpc.Channel channel) {
return new TCAAStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static TCAABlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new TCAABlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
*/
public static TCAAFutureStub newFutureStub(
io.grpc.Channel channel) {
return new TCAAFutureStub(channel);
}
/**
*
* admin service
*
*/
@java.lang.Deprecated public static interface TCAA {
/**
*
* an admin can revoke any cert
*
*/
public void revokeCertificate(org.hyperledger.protos.Ca.TCertRevokeReq request,
io.grpc.stub.StreamObserver responseObserver);
/**
*
* an admin can revoke any cert
*
*/
public void revokeCertificateSet(org.hyperledger.protos.Ca.TCertRevokeSetReq request,
io.grpc.stub.StreamObserver responseObserver);
/**
*
* publishes CRL in the blockchain
*
*/
public void publishCRL(org.hyperledger.protos.Ca.TCertCRLReq request,
io.grpc.stub.StreamObserver responseObserver);
}
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1469")
public static abstract class TCAAImplBase implements TCAA, io.grpc.BindableService {
@java.lang.Override
public void revokeCertificate(org.hyperledger.protos.Ca.TCertRevokeReq request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_REVOKE_CERTIFICATE, responseObserver);
}
@java.lang.Override
public void revokeCertificateSet(org.hyperledger.protos.Ca.TCertRevokeSetReq request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_REVOKE_CERTIFICATE_SET, responseObserver);
}
@java.lang.Override
public void publishCRL(org.hyperledger.protos.Ca.TCertCRLReq request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_PUBLISH_CRL, responseObserver);
}
@java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
return TCAAGrpc.bindService(this);
}
}
/**
*
* admin service
*
*/
@java.lang.Deprecated public static interface TCAABlockingClient {
/**
*
* an admin can revoke any cert
*
*/
public org.hyperledger.protos.Ca.CAStatus revokeCertificate(org.hyperledger.protos.Ca.TCertRevokeReq request);
/**
*
* an admin can revoke any cert
*
*/
public org.hyperledger.protos.Ca.CAStatus revokeCertificateSet(org.hyperledger.protos.Ca.TCertRevokeSetReq request);
/**
*
* publishes CRL in the blockchain
*
*/
public org.hyperledger.protos.Ca.CAStatus publishCRL(org.hyperledger.protos.Ca.TCertCRLReq request);
}
/**
*
* admin service
*
*/
@java.lang.Deprecated public static interface TCAAFutureClient {
/**
*
* an admin can revoke any cert
*
*/
public com.google.common.util.concurrent.ListenableFuture revokeCertificate(
org.hyperledger.protos.Ca.TCertRevokeReq request);
/**
*
* an admin can revoke any cert
*
*/
public com.google.common.util.concurrent.ListenableFuture revokeCertificateSet(
org.hyperledger.protos.Ca.TCertRevokeSetReq request);
/**
*
* publishes CRL in the blockchain
*
*/
public com.google.common.util.concurrent.ListenableFuture publishCRL(
org.hyperledger.protos.Ca.TCertCRLReq request);
}
public static class TCAAStub extends io.grpc.stub.AbstractStub
implements TCAA {
private TCAAStub(io.grpc.Channel channel) {
super(channel);
}
private TCAAStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected TCAAStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new TCAAStub(channel, callOptions);
}
@java.lang.Override
public void revokeCertificate(org.hyperledger.protos.Ca.TCertRevokeReq request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_REVOKE_CERTIFICATE, getCallOptions()), request, responseObserver);
}
@java.lang.Override
public void revokeCertificateSet(org.hyperledger.protos.Ca.TCertRevokeSetReq request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_REVOKE_CERTIFICATE_SET, getCallOptions()), request, responseObserver);
}
@java.lang.Override
public void publishCRL(org.hyperledger.protos.Ca.TCertCRLReq request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_PUBLISH_CRL, getCallOptions()), request, responseObserver);
}
}
public static class TCAABlockingStub extends io.grpc.stub.AbstractStub
implements TCAABlockingClient {
private TCAABlockingStub(io.grpc.Channel channel) {
super(channel);
}
private TCAABlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected TCAABlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new TCAABlockingStub(channel, callOptions);
}
@java.lang.Override
public org.hyperledger.protos.Ca.CAStatus revokeCertificate(org.hyperledger.protos.Ca.TCertRevokeReq request) {
return blockingUnaryCall(
getChannel(), METHOD_REVOKE_CERTIFICATE, getCallOptions(), request);
}
@java.lang.Override
public org.hyperledger.protos.Ca.CAStatus revokeCertificateSet(org.hyperledger.protos.Ca.TCertRevokeSetReq request) {
return blockingUnaryCall(
getChannel(), METHOD_REVOKE_CERTIFICATE_SET, getCallOptions(), request);
}
@java.lang.Override
public org.hyperledger.protos.Ca.CAStatus publishCRL(org.hyperledger.protos.Ca.TCertCRLReq request) {
return blockingUnaryCall(
getChannel(), METHOD_PUBLISH_CRL, getCallOptions(), request);
}
}
public static class TCAAFutureStub extends io.grpc.stub.AbstractStub
implements TCAAFutureClient {
private TCAAFutureStub(io.grpc.Channel channel) {
super(channel);
}
private TCAAFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected TCAAFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new TCAAFutureStub(channel, callOptions);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture revokeCertificate(
org.hyperledger.protos.Ca.TCertRevokeReq request) {
return futureUnaryCall(
getChannel().newCall(METHOD_REVOKE_CERTIFICATE, getCallOptions()), request);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture revokeCertificateSet(
org.hyperledger.protos.Ca.TCertRevokeSetReq request) {
return futureUnaryCall(
getChannel().newCall(METHOD_REVOKE_CERTIFICATE_SET, getCallOptions()), request);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture publishCRL(
org.hyperledger.protos.Ca.TCertCRLReq request) {
return futureUnaryCall(
getChannel().newCall(METHOD_PUBLISH_CRL, getCallOptions()), request);
}
}
@java.lang.Deprecated public static abstract class AbstractTCAA extends TCAAImplBase {}
private static final int METHODID_REVOKE_CERTIFICATE = 0;
private static final int METHODID_REVOKE_CERTIFICATE_SET = 1;
private static final int METHODID_PUBLISH_CRL = 2;
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 TCAA serviceImpl;
private final int methodId;
public MethodHandlers(TCAA 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_REVOKE_CERTIFICATE:
serviceImpl.revokeCertificate((org.hyperledger.protos.Ca.TCertRevokeReq) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_REVOKE_CERTIFICATE_SET:
serviceImpl.revokeCertificateSet((org.hyperledger.protos.Ca.TCertRevokeSetReq) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_PUBLISH_CRL:
serviceImpl.publishCRL((org.hyperledger.protos.Ca.TCertCRLReq) 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_REVOKE_CERTIFICATE,
METHOD_REVOKE_CERTIFICATE_SET,
METHOD_PUBLISH_CRL);
}
@java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService(
final TCAA serviceImpl) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
METHOD_REVOKE_CERTIFICATE,
asyncUnaryCall(
new MethodHandlers<
org.hyperledger.protos.Ca.TCertRevokeReq,
org.hyperledger.protos.Ca.CAStatus>(
serviceImpl, METHODID_REVOKE_CERTIFICATE)))
.addMethod(
METHOD_REVOKE_CERTIFICATE_SET,
asyncUnaryCall(
new MethodHandlers<
org.hyperledger.protos.Ca.TCertRevokeSetReq,
org.hyperledger.protos.Ca.CAStatus>(
serviceImpl, METHODID_REVOKE_CERTIFICATE_SET)))
.addMethod(
METHOD_PUBLISH_CRL,
asyncUnaryCall(
new MethodHandlers<
org.hyperledger.protos.Ca.TCertCRLReq,
org.hyperledger.protos.Ca.CAStatus>(
serviceImpl, METHODID_PUBLISH_CRL)))
.build();
}
}