using NpgsqlTypes;
using System;
namespace Npgsql.Replication;
///
/// The common base class for all streaming replication messages
///
public abstract class ReplicationMessage
{
///
/// The starting point of the WAL data in this message.
///
public NpgsqlLogSequenceNumber WalStart { get; private set; }
///
/// The current end of WAL on the server.
///
public NpgsqlLogSequenceNumber WalEnd { get; private set; }
///
/// The server's system clock at the time this message was transmitted, as microseconds since midnight on 2000-01-01.
///
///
/// Since the client using Npgsql and the server may be located in different time zones,
/// as of Npgsql 7.0 this value is no longer converted to local time but keeps its original value in UTC.
/// You can check if you don't want to introduce behavior depending on Npgsql versions.
///
public DateTime ServerClock { get; private set; }
private protected void Populate(NpgsqlLogSequenceNumber walStart, NpgsqlLogSequenceNumber walEnd, DateTime serverClock)
{
WalStart = walStart;
WalEnd = walEnd;
ServerClock = serverClock;
}
}