#21: refactor GBaseEntry name

pull/26/head
Simon Gockner 6 years ago
parent 24a3dc8e5f
commit b770b78481
  1. 2
      .vscode/launch.json
  2. 4
      GBase.Api/Communication/ICommunicationSettings.cs
  3. 33
      GBase.Api/GBase.Api.xml
  4. 4
      GBase.Api/Services/IGBaseColumnService.cs
  5. 8
      GBase.Api/Services/IGBaseTableService.cs
  6. 4
      GBase.Client/Factories/IGBaseClientSettingsFactory.cs
  7. 58
      GBase.Client/GBase.Client.xml
  8. 13
      GBase.Client/GBaseClient.cs
  9. 14
      GBase.Client/GBaseClientSettings.cs
  10. 4
      GBase.Client/Installers/GBaseClientInstaller.cs
  11. 4
      GBase.Client/Interfaces/IGBaseClient.cs
  12. 4
      GBase.Client/Interfaces/IGBaseClientSettings.cs
  13. 10
      GBase.Client/Services/Factories/IGBaseColumnServiceFactory.cs
  14. 10
      GBase.Client/Services/GBaseColumnService.cs
  15. 12
      GBase.Client/Services/GBaseTableService.cs
  16. 18
      GBase.Server/GBaseServerSettings.cs
  17. 2
      GBase.Server/Program.cs
  18. 2
      GBase.Server/Services/GBaseColumnService.cs
  19. 4
      GBase.Server/Services/GBaseTableService.cs
  20. 4
      GBase.Server/Startup.cs
  21. 6
      GBase/Attributes/GBaseColumnAttribute.cs
  22. 33
      GBase/Diagnosis/GBaseTableColumnAnalyzer.cs
  23. 10
      GBase/Factories/IGBaseColumnFactory.cs
  24. 155
      GBase/GBase.xml
  25. 8
      GBase/GBaseColumn.cs
  26. 48
      GBase/GBaseTable.cs
  27. 4
      GBase/Installers/GBaseInstaller.cs
  28. 4
      GBase/Interfaces/IGBaseColumn.cs
  29. 16
      GBase/Interfaces/IGBaseTable.cs
  30. 7
      Test.GBase.Client/IntegrationTest.cs
  31. 2
      Test.GBase/TestClasses/Foo.cs

@ -11,7 +11,7 @@
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/GBase.Server/bin/Debug/netcoreapp3.1/GBase.Server.dll",
"args": ["-pr", "http", "-ip", "127.0.0.1", "-p", "8080", "-e", "/GBase", "-et", "/GBaseTable", "-ee", "/GBaseEntry"],
"args": ["-pr", "http", "-ip", "127.0.0.1", "-p", "8080", "-e", "/GBase", "-et", "/GBaseTable", "-ee", "/GBaseColumn"],
"cwd": "${workspaceFolder}/GBase.Server",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",

@ -37,8 +37,8 @@ namespace GBase.Api.Communication
string GBaseTableEndpoint { get; }
/// <summary>
/// The used endpoint for the GBaseEntry
/// The used endpoint for the GBaseColumn
/// </summary>
string GBaseEntryEndpoint { get; }
string GBaseColumnEndpoint { get; }
}
}

@ -34,9 +34,9 @@
The used endpoint for the GBaseTable
</summary>
</member>
<member name="P:GBase.Api.Communication.ICommunicationSettings.GBaseEntryEndpoint">
<member name="P:GBase.Api.Communication.ICommunicationSettings.GBaseColumnEndpoint">
<summary>
The used endpoint for the GBaseEntry
The used endpoint for the GBaseColumn
</summary>
</member>
<member name="T:GBase.Api.Communication.ServerProtocol">
@ -80,6 +80,11 @@
<returns>The <see cref="T:GBase.Api.Communication.ServerProtocol"/> for the given <see cref="T:System.String"/></returns>
<exception cref="T:System.ArgumentOutOfRangeException">Invalid string passed.</exception>
</member>
<member name="T:GBase.Api.GBaseEntryChangedEventArgs">
<summary>
<see cref="T:System.EventArgs"/> for the <see cref="T:GBase.Api.INotifyGBaseEntryChanged"/> event
</summary>
</member>
<member name="T:GBase.Api.IGBaseObject">
<summary>
GBase object that allows conversion from <see cref="T:System.String"/>
@ -91,12 +96,22 @@
</summary>
<param name="string">The given <see cref="T:System.String"/></param>
</member>
<member name="T:GBase.Api.Services.IGBaseEntryService">
<member name="T:GBase.Api.INotifyGBaseEntryChanged">
<summary>
Notify the GBase that an entry has changed
</summary>
</member>
<member name="T:GBase.Api.NotifyGBaseEntryChanged">
<summary>
Notify the GBase that an entry has changed
</summary>
</member>
<member name="T:GBase.Api.Services.IGBaseColumnService">
<summary>
ServiceContract for the GBaseEntry
ServiceContract for the GBaseColumn
</summary>
</member>
<member name="M:GBase.Api.Services.IGBaseEntryService.Dummy">
<member name="M:GBase.Api.Services.IGBaseColumnService.Dummy">
<summary>
Dummy OperationContract
</summary>
@ -123,15 +138,15 @@
ServiceContract for the GBaseTable
</summary>
</member>
<member name="M:GBase.Api.Services.IGBaseTableService.AddEntry">
<member name="M:GBase.Api.Services.IGBaseTableService.AddColumn">
<summary>
Add an entry to the GBaseTable
Add a column to the GBaseTable
</summary>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.Api.Services.IGBaseTableService.RemoveEntry">
<member name="M:GBase.Api.Services.IGBaseTableService.RemoveColumn">
<summary>
Remove an entry from the GBaseTable
Remove a column from the GBaseTable
</summary>
<returns>True if successful, false if not</returns>
</member>

@ -8,10 +8,10 @@ using System.ServiceModel;
namespace GBase.Api.Services
{
/// <summary>
/// ServiceContract for the GBaseEntry
/// ServiceContract for the GBaseColumn
/// </summary>
[ServiceContract]
public interface IGBaseEntryService : IAsyncDisposable //TODO: Add OperationContracts for all operations this service has to do
public interface IGBaseColumnService : IAsyncDisposable //TODO: Add OperationContracts for all operations this service has to do
{
/// <summary>
/// Dummy OperationContract

@ -14,17 +14,17 @@ namespace GBase.Api.Services
public interface IGBaseTableService : IAsyncDisposable //TODO: Add OperationContracts for all operations this service has to do
{
/// <summary>
/// Add an entry to the GBaseTable
/// Add a column to the GBaseTable
/// </summary>
/// <returns>True if successful, false if not</returns>
[OperationContract]
bool AddEntry();
bool AddColumn();
/// <summary>
/// Remove an entry from the GBaseTable
/// Remove a column from the GBaseTable
/// </summary>
/// <returns>True if successful, false if not</returns>
[OperationContract]
bool RemoveEntry();
bool RemoveColumn();
}
}

@ -22,8 +22,8 @@ namespace GBase.Client.Factories
/// <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>
/// <param name="gBaseColumnEndpoint">The GBaseColumn endpoint</param>
/// <returns>A newly created instance of the implementation for <see cref="IGBaseClientSettings"/></returns>
IGBaseClientSettings Create(ServerProtocol protocol, IPAddress ipAddress, int port, string gBaseEndpoint, string gBaseTableEndpoint, string gBaseEntryEndpoint);
IGBaseClientSettings Create(ServerProtocol protocol, IPAddress ipAddress, int port, string gBaseEndpoint, string gBaseTableEndpoint, string gBaseColumnEndpoint);
}
}

