A database based on .net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.0 KiB

// Author: Gockner, Simon
// Created: 2020-02-10
// Copyright(c) 2020 SimonG. All Rights Reserved.
using System.Net;
using GBase.Api.Communication;
using GBase.Client.Interfaces;
namespace GBase.Client
{
/// <summary>
/// Settings for an <see cref="IGBaseClient"/>
/// </summary>
public class GBaseClientSettings : IGBaseClientSettings
{
/// <summary>
/// Settings for an <see cref="IGBaseClient"/>
/// </summary>
/// <param name="protocol">The <see cref="ServerProtocol"/></param>
/// <param name="ipAddress">The <see cref="IPAddress"/></param>
/// <param name="port">The port</param>
/// <param name="gBaseEndpoint">The GBase endpoint</param>
/// <param name="gBaseTableEndpoint">The GBaseTable endpoint</param>
/// <param name="gBaseEntryEndpoint">The GBaseEntry endpoint</param>
public GBaseClientSettings(ServerProtocol protocol, IPAddress ipAddress, int port, string gBaseEndpoint, string gBaseTableEndpoint, string gBaseEntryEndpoint)
{
Protocol = protocol;
IpAddress = ipAddress;
Port = port;
GBaseEndpoint = gBaseEndpoint;
GBaseTableEndpoint = gBaseTableEndpoint;
GBaseEntryEndpoint = gBaseEntryEndpoint;
}
/// <summary>
/// Protocol that the <see cref="IGBaseClient"/> should use
/// </summary>
public ServerProtocol Protocol { get; }
/// <summary>
/// <see cref="IPAddress"/> that the server listens to
/// </summary>
public IPAddress IpAddress { get; }
/// <summary>
/// Port that the server listens to
/// </summary>
public int Port { get; }
/// <summary>
/// GBase endpoint the server listens to
/// </summary>
public string GBaseEndpoint { get; }
/// <summary>
/// GBaseTable endpoint the server listens to
/// </summary>
public string GBaseTableEndpoint { get; }
/// <summary>
/// GBaseEntry endpoint the server listens to
/// </summary>
public string GBaseEntryEndpoint { get; }
/// <summary>
/// Complete GBase endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
public string ServerProtocolGBaseEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseEndpoint}";
/// <summary>
/// Complete GBaseTable endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
public string ServerProtocolGBaseTableEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseTableEndpoint}";
/// <summary>
/// Complete GBaseEntry endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
public string ServerProtocolGBaseEntryEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseEntryEndpoint}";
}
}