// 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 GBaseColumn endpoint
public GBaseClientSettings(ServerProtocol protocol, IPAddress ipAddress, int port, string gBaseEndpoint, string gBaseTableEndpoint, string gBaseColumnEndpoint)
{
Protocol = protocol;
IpAddress = ipAddress;
Port = port;
GBaseEndpoint = gBaseEndpoint;
GBaseTableEndpoint = gBaseTableEndpoint;
GBaseColumnEndpoint = gBaseColumnEndpoint;
}
///
/// 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; }
///
/// GBaseColumn endpoint the server listens to
///
public string GBaseColumnEndpoint { 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 GBaseColumn endpoint address based on the
///
public string ServerProtocolGBaseColumnEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseColumnEndpoint}";
}
}