@ -30,7 +30,7 @@
<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>
<param name="gBaseColumnEndpoint">The GBaseEntry endpoint</param>
<returns>A newly created instance of the implementation for <see cref="T:GBase.Client.Interfaces.IGBaseClientSettings"/></returns>
</member>
<member name="T:GBase.Client.GBaseClient">
@ -38,14 +38,14 @@
A client for the GBase
</summary>
</member>
<member name="M:GBase.Client.GBaseClient.#ctor(GBase.Client.Interfaces.IGBaseClientSettings,GBase.Client.Services.Factories.IGBaseServiceFactory,GBase.Client.Services.Factories.IGBaseTableServiceFactory,GBase.Client.Services.Factories.IGBaseEntryServiceFactory)">
<member name="M:GBase.Client.GBaseClient.#ctor(GBase.Client.Interfaces.IGBaseClientSettings,GBase.Client.Services.Factories.IGBaseServiceFactory,GBase.Client.Services.Factories.IGBaseTableServiceFactory,GBase.Client.Services.Factories.IGBaseColumnServiceFactory)">
<summary>
A client for the GBase
</summary>
<param name="settings">The <see cref="T:GBase.Client.Interfaces.IGBaseClientSettings"/> for this client</param>
<param name="gBaseServiceFactory">The <see cref="T:GBase.Client.Services.Factories.IGBaseServiceFactory"/></param>
<param name="gBaseTableServiceFactory">The <see cref="T:GBase.Client.Services.Factories.IGBaseTableServiceFactory"/></param>
<param name="gBaseEntryServiceFactory">The <see cref="T:GBase.Client.Services.Factories.IGBaseEntryServiceFactory"/></param>
<param name="gBaseColumnServiceFactory">The <see cref="T:GBase.Client.Services.Factories.IGBaseColumnServiceFactory"/></param>
</member>
<member name="P:GBase.Client.GBaseClient.GBase">
<summary>
@ -57,9 +57,9 @@
Functions of the GBaseTable
</summary>
</member>
<member name="P:GBase.Client.GBaseClient.GBaseEntry">
<member name="P:GBase.Client.GBaseClient.GBaseColumn">
<summary>
Functions of the GBaseEntry
Functions of the GBaseColumn
</summary>
</member>
<member name="M:GBase.Client.GBaseClient.DisposeAsync">
@ -82,7 +82,7 @@
<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>
<param name="gBaseColumnEndpoint">The GBaseColumn endpoint</param>
</member>
<member name="P:GBase.Client.GBaseClientSettings.Protocol">
<summary>
@ -109,9 +109,9 @@
GBaseTable endpoint the server listens to
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.GBaseEntryEndpoint">
<member name="P:GBase.Client.GBaseClientSettings.GBaseColumnEndpoint">
<summary>
GBaseEntry endpoint the server listens to
GBaseColumn endpoint the server listens to
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.ServerProtocolGBaseEndpointAddress">
@ -124,9 +124,9 @@
Complete GBaseTable endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.ServerProtocolGBaseEntryEndpointAddress">
<member name="P:GBase.Client.GBaseClientSettings.ServerProtocolGBaseColumnEndpointAddress">
<summary>
Complete GBaseEntry endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
Complete GBaseColumn endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="T:GBase.Client.Installers.GBaseClientInstaller">
@ -152,9 +152,9 @@
Functions of the GBaseTable
</summary>
</member>
<member name="P:GBase.Client.Interfaces.IGBaseClient.GBaseEntry">
<member name="P:GBase.Client.Interfaces.IGBaseClient.GBaseColumn">
<summary>
Functions of the GBaseEntry
Functions of the GBaseColumn
</summary>
</member>
<member name="T:GBase.Client.Interfaces.IGBaseClientSettings">
@ -172,23 +172,23 @@
Complete GBaseTable endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="P:GBase.Client.Interfaces.IGBaseClientSettings.ServerProtocolGBaseEntryEndpointAddress">
<member name="P:GBase.Client.Interfaces.IGBaseClientSettings.ServerProtocolGBaseColumnEndpointAddress">
<summary>
Complete GBaseEntry endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
Complete GBaseColumn endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="T:GBase.Client.Services.Factories.IGBaseEntryServiceFactory">
<member name="T:GBase.Client.Services.Factories.IGBaseColumnServiceFactory">
<summary>
Factory for the <see cref="T:GBase.Api.Services.IGBaseEntryService"/>
Factory for the <see cref="T:GBase.Api.Services.IGBaseColumnService"/>
</summary>
</member>
<member name="M:GBase.Client.Services.Factories.IGBaseEntryServiceFactory.Create(GBase.Api.Communication.ServerProtocol,System.String)">
<member name="M:GBase.Client.Services.Factories.IGBaseColumnServiceFactory.Create(GBase.Api.Communication.ServerProtocol,System.String)">
<summary>
Creates an <see cref="T:GBase.Api.Services.IGBaseEntryService"/>
Creates an <see cref="T:GBase.Api.Services.IGBaseColumnService"/>
</summary>
<param name="serverProtocol">The <see cref="T:GBase.Api.Communication.ServerProtocol"/></param>
<param name="endpoint">The endpoint for the GBase</param>
<returns>A newly created instance of the implementation for <see cref="T:GBase.Api.Services.IGBaseEntryService"/></returns>
<returns>A newly created instance of the implementation for <see cref="T:GBase.Api.Services.IGBaseColumnService"/></returns>
</member>
<member name="T:GBase.Client.Services.Factories.IGBaseServiceFactory">
<summary>
@ -216,19 +216,19 @@
<param name="endpoint">The endpoint for the GBase</param>
<returns>A newly created instance of the implementation for <see cref="T:GBase.Api.Services.IGBaseTableService"/></returns>
</member>
<member name="T:GBase.Client.Services.GBaseEntryService">
<member name="T:GBase.Client.Services.GBaseColumnService">
<summary>
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBaseEntry
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBaseColumn
</summary>
</member>
<member name="M:GBase.Client.Services.GBaseEntryService.#ctor(GBase.Api.Communication.ServerProtocol,System.String)">
<member name="M:GBase.Client.Services.GBaseColumnService.#ctor(GBase.Api.Communication.ServerProtocol,System.String)">
<summary>
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBaseEntry
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBaseColumn
</summary>
<param name="serverProtocol">The <see cref="T:GBase.Api.Communication.ServerProtocol"/></param>
<param name="endpoint">The endpoint for the GBaseEntry</param>
<param name="endpoint">The endpoint for the GBaseColumn</param>
</member>
<member name="M:GBase.Client.Services.GBaseEntryService.Dummy">
<member name="M:GBase.Client.Services.GBaseColumnService.Dummy">
<summary>
Dummy method
</summary>
@ -269,15 +269,15 @@
<param name="serverProtocol">The <see cref="T:GBase.Api.Communication.ServerProtocol"/></param>
<param name="endpoint">The endpoint for the GBaseTable</param>
</member>
<member name="M:GBase.Client.Services.GBaseTableService.AddEntry">
<member name="M:GBase.Client.Services.GBaseTableService.AddColumn">
<summary>
Add an entry to the GBaseTable
Add a column to the GBaseTable
</summary>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.Client.Services.GBaseTableService.RemoveEntry">
<member name="M:GBase.Client.Services.GBaseTableService.RemoveColumn">
<summary>
Remove an entry from the GBaseTable
Remove a column from the GBaseTable
</summary>
<returns>True if successful, false if not</returns>
</member>

