public override Task <Empty> ViewChangeProof(ViewChangeProofRequest request, ServerCallContext context) { _bus.Publish(new ElectionMessage.ViewChangeProof( Uuid.FromDto(request.ServerId).ToGuid(), new IPEndPoint(IPAddress.Parse(request.ServerInternalHttp.Address), (int)request.ServerInternalHttp.Port), request.InstalledView)); return(EmptyResult); }
private async Task SendViewChangeProofAsync(Guid serverId, EndPoint serverHttpEndPoint, int installedView, DateTime deadline) { var request = new ViewChangeProofRequest { ServerId = Uuid.FromGuid(serverId).ToDto(), ServerHttp = new GossipEndPoint(serverHttpEndPoint.GetHost(), (uint)serverHttpEndPoint.GetPort()), InstalledView = installedView }; await _electionsClient.ViewChangeProofAsync(request, deadline : deadline.ToUniversalTime()); }
private async Task SendViewChangeProofAsync(Guid serverId, IPEndPoint serverInternalHttp, int installedView, DateTime deadline) { var request = new ViewChangeProofRequest { ServerId = Uuid.FromGuid(serverId).ToDto(), ServerInternalHttp = new EndPoint(serverInternalHttp.Address.ToString(), (uint)serverInternalHttp.Port), InstalledView = installedView }; await _electionsClient.ViewChangeProofAsync(request, deadline : deadline.ToUniversalTime()); }
public override async Task <Empty> ViewChangeProof(ViewChangeProofRequest request, ServerCallContext context) { var user = context.GetHttpContext().User; if (!await _authorizationProvider.CheckAccessAsync(user, ViewChangeProofOperation, context.CancellationToken).ConfigureAwait(false)) { throw AccessDenied(); } _bus.Publish(new ElectionMessage.ViewChangeProof( Uuid.FromDto(request.ServerId).ToGuid(), new IPEndPoint(IPAddress.Parse(request.ServerInternalHttp.Address), (int)request.ServerInternalHttp.Port), request.InstalledView)); return(EmptyResult); }