Class ElectionGrpc.ElectionImplBase

  • All Implemented Interfaces:
    io.grpc.BindableService
    Enclosing class:
    ElectionGrpc

    public abstract static class ElectionGrpc.ElectionImplBase
    extends java.lang.Object
    implements io.grpc.BindableService
     The election service exposes client-side election facilities as a gRPC interface.
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.grpc.ServerServiceDefinition bindService()  
      void campaign​(CampaignRequest request, io.grpc.stub.StreamObserver<CampaignResponse> responseObserver)
      Campaign waits to acquire leadership in an election, returning a LeaderKey representing the leadership if successful.
      void leader​(LeaderRequest request, io.grpc.stub.StreamObserver<LeaderResponse> responseObserver)
      Leader returns the current election proclamation, if any.
      void observe​(LeaderRequest request, io.grpc.stub.StreamObserver<LeaderResponse> responseObserver)
      Observe streams election proclamations in-order as made by the election's elected leaders.
      void proclaim​(ProclaimRequest request, io.grpc.stub.StreamObserver<ProclaimResponse> responseObserver)
      Proclaim updates the leader's posted value with a new value.
      void resign​(ResignRequest request, io.grpc.stub.StreamObserver<ResignResponse> responseObserver)
      Resign releases election leadership so other campaigners may acquire leadership on the election.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ElectionImplBase

        public ElectionImplBase()
    • Method Detail

      • campaign

        public void campaign​(CampaignRequest request,
                             io.grpc.stub.StreamObserver<CampaignResponse> responseObserver)
         Campaign waits to acquire leadership in an election, returning a LeaderKey
         representing the leadership if successful. The LeaderKey can then be used
         to issue new values on the election, transactionally guard API requests on
         leadership still being held, and resign from the election.
         
      • proclaim

        public void proclaim​(ProclaimRequest request,
                             io.grpc.stub.StreamObserver<ProclaimResponse> responseObserver)
         Proclaim updates the leader's posted value with a new value.
         
      • leader

        public void leader​(LeaderRequest request,
                           io.grpc.stub.StreamObserver<LeaderResponse> responseObserver)
         Leader returns the current election proclamation, if any.
         
      • observe

        public void observe​(LeaderRequest request,
                            io.grpc.stub.StreamObserver<LeaderResponse> responseObserver)
         Observe streams election proclamations in-order as made by the election's
         elected leaders.
         
      • resign

        public void resign​(ResignRequest request,
                           io.grpc.stub.StreamObserver<ResignResponse> responseObserver)
         Resign releases election leadership so other campaigners may acquire
         leadership on the election.
         
      • bindService

        public final io.grpc.ServerServiceDefinition bindService()
        Specified by:
        bindService in interface io.grpc.BindableService