@ -4,7 +4,6 @@
using System.Threading.Tasks;
using GBase.Api.Services;
using GBase.Client.Factories;
using GBase.Client.Interfaces;
using GBase.Client.Services.Factories;
@ -21,12 +20,12 @@ namespace GBase.Client
/// <param name="settings">The <see cref="IGBaseClientSettings"/> for this client</param>
/// <param name="gBaseServiceFactory">The <see cref="IGBaseServiceFactory"/></param>
/// <param name="gBaseTableServiceFactory">The <see cref="IGBaseTableServiceFactory"/></param>
/// <param name="gBaseEntryServiceFactory">The <see cref="IGBaseEntryServiceFactory"/></param>
public GBaseClient(IGBaseClientSettings settings, IGBaseServiceFactory gBaseServiceFactory, IGBaseTableServiceFactory gBaseTableServiceFactory, IGBaseEntryServiceFactory gBaseEntryServiceFactory)
/// <param name="gBaseColumnServiceFactory">The <see cref="IGBaseColumnServiceFactory"/></param>
public GBaseClient(IGBaseClientSettings settings, IGBaseServiceFactory gBaseServiceFactory, IGBaseTableServiceFactory gBaseTableServiceFactory, IGBaseColumnServiceFactory gBaseColumnServiceFactory)
{
GBase = gBaseServiceFactory.Create(settings.Protocol, settings.ServerProtocolGBaseEndpointAddress);
GBaseTable = gBaseTableServiceFactory.Create(settings.Protocol, settings.ServerProtocolGBaseTableEndpointAddress);
GBaseEntry = gBaseEntryServiceFactory.Create(settings.Protocol, settings.ServerProtocolGBaseEntryEndpointAddress);
GBaseColumn = gBaseColumnServiceFactory.Create(settings.Protocol, settings.ServerProtocolGBaseColumnEndpointAddress);
}
/// <summary>
@ -40,9 +39,9 @@ namespace GBase.Client
public IGBaseTableService GBaseTable { get; }
/// <summary>
/// Functions of the GBaseEntry
/// Functions of the GBaseColumn
/// </summary>
public IGBaseEntryService GBaseEntry { get; }
public IGBaseColumnService GBaseColumn { get; }
/// <summary>
/// Dispose used resources asynchronously
@ -52,7 +51,7 @@ namespace GBase.Client
{
await GBase.DisposeAsync();
await GBaseTable.DisposeAsync();
await GBaseEntry.DisposeAsync();
await GBaseColumn.DisposeAsync();
}
}
}

@ -21,15 +21,15 @@ namespace GBase.Client
/// <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)
/// <param name="gBaseColumnEndpoint">The GBaseColumn endpoint</param>
public GBaseClientSettings(ServerProtocol protocol, IPAddress ipAddress, int port, string gBaseEndpoint, string gBaseTableEndpoint, string gBaseColumnEndpoint)
{
Protocol = protocol;
IpAddress = ipAddress;
Port = port;
GBaseEndpoint = gBaseEndpoint;
GBaseTableEndpoint = gBaseTableEndpoint;
GBaseEntryEndpoint = gBaseEntryEndpoint;
GBaseColumnEndpoint = gBaseColumnEndpoint;
}
/// <summary>
@ -58,9 +58,9 @@ namespace GBase.Client
public string GBaseTableEndpoint { get; }
/// <summary>
/// GBaseEntry endpoint the server listens to
/// GBaseColumn endpoint the server listens to
/// </summary>
public string GBaseEntryEndpoint { get; }
public string GBaseColumnEndpoint { get; }
/// <summary>
@ -74,8 +74,8 @@ namespace GBase.Client
public string ServerProtocolGBaseTableEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseTableEndpoint}";
/// <summary>
/// Complete GBaseEntry endpoint address based on the <see cref="ICommunicationSettings"/>
/// Complete GBaseColumn endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
public string ServerProtocolGBaseEntryEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseEntryEndpoint}";
public string ServerProtocolGBaseColumnEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseColumnEndpoint}";
}
}

@ -27,7 +27,7 @@ namespace GBase.Client.Installers
//services
container.Register<IGBaseService, GBaseService>();
container.Register<IGBaseTableService, GBaseTableService>();
container.Register<IGBaseEntryService, GBaseEntryService>();
container.Register<IGBaseColumnService, GBaseColumnService>();
//factories
container.RegisterFactory<IGBaseClientFactory>();
@ -36,7 +36,7 @@ namespace GBase.Client.Installers
//service factories
container.RegisterFactory<IGBaseServiceFactory>();
container.RegisterFactory<IGBaseTableServiceFactory>();
container.RegisterFactory<IGBaseEntryServiceFactory>();
container.RegisterFactory<IGBaseColumnServiceFactory>();
}
}
}

@ -23,8 +23,8 @@ namespace GBase.Client.Interfaces
IGBaseTableService GBaseTable { get; }
/// <summary>
/// Functions of the GBaseEntry
/// Functions of the GBaseColumn
/// </summary>
IGBaseEntryService GBaseEntry { get; }
IGBaseColumnService GBaseColumn { get; }
}
}

@ -22,8 +22,8 @@ namespace GBase.Client.Interfaces
string ServerProtocolGBaseTableEndpointAddress { get; }
/// <summary>
/// Complete GBaseEntry endpoint address based on the <see cref="ICommunicationSettings"/>
/// Complete GBaseColumn endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
string ServerProtocolGBaseEntryEndpointAddress { get; }
string ServerProtocolGBaseColumnEndpointAddress { get; }
}
}

