mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 14:51:44 +01:00
59 lines
1.6 KiB
C#
59 lines
1.6 KiB
C#
using Capnp.Rpc;
|
|
using FabAccessAPI.Schema;
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace FabAccessAPI
|
|
{
|
|
public interface IAPI
|
|
{
|
|
/// <summary>
|
|
/// Data to establish connection.
|
|
/// </summary>
|
|
/// Without SecretProperties
|
|
ConnectionData ConnectionData { get; }
|
|
|
|
/// <summary>
|
|
/// Information about the established connection.
|
|
/// </summary>
|
|
ConnectionInfo ConnectionInfo { get; }
|
|
|
|
/// <summary>
|
|
/// Is API connected?
|
|
/// </summary>
|
|
bool IsConnected { get; }
|
|
|
|
/// <summary>
|
|
/// Get session when connection is established
|
|
/// </summary>
|
|
Session Session { get; }
|
|
|
|
/// <summary>
|
|
/// Event on changes in connection state.
|
|
/// </summary>
|
|
event EventHandler<ConnectionStatusChange> ConnectionStatusChanged;
|
|
|
|
/// <summary>
|
|
/// Connect to BFFH Server
|
|
/// </summary>
|
|
/// <param name="connectionData"></param>
|
|
Task Connect(ConnectionData connectionData, TcpRpcClient tcpRpcClient = null);
|
|
|
|
/// <summary>
|
|
/// Disconnect from BFFH Server
|
|
/// </summary>
|
|
Task Disconnect();
|
|
|
|
/// <summary>
|
|
/// Reconnect after connection loss with the last ConnectionData
|
|
/// </summary>
|
|
Task Reconnect();
|
|
|
|
/// <summary>
|
|
/// Connect to Server and get ConnectionInfo.
|
|
/// The Connection is not maintained.
|
|
/// </summary>
|
|
Task<ConnectionInfo> TestConnection(ConnectionData connectionData, TcpRpcClient tcpRpcClient = null);
|
|
}
|
|
}
|