Search in sources :

Example 1 with ResignRequest

use of io.etcd.jetcd.api.ResignRequest in project jetcd by coreos.

the class ElectionImpl method resign.

@Override
public CompletableFuture<ResignResponse> resign(LeaderKey leaderKey) {
    checkNotNull(leaderKey, "leader key should not be null");
    ResignRequest request = ResignRequest.newBuilder().setLeader(io.etcd.jetcd.api.LeaderKey.newBuilder().setKey(ByteString.copyFrom(leaderKey.getKey().getBytes())).setName(ByteString.copyFrom(leaderKey.getName().getBytes())).setLease(leaderKey.getLease()).setRev(leaderKey.getRevision()).build()).build();
    return completable(stub.resign(request), ResignResponse::new, this::convertException);
}
Also used : ResignRequest(io.etcd.jetcd.api.ResignRequest) ResignResponse(io.etcd.jetcd.election.ResignResponse)

Aggregations

ResignRequest (io.etcd.jetcd.api.ResignRequest)1 ResignResponse (io.etcd.jetcd.election.ResignResponse)1