@ -9,16 +9,16 @@ using GBase.Api.Services;
namespace GBase.Client.Services.Factories
{
/// <summary>
/// Factory for the <see cref="IGBaseEntryService"/>
/// Factory for the <see cref="IGBaseColumnService"/>
/// </summary>
public interface IGBaseEntryServiceFactory
public interface IGBaseColumnServiceFactory
{
/// <summary>
/// Creates an <see cref="IGBaseEntryService"/>
/// Creates an <see cref="IGBaseColumnService"/>
/// </summary>
/// <param name="serverProtocol">The <see cref="ServerProtocol"/></param>
/// <param name="endpoint">The endpoint for the GBase</param>
/// <returns>A newly created instance of the implementation for <see cref="IGBaseEntryService"/></returns>
IGBaseEntryService Create(ServerProtocol serverProtocol, string endpoint);
/// <returns>A newly created instance of the implementation for <see cref="IGBaseColumnService"/></returns>
IGBaseColumnService Create(ServerProtocol serverProtocol, string endpoint);
}
}

@ -8,16 +8,16 @@ using GBase.Api.Services;
namespace GBase.Client.Services
{
/// <summary>
/// <see cref="Service{TService}"/> for the IGBaseEntry
/// <see cref="Service{TService}"/> for the IGBaseColumn
/// </summary>
public class GBaseEntryService : Service<IGBaseEntryService>, IGBaseEntryService
public class GBaseColumnService : Service<IGBaseColumnService>, IGBaseColumnService
{
/// <summary>
/// <see cref="Service{TService}"/> for the IGBaseEntry
/// <see cref="Service{TService}"/> for the IGBaseColumn
/// </summary>
/// <param name="serverProtocol">The <see cref="ServerProtocol"/></param>
/// <param name="endpoint">The endpoint for the GBaseEntry</param>
public GBaseEntryService(ServerProtocol serverProtocol, string endpoint)
/// <param name="endpoint">The endpoint for the GBaseColumn</param>
public GBaseColumnService(ServerProtocol serverProtocol, string endpoint)
: base(serverProtocol, endpoint)
{

@ -24,13 +24,13 @@ namespace GBase.Client.Services
}
/// <summary>
/// Add an entry to the GBaseTable
/// Add a column to the GBaseTable
/// </summary>
/// <returns>True if successful, false if not</returns>
public bool AddEntry()
public bool AddColumn()
{
IGBaseTableService channel = OpenChannel();
bool ret = channel.AddEntry();
bool ret = channel.AddColumn();
CloseChannel(channel);
@ -38,13 +38,13 @@ namespace GBase.Client.Services
}
/// <summary>
/// Remove an entry from the GBaseTable
/// Remove a column from the GBaseTable
/// </summary>
/// <returns>True if successful, false if not</returns>
public bool RemoveEntry()
public bool RemoveColumn()
{
IGBaseTableService channel = OpenChannel();
bool ret = channel.RemoveEntry();
bool ret = channel.RemoveColumn();
CloseChannel(channel);

@ -17,14 +17,14 @@ namespace GBase.Server
{
public const string GBASE_ENDPOINT_STARTUP_CONFIGURATION_PREFIX = "GBaseEndpoint";
public const string GBASE_TABLE_ENDPOINT_STARTUP_CONFIGURATION_PREFIX = "GBaseTableEndpoint";
public const string GBASE_ENTRY_ENDPOINT_STARTUP_CONFIGURATION_PREFIX = "GBaseEntryEndpoint";
public const string GBASE_COLUMN_ENDPOINT_STARTUP_CONFIGURATION_PREFIX = "GBaseColumnEndpoint";
private const string PROTOCOL_ARGUMENT_PREFIX = "-pr";
private const string IP_ADDRESS_ARGUMENT_PREFIX = "-ip";
private const string PORT_ARGUMENT_PREFIX = "-p";
private const string ENDPOINT_ARGUMENT_PREFIX = "-e";
private const string TABLE_ENDPOINT_ARGUMENT_PREFIX = "-et";
private const string ENTRY_ENDPOINT_ARGUMENT_PREFIX = "-ee";
private const string COLUMN_ENDPOINT_ARGUMENT_PREFIX = "-ee";
private const string LOG_FILE_PATH_ARGUMENT_PREFIX = "-lp";
private const string LOG_FILE_NAME_ARGUMENT_PREFIX = "-ln";
@ -39,7 +39,7 @@ namespace GBase.Server
private bool _portInitialized;
private bool _gBaseEndpointInitialized;
private bool _gBaseTableEndpointInitialized;
private bool _gBaseEntryEndpointInitialized;
private bool _gBaseColumnEndpointInitialized;
private bool _logFilePathInitialized;
private bool _logFileNameInitialized;
@ -49,7 +49,7 @@ namespace GBase.Server
public int Port { get; private set; }
public string GBaseEndpoint { get; private set; }
public string GBaseTableEndpoint { get; private set; }
public string GBaseEntryEndpoint { get; private set; }
public string GBaseColumnEndpoint { get; private set; }
public string LogFilePath { get; private set; }
public string LogFileName { get; private set; }
@ -98,13 +98,13 @@ namespace GBase.Server
GBaseTableEndpoint = args[index];
_gBaseTableEndpointInitialized = true;
}
else if (args[index] == ENTRY_ENDPOINT_ARGUMENT_PREFIX)
else if (args[index] == COLUMN_ENDPOINT_ARGUMENT_PREFIX)
{
index++;
await VerifyArgsLength(index, args.Length);
GBaseEntryEndpoint = args[index];
_gBaseEntryEndpointInitialized = true;
GBaseColumnEndpoint = args[index];
_gBaseColumnEndpointInitialized = true;
}
else if (args[index] == LOG_FILE_PATH_ARGUMENT_PREFIX)
{
@ -152,7 +152,7 @@ namespace GBase.Server
LogFileName = _defaultLogFileName;
//mandatory settings
if (_protocolInitialized && _ipAddressInitialized && _portInitialized && _gBaseEndpointInitialized && _gBaseTableEndpointInitialized && _gBaseEntryEndpointInitialized)
if (_protocolInitialized && _ipAddressInitialized && _portInitialized && _gBaseEndpointInitialized && _gBaseTableEndpointInitialized && _gBaseColumnEndpointInitialized)
return true;
await PrintHelp();
@ -167,7 +167,7 @@ namespace GBase.Server
await Log.Write<GBaseServerSettings>($"{PORT_ARGUMENT_PREFIX}: The used port");
await Log.Write<GBaseServerSettings>($"{ENDPOINT_ARGUMENT_PREFIX}: The used GBase endpoint");
await Log.Write<GBaseServerSettings>($"{TABLE_ENDPOINT_ARGUMENT_PREFIX}: The used GBase table endpoint");
await Log.Write<GBaseServerSettings>($"{ENTRY_ENDPOINT_ARGUMENT_PREFIX}: The used GBase entry endpoint");
await Log.Write<GBaseServerSettings>($"{COLUMN_ENDPOINT_ARGUMENT_PREFIX}: The used GBase column endpoint");
await Log.Write<GBaseServerSettings>("");
await Log.Write<GBaseServerSettings>("Optional Arguments:");
await Log.Write<GBaseServerSettings>($"{LOG_FILE_PATH_ARGUMENT_PREFIX}: The path to the server log file (default: '{_defaultLogFilePath}')");

@ -68,7 +68,7 @@ namespace GBase.Server
{
$"--{GBaseServerSettings.GBASE_ENDPOINT_STARTUP_CONFIGURATION_PREFIX}", serverSettings.GBaseEndpoint,
$"--{GBaseServerSettings.GBASE_TABLE_ENDPOINT_STARTUP_CONFIGURATION_PREFIX}", serverSettings.GBaseTableEndpoint,
$"--{GBaseServerSettings.GBASE_ENTRY_ENDPOINT_STARTUP_CONFIGURATION_PREFIX}", serverSettings.GBaseEntryEndpoint
$"--{GBaseServerSettings.GBASE_COLUMN_ENDPOINT_STARTUP_CONFIGURATION_PREFIX}", serverSettings.GBaseColumnEndpoint
});
})
.UseStartup<Startup>();

@ -7,7 +7,7 @@ using GBase.Api.Services;
namespace GBase.Server.Services
{
public class GBaseEntryService : IGBaseEntryService
public class GBaseColumnService : IGBaseColumnService
{
public void Dummy()
{

@ -9,12 +9,12 @@ namespace GBase.Server.Services
{
public class GBaseTableService : IGBaseTableService
{
public bool AddEntry()
public bool AddColumn()
{
throw new System.NotImplementedException();
}
public bool RemoveEntry()
public bool RemoveColumn()
{
throw new System.NotImplementedException();
}

@ -37,8 +37,8 @@ namespace GBase.Server
builder.AddService<GBaseTableService>();
builder.AddServiceEndpoint<GBaseTableService, IGBaseTableService>(new BasicHttpBinding(), _configuration[GBaseServerSettings.GBASE_TABLE_ENDPOINT_STARTUP_CONFIGURATION_PREFIX]);
builder.AddService<GBaseEntryService>();
builder.AddServiceEndpoint<GBaseEntryService, IGBaseEntryService>(new BasicHttpBinding(), _configuration[GBaseServerSettings.GBASE_ENTRY_ENDPOINT_STARTUP_CONFIGURATION_PREFIX]);
builder.AddService<GBaseColumnService>();
builder.AddServiceEndpoint<GBaseColumnService, IGBaseColumnService>(new BasicHttpBinding(), _configuration[GBaseServerSettings.GBASE_COLUMN_ENDPOINT_STARTUP_CONFIGURATION_PREFIX]);
});
}
}

@ -8,14 +8,14 @@ using GBase.Interfaces;
namespace GBase.Attributes
{
/// <summary>
/// Tags a property as an <see cref="IGBaseEntry"/>
/// Tags a property as an <see cref="IGBaseColumn"/>
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class GBaseEntryAttribute : Attribute
public class GBaseColumnAttribute : Attribute
{
/// <summary>
/// The value of the linked property changed
/// </summary>
public event EventHandler ValueChanged; //TODO: Automatically fire this event if the value of the linked property changes and subscribe to it in the correct IGBaseEntry
public event EventHandler ValueChanged; //TODO: Automatically fire this event if the value of the linked property changes and subscribe to it in the correct IGBaseColumn (remove?)
}
}

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using GBase.Attributes;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
@ -11,28 +12,42 @@ using Microsoft.CodeAnalysis.Diagnostics;
namespace GBase.Diagnosis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class GBaseTableEntryAnalyzer : DiagnosticAnalyzer
public class GBaseTableColumnAnalyzer : DiagnosticAnalyzer
{
private const string DIAGNOSTIC_ID = "GBaseTableEntryAnalyzer";
private const string CATEGORY = "GBaseTableEntryAnalyzer Category";
private const string DIAGNOSTIC_ID = "GBaseTableColumnAnalyzer";
private const string CATEGORY = "GBaseTableColumnAnalyzer Category";
private static readonly LocalizableString _title = "Missing GBaseEntries for this GBaseTable";
private static readonly LocalizableString _messageFormat = "Type '{0}' is marked as GBaseTable but doesn't contain any GBase entries.";
private static readonly LocalizableString _title = "Missing GBaseColumns for this GBaseTable";
private static readonly LocalizableString _messageFormat = "Type '{0}' is marked as GBaseTable but doesn't contain any GBase columns.";
private static readonly DiagnosticDescriptor _rule = new DiagnosticDescriptor(DIAGNOSTIC_ID, _title, _messageFormat, CATEGORY, DiagnosticSeverity.Warning, true);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get { return ImmutableArray.Create(_rule); } }
private bool _nodeAnalyzed;
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(_rule);
private List<ClassDeclarationSyntax> TableClasses { get; }
public override void Initialize(AnalysisContext context)
{
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
context.EnableConcurrentExecution();
context.RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.Attribute);
context.RegisterSyntaxNodeAction(AnalyzeClass, SyntaxKind.ClassDeclaration);
context.RegisterSyntaxNodeAction(AnalyzeMethod, SyntaxKind.MethodDeclaration);
}
private void AnalyzeNode(SyntaxNodeAnalysisContext context)
private void AnalyzeClass(SyntaxNodeAnalysisContext context)
{
AttributeSyntax attribute = (AttributeSyntax) context.Node;
ClassDeclarationSyntax classDeclaration = (ClassDeclarationSyntax) context.Node;
if (!classDeclaration.AttributeLists.SelectMany(l => l.Attributes).Any(a => a.Name.ToString().Equals(nameof(GBaseTableAttribute))))
return;
_nodeAnalyzed = true;
}
private void AnalyzeMethod(SyntaxNodeAnalysisContext context)
{
}
}
}

