Search Results for

    Show / Hide Table of Contents

    Class DirectAgentExecutor

    IDbCommandExecuter that tries the direct WebRTC DataChannel transport first and falls back to HttpAgentExecutor transparently if the channel cannot be opened (corporate firewall, STUN unreachable, Agent that doesn't speak the protocol …).

    Pattern mirrors the proven path in ReportmanAI/Reportman.Hub.Client/HubApiClient.DataChannel.cs:

    • UseDirectChannel master switch (default true).
    • 10-minute cooldown after a failed negotiation, so subsequent queries don't re-pay the open-timeout (~5 s) on each one.
    • Per-database pool reuses the warm channel across calls.
    • Effective transport surfaced via LastConnectionMode and the ConnectionModeChanged event so a UI chip can bind to it without having to know about WebRTC.

    .NET Framework (net48) builds compile this file out — Reportman.DataChannel requires .NET 6+ (SIPSorcery). On net48 consumers get only the HTTP path, identical to the Linux/FPC behaviour of the Delphi engine.

    Inheritance
    object
    DirectAgentExecutor
    Implements
    IDbCommandExecuter
    IDisposable
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Reportman.Reporting
    Assembly: Reportman.Reporting.dll
    Syntax
    public class DirectAgentExecutor : IDbCommandExecuter, IDisposable

    Constructors

    View Source

    DirectAgentExecutor()

    Declaration
    public DirectAgentExecutor()
    View Source

    DirectAgentExecutor(string, string, long)

    Declaration
    public DirectAgentExecutor(string baseUrl, string apiKey, long hubDatabaseId)
    Parameters
    Type Name Description
    string baseUrl
    string apiKey
    long hubDatabaseId

    Properties

    View Source

    ApiKey

    ApiKey for the database alias when no user is logged in.

    Declaration
    public string ApiKey { get; set; }
    Property Value
    Type Description
    string
    View Source

    BaseUrl

    API base URL (same as BaseUrl).

    Declaration
    public string BaseUrl { get; set; }
    Property Value
    Type Description
    string
    View Source

    HubDatabaseId

    Identifier of the database on the Hub side.

    Declaration
    public long HubDatabaseId { get; set; }
    Property Value
    Type Description
    long
    View Source

    LastConnectionMode

    Effective transport of the most recent Open(IDbCommand). Unknown before any call.

    Declaration
    public ConnectionMode LastConnectionMode { get; }
    Property Value
    Type Description
    ConnectionMode
    View Source

    Token

    Bearer JWT for logged-in user calls.

    Declaration
    public string Token { get; set; }
    Property Value
    Type Description
    string
    View Source

    UseDirectChannel

    Global kill-switch. Setting this to false at runtime makes every Open(IDbCommand) call go straight to HTTP, no negotiation attempt. Useful for diagnostics or forcibly-HTTP integration tests.

    Declaration
    public bool UseDirectChannel { get; set; }
    Property Value
    Type Description
    bool

    Methods

    View Source

    CreateCommand()

    Delegates to the inner HTTP executor: both transports speak the same HttpAgentCommand for accumulated parameters, so callers don't need to know which one will execute.

    Declaration
    public IDbCommand CreateCommand()
    Returns
    Type Description
    IDbCommand
    View Source

    Dispose()

    Declaration
    public void Dispose()
    View Source

    Open(IDbCommand)

    Try the direct channel first; on any failure (cooldown active, negotiation failed, channel error mid-query) silently fall back to the inner HTTP path. The caller never sees a "direct channel broke" exception — it sees the data, just over HTTP. The chip is the only visible difference.

    Declaration
    public DataTable Open(IDbCommand ncommand)
    Parameters
    Type Name Description
    IDbCommand ncommand
    Returns
    Type Description
    DataTable
    View Source

    ResetChannelPool()

    Drop every warm Direct Channel session and clear the negotiation cooldowns. Call after the user edits a connection (ApiKey / HubDatabaseId) so the next query renegotiates with the new credentials instead of reusing a session opened with the old ones. The warm pool keys sessions by HubDatabaseId, so an ApiKey change on the same database would otherwise keep hitting the stale session until the application is restarted. EvictAllAsync clears the pool synchronously (only the teardown of the old sessions is async), so a fire-and-forget call invalidates the cache immediately.

    Declaration
    public static void ResetChannelPool()

    Events

    View Source

    ConnectionModeChanged

    Fired after every Open once the transport is decided.

    Declaration
    public event Action<ConnectionMode> ConnectionModeChanged
    Event Type
    Type Description
    Action<ConnectionMode>

    Implements

    IDbCommandExecuter
    IDisposable
    • View Source
    In this article
    Back to top Generated by DocFX