diff --git a/GBase.Client/GBase.Client.xml b/GBase.Client/GBase.Client.xml index 6319e94..459fc68 100644 --- a/GBase.Client/GBase.Client.xml +++ b/GBase.Client/GBase.Client.xml @@ -4,5 +4,240 @@ GBase.Client + + + A client for the GBase + + + + + A client for the GBase + + The for this client + + + + Functions of the GBase + + + + + Functions of the GBaseTable + + + + + Functions of the GBaseEntry + + + + + Dispose used resources asynchronously + + A to await + + + + Settings for an + + + + + Settings for an + + The + The + The port + The GBase endpoint + The GBaseTable endpoint + The GBaseEntry endpoint + + + + Protocol that the should use + + + + + that the server listens to + + + + + Port that the server listens to + + + + + GBase endpoint the server listens to + + + + + GBaseTable endpoint the server listens to + + + + + GBaseEntry endpoint the server listens to + + + + + Complete GBase endpoint address based on the + + + + + Complete GBaseTable endpoint address based on the + + + + + Complete GBaseEntry endpoint address based on the + + + + + A client for the GBase + + + + + Functions of the GBase + + + + + Functions of the GBaseTable + + + + + Functions of the GBaseEntry + + + + + Settings for an + + + + + Complete GBase endpoint address based on the + + + + + Complete GBaseTable endpoint address based on the + + + + + Complete GBaseEntry endpoint address based on the + + + + + for the IGBaseEntry + + + + + for the IGBaseEntry + + The + The endpoint for the GBaseEntry + + + + Dummy method + + + + + for the IGBase + + + + + for the IGBase + + The + The endpoint for the GBase + + + + Add a table to the GBase + + True if successful, false if not + + + + Remove a table from the GBase + + True if successful, false if not + + + + for the IGBaseTable + + + + + for the IGBaseTable + + The + The endpoint for the GBaseTable + + + + Dummy method + + + + + Base class for services of the + + The of the inheriting service + + + + Base class for services of the + + The + The endpoint for this + + + + The for this + + + + + Open a for the given and endpoint + + The + The endpoint for this + + + + + Open an for this + + The opened channel of type + + + + Close the for a given + + The + + + + Dispose used resources asynchronously + + A to await + diff --git a/GBase.Client/GBaseClient.cs b/GBase.Client/GBaseClient.cs index d4cc846..42648a1 100644 --- a/GBase.Client/GBaseClient.cs +++ b/GBase.Client/GBaseClient.cs @@ -9,8 +9,15 @@ using GBase.Client.Services; namespace GBase.Client { + /// + /// A client for the GBase + /// public class GBaseClient : IGBaseClient //TODO: Add logging? { + /// + /// A client for the GBase + /// + /// The for this client public GBaseClient(IGBaseClientSettings settings) { GBase = new GBaseService(settings.Protocol, settings.ServerProtocolGBaseEndpointAddress); @@ -18,12 +25,25 @@ namespace GBase.Client GBaseEntry = new GBaseEntryService(settings.Protocol, settings.ServerProtocolGBaseEntryEndpointAddress); } - + /// + /// Functions of the GBase + /// public IGBaseService GBase { get; } + + /// + /// Functions of the GBaseTable + /// public IGBaseTableService GBaseTable { get; } - public IGBaseEntryService GBaseEntry { get; } + /// + /// Functions of the GBaseEntry + /// + public IGBaseEntryService GBaseEntry { get; } + /// + /// Dispose used resources asynchronously + /// + /// A to await public async ValueTask DisposeAsync() { await GBase.DisposeAsync(); diff --git a/GBase.Client/GBaseClientSettings.cs b/GBase.Client/GBaseClientSettings.cs index c5223c7..894344c 100644 --- a/GBase.Client/GBaseClientSettings.cs +++ b/GBase.Client/GBaseClientSettings.cs @@ -8,8 +8,20 @@ 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; @@ -20,15 +32,50 @@ namespace GBase.Client 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}"; } } \ No newline at end of file diff --git a/GBase.Client/Interfaces/IGBaseClient.cs b/GBase.Client/Interfaces/IGBaseClient.cs index b78387f..9c954fe 100644 --- a/GBase.Client/Interfaces/IGBaseClient.cs +++ b/GBase.Client/Interfaces/IGBaseClient.cs @@ -7,10 +7,24 @@ using GBase.Api.Services; namespace GBase.Client.Interfaces { + /// + /// A client for the GBase + /// public interface IGBaseClient : IAsyncDisposable { + /// + /// Functions of the GBase + /// IGBaseService GBase { get; } + + /// + /// Functions of the GBaseTable + /// IGBaseTableService GBaseTable { get; } + + /// + /// Functions of the GBaseEntry + /// IGBaseEntryService GBaseEntry { get; } } } \ No newline at end of file diff --git a/GBase.Client/Interfaces/IGBaseClientSettings.cs b/GBase.Client/Interfaces/IGBaseClientSettings.cs index a48bc19..5a6c708 100644 --- a/GBase.Client/Interfaces/IGBaseClientSettings.cs +++ b/GBase.Client/Interfaces/IGBaseClientSettings.cs @@ -6,10 +6,24 @@ using GBase.Api.Communication; namespace GBase.Client.Interfaces { + /// + /// Settings for an + /// public interface IGBaseClientSettings : ICommunicationSettings { + /// + /// Complete GBase endpoint address based on the + /// string ServerProtocolGBaseEndpointAddress { get; } + + /// + /// Complete GBaseTable endpoint address based on the + /// string ServerProtocolGBaseTableEndpointAddress { get; } + + /// + /// Complete GBaseEntry endpoint address based on the + /// string ServerProtocolGBaseEntryEndpointAddress { get; } } } \ No newline at end of file diff --git a/GBase.Client/Services/GBaseEntryService.cs b/GBase.Client/Services/GBaseEntryService.cs index 77b643f..2b31e8b 100644 --- a/GBase.Client/Services/GBaseEntryService.cs +++ b/GBase.Client/Services/GBaseEntryService.cs @@ -7,14 +7,25 @@ using GBase.Api.Services; namespace GBase.Client.Services { + /// + /// for the IGBaseEntry + /// public class GBaseEntryService : Service, IGBaseEntryService { + /// + /// for the IGBaseEntry + /// + /// The + /// The endpoint for the GBaseEntry public GBaseEntryService(ServerProtocol serverProtocol, string endpoint) : base(serverProtocol, endpoint) { } + /// + /// Dummy method + /// public void Dummy() { throw new System.NotImplementedException(); diff --git a/GBase.Client/Services/GBaseService.cs b/GBase.Client/Services/GBaseService.cs index 531041d..1daba96 100644 --- a/GBase.Client/Services/GBaseService.cs +++ b/GBase.Client/Services/GBaseService.cs @@ -7,14 +7,26 @@ using GBase.Api.Services; namespace GBase.Client.Services { + /// + /// for the IGBase + /// public class GBaseService : Service, IGBaseService { + /// + /// for the IGBase + /// + /// The + /// The endpoint for the GBase public GBaseService(ServerProtocol serverProtocol, string endpoint) : base(serverProtocol, endpoint) { } + /// + /// Add a table to the GBase + /// + /// True if successful, false if not public bool AddTable() //TODO: Implement this function correctly { IGBaseService channel = OpenChannel(); @@ -25,6 +37,10 @@ namespace GBase.Client.Services return success; } + /// + /// Remove a table from the GBase + /// + /// True if successful, false if not public bool RemoveTable() //TODO: Implement this function correctly { IGBaseService channel = OpenChannel(); diff --git a/GBase.Client/Services/GBaseTableService.cs b/GBase.Client/Services/GBaseTableService.cs index d144276..8ea7328 100644 --- a/GBase.Client/Services/GBaseTableService.cs +++ b/GBase.Client/Services/GBaseTableService.cs @@ -7,14 +7,25 @@ using GBase.Api.Services; namespace GBase.Client.Services { + /// + /// for the IGBaseTable + /// public class GBaseTableService : Service, IGBaseTableService { + /// + /// for the IGBaseTable + /// + /// The + /// The endpoint for the GBaseTable public GBaseTableService(ServerProtocol serverProtocol, string endpoint) : base(serverProtocol, endpoint) { } + /// + /// Dummy method + /// public void Dummy() { throw new System.NotImplementedException(); diff --git a/GBase.Client/Services/Service.cs b/GBase.Client/Services/Service.cs index a4cf456..d72602e 100644 --- a/GBase.Client/Services/Service.cs +++ b/GBase.Client/Services/Service.cs @@ -6,18 +6,37 @@ using System; using System.ServiceModel; using System.Threading.Tasks; using GBase.Api.Communication; +using GBase.Client.Interfaces; namespace GBase.Client.Services { + /// + /// Base class for services of the + /// + /// The of the inheriting service public abstract class Service : IAsyncDisposable { + /// + /// Base class for services of the + /// + /// The + /// The endpoint for this protected Service(ServerProtocol serverProtocol, string endpoint) { ServiceFactory = OpenFactory(serverProtocol, endpoint); } + /// + /// The for this + /// private ChannelFactory ServiceFactory { get; } + /// + /// Open a for the given and endpoint + /// + /// The + /// The endpoint for this + /// private ChannelFactory OpenFactory(ServerProtocol serverProtocol, string endpoint) { ChannelFactory factory; @@ -32,6 +51,10 @@ namespace GBase.Client.Services return factory; } + /// + /// Open an for this + /// + /// The opened channel of type protected TService OpenChannel() { TService channel = ServiceFactory.CreateChannel(); @@ -40,11 +63,19 @@ namespace GBase.Client.Services return channel; } + /// + /// Close the for a given + /// + /// The protected void CloseChannel(TService service) { ((IClientChannel) service).Close(); } + /// + /// Dispose used resources asynchronously + /// + /// A to await public async ValueTask DisposeAsync() { ServiceFactory.Close();