@ -8,14 +8,14 @@ using GBase.Interfaces;
namespace GBase.Factories
{
/// <summary>
/// Factory for the <see cref="IGBaseEntry"/>
/// Factory for the <see cref="IGBaseColumn"/>
/// </summary>
public interface IGBaseEntryFactory
public interface IGBaseColumnFactory
{
/// <summary>
/// Creates an <see cref="IGBaseEntry"/>
/// Creates an <see cref="IGBaseColumn"/>
/// </summary>
/// <returns>A newly created instance of the implementation for <see cref="IGBaseEntry"/></returns>
IGBaseEntry Create();
/// <returns>A newly created instance of the implementation for <see cref="IGBaseColumn"/></returns>
IGBaseColumn Create();
}
}

@ -4,12 +4,12 @@
<name>GBase</name>
</assembly>
<members>
<member name="T:GBase.Attributes.GBaseEntryAttribute">
<member name="T:GBase.Attributes.GBaseColumnAttribute">
<summary>
Tags a property as an <see cref="T:GBase.Interfaces.IGBaseEntry"/>
Tags a property as an <see cref="T:GBase.Interfaces.IGBaseColumn"/>
</summary>
</member>
<member name="E:GBase.Attributes.GBaseEntryAttribute.ValueChanged">
<member name="E:GBase.Attributes.GBaseColumnAttribute.ValueChanged">
<summary>
The value of the linked property changed
</summary>
@ -360,16 +360,16 @@
The <see cref="T:System.Type"/> of the passed interface
</summary>
</member>
<member name="T:GBase.Factories.IGBaseEntryFactory">
<member name="T:GBase.Factories.IGBaseColumnFactory">
<summary>
Factory for the <see cref="T:GBase.Interfaces.IGBaseEntry"/>
Factory for the <see cref="T:GBase.Interfaces.IGBaseColumn"/>
</summary>
</member>
<member name="M:GBase.Factories.IGBaseEntryFactory.Create">
<member name="M:GBase.Factories.IGBaseColumnFactory.Create">
<summary>
Creates an <see cref="T:GBase.Interfaces.IGBaseEntry"/>
Creates an <see cref="T:GBase.Interfaces.IGBaseColumn"/>
</summary>
<returns>A newly created instance of the implementation for <see cref="T:GBase.Interfaces.IGBaseEntry"/></returns>
<returns>A newly created instance of the implementation for <see cref="T:GBase.Interfaces.IGBaseColumn"/></returns>
</member>
<member name="T:GBase.Factories.IGBaseFactory">
<summary>
@ -410,6 +410,17 @@
Internal file handler
</summary>
</member>
<member name="M:GBase.FileHandling.FileHandler.#ctor(GBase.DataHandling.Factories.IXmlDataHandlerFactory)">
<summary>
Internal file handler
</summary>
<param name="xmlDataHandlerFactory">Factory for the <see cref="T:GBase.Interfaces.DataHandling.Xml.IXmlDataHandler"/></param>
</member>
<member name="P:GBase.FileHandling.FileHandler.DataHandler">
<summary>
The <see cref="T:GBase.Interfaces.DataHandling.IDataHandler"/> of this <see cref="T:GBase.Interfaces.FileHandling.IFileHandler"/>
</summary>
</member>
<member name="M:GBase.FileHandling.FileHandler.Init(System.String,System.Threading.CancellationToken)">
<summary>
Initialize this <see cref="T:GBase.Interfaces.FileHandling.IFileHandler"/>
@ -418,6 +429,44 @@
<param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken"/> to cancel the asynchronous operation</param>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.FileHandling.FileHandler.SetValue``2(System.String,``1)">
<summary>
Set the value for the given property
</summary>
<typeparam name="T">The <see cref="T:System.Type"/> of the property</typeparam>
<typeparam name="TProperty">The <see cref="T:System.Type"/> of the property</typeparam>
<param name="propertyName">The name of the property</param>
<param name="value">The value to set</param>
<returns>A <see cref="T:System.Threading.Tasks.Task"/> to await</returns>
</member>
<member name="M:GBase.FileHandling.FileHandler.RemoveValue``2(System.String,``1)">
<summary>
Remove the value for the given property
</summary>
<typeparam name="T">The <see cref="T:System.Type"/> of the property</typeparam>
<typeparam name="TProperty">The <see cref="T:System.Type"/> of the property</typeparam>
<param name="propertyName">The name of the property</param>
<param name="value">The value to set</param>
<returns>A <see cref="T:System.Threading.Tasks.Task"/> to await</returns>
</member>
<member name="M:GBase.FileHandling.FileHandler.GetValue``2(System.String)">
<summary>
Get the value for the given property, if multiple values are set the first is returned
</summary>
<typeparam name="T">The <see cref="T:System.Type"/> of the property</typeparam>
<typeparam name="TProperty">The <see cref="T:System.Type"/> of the property</typeparam>
<param name="propertyName">The name of the property</param>
<returns>The value for the given property</returns>
</member>
<member name="M:GBase.FileHandling.FileHandler.GetValues``2(System.String)">
<summary>
Get all the values that are set for the given property
</summary>
<typeparam name="T">The <see cref="T:System.Type"/> of the property</typeparam>
<typeparam name="TProperty">The <see cref="T:System.Type"/> of the property</typeparam>
<param name="propertyName">The name of the property</param>
<returns>An <see cref="T:System.Collections.Generic.IEnumerable`1"/> with all the values for the property</returns>
</member>
<member name="M:GBase.FileHandling.FileHandler.DisposeAsync">
<summary>
Dispose used resources asynchronously
@ -485,22 +534,28 @@
</summary>
<returns>A <see cref="T:System.Threading.Tasks.ValueTask"/> to await</returns>
</member>
<member name="T:GBase.GBaseEntry">
<member name="T:GBase.GBaseColumn">
<summary>
An entry of a <see cref="T:GBase.Interfaces.IGBaseTable"/>
A column of a <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
</member>
<member name="M:GBase.GBaseEntry.#ctor">
<member name="M:GBase.GBaseColumn.#ctor">
<summary>
An entry of a <see cref="T:GBase.Interfaces.IGBaseTable"/>
A column of a <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
</member>
<member name="M:GBase.GBaseColumn.DisposeAsync">
<summary>
The <see cref="M:System.IAsyncDisposable.DisposeAsync"/> method
</summary>
<returns>A <see cref="T:System.Threading.Tasks.ValueTask"/> to await</returns>
</member>
<member name="T:GBase.GBaseTable">
<summary>
A <see cref="T:GBase.Interfaces.IGBase"/> table
</summary>
</member>
<member name="M:GBase.GBaseTable.#ctor(GBase.FileHandling.Factories.IFileHandlerFactory,GBase.Factories.IGBaseEntryFactory)">
<member name="M:GBase.GBaseTable.#ctor(GBase.FileHandling.Factories.IFileHandlerFactory,GBase.Factories.IGBaseColumnFactory)">
<summary>
A <see cref="T:GBase.Interfaces.IGBase"/> table
</summary>
@ -515,9 +570,9 @@
The name of this <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
</member>
<member name="P:GBase.GBaseTable.Entries">
<member name="P:GBase.GBaseTable.Columns">
<summary>
The <see cref="T:GBase.Interfaces.IGBaseEntry"/>s of this <see cref="T:GBase.Interfaces.IGBaseTable"/>
The <see cref="T:GBase.Interfaces.IGBaseColumn"/>s of this <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
</member>
<member name="M:GBase.GBaseTable.Init(System.Type,System.String,System.String,System.Threading.CancellationToken)">
@ -530,18 +585,18 @@
<param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken"/> to cancel the asynchronous operation</param>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.GBaseTable.AddEntry(GBase.Interfaces.IGBaseEntry)">
<member name="M:GBase.GBaseTable.AddColumn(GBase.Interfaces.IGBaseColumn)">
<summary>
Add a given <see cref="T:GBase.Interfaces.IGBaseEntry"/> to this <see cref="T:GBase.Interfaces.IGBaseTable"/>
Add a given <see cref="T:GBase.Interfaces.IGBaseColumn"/> to this <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
<param name="entry">The given <see cref="T:GBase.Interfaces.IGBaseEntry"/></param>
<param name="column">The given <see cref="T:GBase.Interfaces.IGBaseColumn"/></param>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.GBaseTable.RemoveEntry(GBase.Interfaces.IGBaseEntry)">
<member name="M:GBase.GBaseTable.RemoveColumn(GBase.Interfaces.IGBaseColumn)">
<summary>
Remove a given <see cref="T:GBase.Interfaces.IGBaseEntry"/> from this <see cref="T:GBase.Interfaces.IGBaseTable"/>
Remove a given <see cref="T:GBase.Interfaces.IGBaseColumn"/> from this <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
<param name="entry">The given <see cref="T:GBase.Interfaces.IGBaseEntry"/></param>
<param name="column">The given <see cref="T:GBase.Interfaces.IGBaseColumn"/></param>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.GBaseTable.DisposeAsync">
@ -807,6 +862,44 @@
<param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken"/> to cancel the asynchronous operation</param>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.Interfaces.FileHandling.IFileHandler.SetValue``2(System.String,``1)">
<summary>
Set the value for the given property
</summary>
<typeparam name="T">The <see cref="T:System.Type"/> of the property</typeparam>
<typeparam name="TProperty">The <see cref="T:System.Type"/> of the property</typeparam>
<param name="propertyName">The name of the property</param>
<param name="value">The value to set</param>
<returns>A <see cref="T:System.Threading.Tasks.Task"/> to await</returns>
</member>
<member name="M:GBase.Interfaces.FileHandling.IFileHandler.RemoveValue``2(System.String,``1)">
<summary>
Remove the value for the given property
</summary>
<typeparam name="T">The <see cref="T:System.Type"/> of the property</typeparam>
<typeparam name="TProperty">The <see cref="T:System.Type"/> of the property</typeparam>
<param name="propertyName">The name of the property</param>
<param name="value">The value to set</param>
<returns>A <see cref="T:System.Threading.Tasks.Task"/> to await</returns>
</member>
<member name="M:GBase.Interfaces.FileHandling.IFileHandler.GetValue``2(System.String)">
<summary>
Get the value for the given property, if multiple values are set the first is returned
</summary>
<typeparam name="T">The <see cref="T:System.Type"/> of the property</typeparam>
<typeparam name="TProperty">The <see cref="T:System.Type"/> of the property</typeparam>
<param name="propertyName">The name of the property</param>
<returns>The value for the given property</returns>
</member>
<member name="M:GBase.Interfaces.FileHandling.IFileHandler.GetValues``2(System.String)">
<summary>
Get all the values that are set for the given property
</summary>
<typeparam name="T">The <see cref="T:System.Type"/> of the property</typeparam>
<typeparam name="TProperty">The <see cref="T:System.Type"/> of the property</typeparam>
<param name="propertyName">The name of the property</param>
<returns>An <see cref="T:System.Collections.Generic.IEnumerable`1"/> with all the values for the property</returns>
</member>
<member name="T:GBase.Interfaces.IGBase">
<summary>
The base class of the GBase database
@ -850,9 +943,9 @@
<param name="table">The given <see cref="T:GBase.Interfaces.IGBaseTable"/></param>
<returns>True if successful, false if not</returns>
</member>
<member name="T:GBase.Interfaces.IGBaseEntry">
<member name="T:GBase.Interfaces.IGBaseColumn">
<summary>
An entry of a <see cref="T:GBase.Interfaces.IGBaseTable"/>
A column of a <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
</member>
<member name="T:GBase.Interfaces.IGBaseTable">
@ -870,9 +963,9 @@
The name of this <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
</member>
<member name="P:GBase.Interfaces.IGBaseTable.Entries">
<member name="P:GBase.Interfaces.IGBaseTable.Columns">
<summary>
The <see cref="T:GBase.Interfaces.IGBaseEntry"/>s of this <see cref="T:GBase.Interfaces.IGBaseTable"/>
The <see cref="T:GBase.Interfaces.IGBaseColumn"/>s of this <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
</member>
<member name="M:GBase.Interfaces.IGBaseTable.Init(System.Type,System.String,System.String,System.Threading.CancellationToken)">
@ -885,18 +978,18 @@
<param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken"/> to cancel the asynchronous operation</param>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.Interfaces.IGBaseTable.AddEntry(GBase.Interfaces.IGBaseEntry)">
<member name="M:GBase.Interfaces.IGBaseTable.AddColumn(GBase.Interfaces.IGBaseColumn)">
<summary>
Add a given <see cref="T:GBase.Interfaces.IGBaseEntry"/> to this <see cref="T:GBase.Interfaces.IGBaseTable"/>
Add a given <see cref="T:GBase.Interfaces.IGBaseColumn"/> to this <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
<param name="entry">The given <see cref="T:GBase.Interfaces.IGBaseEntry"/></param>
<param name="column">The given <see cref="T:GBase.Interfaces.IGBaseColumn"/></param>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.Interfaces.IGBaseTable.RemoveEntry(GBase.Interfaces.IGBaseEntry)">
<member name="M:GBase.Interfaces.IGBaseTable.RemoveColumn(GBase.Interfaces.IGBaseColumn)">
<summary>
Remove a given <see cref="T:GBase.Interfaces.IGBaseEntry"/> from this <see cref="T:GBase.Interfaces.IGBaseTable"/>
Remove a given <see cref="T:GBase.Interfaces.IGBaseColumn"/> from this <see cref="T:GBase.Interfaces.IGBaseTable"/>
</summary>
<param name="entry">The given <see cref="T:GBase.Interfaces.IGBaseEntry"/></param>
<param name="column">The given <see cref="T:GBase.Interfaces.IGBaseColumn"/></param>
<returns>True if successful, false if not</returns>
</member>
<member name="T:GBase.Interfaces.Settings.IGBaseSettings">

