namespace ScadaLink.Communication;
///
/// Configuration options for central-site communication, including per-pattern
/// timeouts and transport heartbeat settings.
///
public class CommunicationOptions
{
/// Timeout for deployment commands (typically longest due to apply logic).
public TimeSpan DeploymentTimeout { get; set; } = TimeSpan.FromMinutes(2);
/// Timeout for lifecycle commands (disable, enable, delete).
public TimeSpan LifecycleTimeout { get; set; } = TimeSpan.FromSeconds(30);
/// Timeout for artifact deployment commands.
public TimeSpan ArtifactDeploymentTimeout { get; set; } = TimeSpan.FromMinutes(1);
/// Timeout for remote query requests (event logs, parked messages).
public TimeSpan QueryTimeout { get; set; } = TimeSpan.FromSeconds(30);
/// Timeout for integration call routing.
public TimeSpan IntegrationTimeout { get; set; } = TimeSpan.FromSeconds(30);
/// Timeout for debug view subscribe/unsubscribe handshake.
public TimeSpan DebugViewTimeout { get; set; } = TimeSpan.FromSeconds(10);
/// Timeout for health report acknowledgement (fire-and-forget, but bounded).
public TimeSpan HealthReportTimeout { get; set; } = TimeSpan.FromSeconds(10);
///
/// Contact point addresses for the central cluster (e.g. "akka.tcp://scadalink@central-a:8081").
/// Used by site nodes to create a ClusterClient for reaching central.
///
public List CentralContactPoints { get; set; } = new();
/// gRPC keepalive ping interval for streaming connections.
public TimeSpan GrpcKeepAlivePingDelay { get; set; } = TimeSpan.FromSeconds(15);
/// gRPC keepalive ping timeout — stream is considered dead if no response within this period.
public TimeSpan GrpcKeepAlivePingTimeout { get; set; } = TimeSpan.FromSeconds(10);
/// Maximum lifetime for a single gRPC stream before the server forces re-establishment.
public TimeSpan GrpcMaxStreamLifetime { get; set; } = TimeSpan.FromHours(4);
/// Maximum number of concurrent gRPC streaming subscriptions per site node.
public int GrpcMaxConcurrentStreams { get; set; } = 100;
/// Akka.Remote transport heartbeat interval.
public TimeSpan TransportHeartbeatInterval { get; set; } = TimeSpan.FromSeconds(5);
/// Akka.Remote transport failure detection threshold.
public TimeSpan TransportFailureThreshold { get; set; } = TimeSpan.FromSeconds(15);
}