// 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 { /// /// Settings for an /// public class GBaseClientSettings : IGBaseClientSettings { /// /// Settings for an /// /// The /// The /// The port /// The GBase endpoint /// The GBaseTable endpoint /// The GBaseEntry endpoint 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; } /// /// Protocol that the should use /// public ServerProtocol Protocol { get; } /// /// that the server listens to /// public IPAddress IpAddress { get; } /// /// Port that the server listens to /// public int Port { get; } /// /// GBase endpoint the server listens to /// public string GBaseEndpoint { get; } /// /// GBaseTable endpoint the server listens to /// public string GBaseTableEndpoint { get; } /// /// GBaseEntry endpoint the server listens to /// public string GBaseEntryEndpoint { get; } /// /// Complete GBase endpoint address based on the /// public string ServerProtocolGBaseEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseEndpoint}"; /// /// Complete GBaseTable endpoint address based on the /// public string ServerProtocolGBaseTableEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseTableEndpoint}"; /// /// Complete GBaseEntry endpoint address based on the /// public string ServerProtocolGBaseEntryEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseEntryEndpoint}"; } }