@ -9,14 +9,14 @@ using GBase.Interfaces;
namespace GBase
{
/// <summary>
/// An entry of a <see cref="IGBaseTable"/>
/// A column of a <see cref="IGBaseTable"/>
/// </summary>
public class GBaseEntry : IGBaseEntry
public class GBaseColumn : IGBaseColumn
{
/// <summary>
/// An entry of a <see cref="IGBaseTable"/>
/// A column of a <see cref="IGBaseTable"/>
/// </summary>
public GBaseEntry()
public GBaseColumn()
{
}

@ -22,16 +22,16 @@ namespace GBase
public class GBaseTable : IGBaseTable
{
private readonly IFileHandler _fileHandler;
private readonly IGBaseEntryFactory _gBaseEntryFactory;
private readonly IGBaseColumnFactory _gBaseColumnFactory;
/// <summary>
/// A <see cref="IGBase"/> table
/// </summary>
public GBaseTable(IFileHandlerFactory fileHandlerFactory, IGBaseEntryFactory gBaseEntryFactory)
public GBaseTable(IFileHandlerFactory fileHandlerFactory, IGBaseColumnFactory gBaseColumnFactory)
{
_fileHandler = fileHandlerFactory.Create();
_gBaseEntryFactory = gBaseEntryFactory;
Entries = new List<IGBaseEntry>();
_gBaseColumnFactory = gBaseColumnFactory;
Columns = new List<IGBaseColumn>();
}
/// <summary>
@ -45,9 +45,9 @@ namespace GBase
public string Name { get; private set; }
/// <summary>
/// The <see cref="IGBaseEntry"/>s of this <see cref="IGBaseTable"/>
/// The <see cref="IGBaseColumn"/>s of this <see cref="IGBaseTable"/>
/// </summary>
public List<IGBaseEntry> Entries { get; }
public List<IGBaseColumn> Columns { get; }
/// <summary>
@ -67,45 +67,45 @@ namespace GBase
string path = Path.Combine(databasePath, fileName);
await _fileHandler.Init(path, cancellationToken);
//TODO: Init Entries list depending on GBaseEntryAttributes set for this GBaseTable
//TODO: Init columns list depending on GBaseColumnAttributes set for this GBaseTable
foreach (var property in type.GetProperties())
{
GBaseEntryAttribute gBaseEntryAttribute = property.GetCustomAttribute<GBaseEntryAttribute>();
if (gBaseEntryAttribute == null)
GBaseColumnAttribute gBaseColumnAttribute = property.GetCustomAttribute<GBaseColumnAttribute>();
if (gBaseColumnAttribute == null)
continue;
IGBaseEntry gBaseEntry = _gBaseEntryFactory.Create();
AddEntry(gBaseEntry);
IGBaseColumn gBaseColumn = _gBaseColumnFactory.Create();
AddColumn(gBaseColumn);
}
return true;
}
/// <summary>
/// Add a given <see cref="IGBaseEntry"/> to this <see cref="IGBaseTable"/>
/// Add a given <see cref="IGBaseColumn"/> to this <see cref="IGBaseTable"/>
/// </summary>
/// <param name="entry">The given <see cref="IGBaseEntry"/></param>
/// <param name="column">The given <see cref="IGBaseColumn"/></param>
/// <returns>True if successful, false if not</returns>
public bool AddEntry(IGBaseEntry entry)
public bool AddColumn(IGBaseColumn column)
{
if (Entries.Contains(entry))
if (Columns.Contains(column))
return false;
Entries.Add(entry);
Columns.Add(column);
return true;
}
/// <summary>
/// Remove a given <see cref="IGBaseEntry"/> from this <see cref="IGBaseTable"/>
/// Remove a given <see cref="IGBaseColumn"/> from this <see cref="IGBaseTable"/>
/// </summary>
/// <param name="entry">The given <see cref="IGBaseEntry"/></param>
/// <param name="column">The given <see cref="IGBaseColumn"/></param>
/// <returns>True if successful, false if not</returns>
public bool RemoveEntry(IGBaseEntry entry)
public bool RemoveColumn(IGBaseColumn column)
{
if (!Entries.Contains(entry))
if (!Columns.Contains(column))
return false;
return Entries.Remove(entry);
return Columns.Remove(column);
}
/// <summary>
@ -116,12 +116,12 @@ namespace GBase
{
await _fileHandler.DisposeAsync();
foreach (var entry in Entries)
foreach (var column in Columns)
{
await entry.DisposeAsync();
await column.DisposeAsync();
}
Entries.Clear();
Columns.Clear();
}
}
}

@ -20,12 +20,12 @@ namespace GBase.Installers
{
container.Register<IGBase, GBase>();
container.Register<IGBaseTable, GBaseTable>();
container.Register<IGBaseEntry, GBaseEntry>();
container.Register<IGBaseColumn, GBaseColumn>();
//factories
container.RegisterFactory<IGBaseFactory>();
container.RegisterFactory<IGBaseTableFactory>();
container.RegisterFactory<IGBaseEntryFactory>();
container.RegisterFactory<IGBaseColumnFactory>();
}
}
}

@ -7,9 +7,9 @@ using System;
namespace GBase.Interfaces
{
/// <summary>
/// An entry of a <see cref="IGBaseTable"/>
/// A column of a <see cref="IGBaseTable"/>
/// </summary>
public interface IGBaseEntry : IAsyncDisposable //TODO: Make entry generic (generic type is type of the value of the entry?)
public interface IGBaseColumn : IAsyncDisposable //TODO: Make column generic (generic type is type of the value of the column?)?
{
}

@ -25,9 +25,9 @@ namespace GBase.Interfaces
string Name { get; }
/// <summary>
/// The <see cref="IGBaseEntry"/>s of this <see cref="IGBaseTable"/>
/// The <see cref="IGBaseColumn"/>s of this <see cref="IGBaseTable"/>
/// </summary>
List<IGBaseEntry> Entries { get; }
List<IGBaseColumn> Columns { get; }
/// <summary>
/// Initialize this <see cref="IGBase"/>
@ -40,18 +40,18 @@ namespace GBase.Interfaces
Task<bool> Init(Type type, string name, string databasePath, CancellationToken cancellationToken);
/// <summary>
/// Add a given <see cref="IGBaseEntry"/> to this <see cref="IGBaseTable"/>
/// Add a given <see cref="IGBaseColumn"/> to this <see cref="IGBaseTable"/>
/// </summary>
/// <param name="entry">The given <see cref="IGBaseEntry"/></param>
/// <param name="column">The given <see cref="IGBaseColumn"/></param>
/// <returns>True if successful, false if not</returns>
bool AddEntry(IGBaseEntry entry);
bool AddColumn(IGBaseColumn column);
/// <summary>
/// Remove a given <see cref="IGBaseEntry"/> from this <see cref="IGBaseTable"/>
/// Remove a given <see cref="IGBaseColumn"/> from this <see cref="IGBaseTable"/>
/// </summary>
/// <param name="entry">The given <see cref="IGBaseEntry"/></param>
/// <param name="column">The given <see cref="IGBaseColumn"/></param>
/// <returns>True if successful, false if not</returns>
bool RemoveEntry(IGBaseEntry entry);
bool RemoveColumn(IGBaseColumn column);
}
}

@ -1,7 +1,6 @@
using System.Net;
using GBase.Api.Communication;
using GBase.Client;
using GBase.Client.Factories;
using GBase.Client.Interfaces;
using GBase.Client.Services.Factories;
using Moq;
@ -20,11 +19,11 @@ namespace Test.GBase.Client
[Test]
public void CheckBasicConnectionWithServer()
{
Assert.Pass(); //Remove this assert if you want to run the test, not possible to with CI
Assert.Pass(); //Remove this assert if you want to run the test, not possible with CI
IGBaseClientSettings settings =
new GBaseClientSettings(ServerProtocol.Http, IPAddress.Parse("127.0.0.1"), 8080, "/GBase", "/GBaseTable", "/GBaseEntry");
IGBaseClient client = new GBaseClient(settings, new Mock<IGBaseServiceFactory>().Object, new Mock<IGBaseTableServiceFactory>().Object, new Mock<IGBaseEntryServiceFactory>().Object);
new GBaseClientSettings(ServerProtocol.Http, IPAddress.Parse("127.0.0.1"), 8080, "/GBase", "/GBaseTable", "/GBaseColumn");
IGBaseClient client = new GBaseClient(settings, new Mock<IGBaseServiceFactory>().Object, new Mock<IGBaseTableServiceFactory>().Object, new Mock<IGBaseColumnServiceFactory>().Object);
bool ret = client.GBase.AddTable();
Assert.True(ret);

@ -12,7 +12,7 @@ namespace Test.GBase.TestClasses
{
private string _name;
[GBaseEntry]
[GBaseColumn]
public string Name
{
get => _name;

Loading…
Cancel
Save