Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
janzenisek committed Feb 1, 2024
2 parents b49be56 + abc7120 commit 21ba80a
Show file tree
Hide file tree
Showing 41 changed files with 72 additions and 72 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/Communication/Broker/IBroker.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using DAT.Configuration;
using Ai.Hgb.Dat.Configuration;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public interface IBroker : IDisposable {
HostAddress Address { get; }

Expand Down
4 changes: 2 additions & 2 deletions src/Communication/Broker/MqttBroker.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DAT.Configuration;
using Ai.Hgb.Dat.Configuration;
using MQTTnet;
using MQTTnet.Server;
using MQTTnet.AspNetCore;
Expand All @@ -8,7 +8,7 @@
using Microsoft.Extensions.DependencyInjection;

// https://blog.behroozbc.ir/c-mqtt-broker-using-mqttnet-version-4
namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public sealed class MqttBroker : IBroker {
public HostAddress Address {
get { return address; }
Expand Down
4 changes: 2 additions & 2 deletions src/Communication/Communication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>DAT.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>DAT.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<AssemblyName>Ai.Hgb.Dat.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Ai.Hgb.Dat.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<AssemblyVersion></AssemblyVersion>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/Communication/DataStructures.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using DAT.Configuration;
using DAT.Utils;
using Ai.Hgb.Dat.Configuration;
using Ai.Hgb.Dat.Utils;
using MemoryPack;
using System.Net.Mime;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {

public interface IMessage : ICloneable {
string ClientId { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Communication/InterfaceStore.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {

public enum CommunicationMode {
Publish,
Expand Down
2 changes: 1 addition & 1 deletion src/Communication/PayloadConverter/IPayloadConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public interface IPayloadConverter {
byte[] Serialize<T>(T payload);

Expand Down
2 changes: 1 addition & 1 deletion src/Communication/PayloadConverter/JsonPayloadConverter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text;
using System.Text.Json;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public class JsonPayloadConverter : IPayloadConverter {
public T Deserialize<T>(byte[] payload) {
if (payload == null) return default(T);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public class MemoryPackPayloadConverter : IPayloadConverter {
public T Deserialize<T>(byte[] payload) {
return MemoryPackSerializer.Deserialize<T>(payload);
Expand Down
4 changes: 2 additions & 2 deletions src/Communication/PayloadConverter/PayloadConverter.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using DAT.Configuration;
using Ai.Hgb.Dat.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public class PayloadConverter {
private static Dictionary<PayloadFormat, Type> payloadFormatDict
= new Dictionary<PayloadFormat, Type>
Expand Down
2 changes: 1 addition & 1 deletion src/Communication/PayloadConverter/YamlPayloadConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading.Tasks;
using YamlDotNet.Serialization;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public class YamlPayloadConverter : IPayloadConverter {

private ISerializer ser;
Expand Down
6 changes: 3 additions & 3 deletions src/Communication/Sockets/ApachekafkaSocket.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Confluent.Kafka;
using DAT.Configuration;
using DAT.Utils;
using Ai.Hgb.Dat.Configuration;
using Ai.Hgb.Dat.Utils;
using Microsoft.Extensions.Configuration;
using MQTTnet;
using System.Net;
using System.Net.Sockets;
using System.Xml.Linq;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public class ApachekafkaSocket : ISocket {

public SocketConfiguration Configuration {
Expand Down
2 changes: 1 addition & 1 deletion src/Communication/Sockets/DynamicSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace DAT.Communication.Sockets {
namespace Ai.Hgb.Dat.Communication.Sockets {
public class DynamicSocket {

// TBD: hosts different sockets and dynamically at runtime (optionally also autonomously) decides which to use
Expand Down
6 changes: 3 additions & 3 deletions src/Communication/Sockets/ISocket.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using DAT.Configuration;
using DAT.Utils;
using Ai.Hgb.Dat.Configuration;
using Ai.Hgb.Dat.Utils;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
/// <summary>
/// This interface describes the base functionality all socket implementations must provide.
/// </summary>
Expand Down
8 changes: 4 additions & 4 deletions src/Communication/Sockets/MqttSocket.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Confluent.Kafka;
using DAT.Configuration;
using DAT.Utils;
using Ai.Hgb.Dat.Configuration;
using Ai.Hgb.Dat.Utils;
using MQTTnet;
using MQTTnet.Client;
using MQTTnet.Extensions.ManagedClient;
Expand All @@ -9,7 +9,7 @@
using System;
using System.Net.Mime;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public class MqttSocket : ISocket {

public SocketConfiguration Configuration {
Expand Down Expand Up @@ -139,7 +139,7 @@ public object Clone() {
BlockingActionExecution);
}

private void Configuration_ConfigurationChanged(object sender, EventArgs<DAT.Configuration.IConfiguration> e) {
private void Configuration_ConfigurationChanged(object sender, EventArgs<Ai.Hgb.Dat.Configuration.IConfiguration> e) {
Console.WriteLine("Udating socket now...");
var newConfiguration = e.Value as SocketConfiguration;

Expand Down
2 changes: 1 addition & 1 deletion src/Communication/Sockets/SharedMemorySocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Threading.Tasks;
using YamlDotNet.Core.Tokens;

namespace DAT.Communication.Sockets {
namespace Ai.Hgb.Dat.Communication.Sockets {
public class SharedMemorySocket {

public string Id { get => id; set => id = value; }
Expand Down
4 changes: 2 additions & 2 deletions src/Communication/Sockets/Socket.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using DAT.Configuration;
using Ai.Hgb.Dat.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAT.Communication {
namespace Ai.Hgb.Dat.Communication {
public class Socket {
private static Dictionary<SocketType, Type> socketTypeDict
= new Dictionary<SocketType, Type>
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>DAT.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>DAT.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<AssemblyName>Ai.Hgb.Dat.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Ai.Hgb.Dat.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
</PropertyGroup>

<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/Configurations/BrokerConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DAT.Utils;
using Ai.Hgb.Dat.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -7,7 +7,7 @@
using System.Threading.Tasks;
using System.Xml.Linq;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public class BrokerConfiguration : IConfiguration {
public string Type { get; set; }
public string Url { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/Configurations/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using DAT.Utils;
using Ai.Hgb.Dat.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public class Configuration : IConfiguration {
public string Type { get; set; }
public string Url { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/Configurations/IConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using DAT.Utils;
using Ai.Hgb.Dat.Utils;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public interface IConfiguration : ICloneable {

string Type { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/Configurations/SocketConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using DAT.Utils;
using Ai.Hgb.Dat.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public class SocketConfiguration : IConfiguration {
public string Type { get; set; }
public string Url { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/DataStructures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Threading.Tasks;
using YamlDotNet.Serialization;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public class HostAddress {
public HostAddress() { }

Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/Monitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading.Tasks;
using YamlDotNet.Core;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public class Monitor<T> : BackgroundService where T : IConfiguration {
public T Configuration { get { return configuration; } set { configuration = value; } }
public IParser Parser { get { return parser; } private set { parser = value; } }
Expand All @@ -25,7 +25,7 @@ public Monitor(IParser parser) {
}

public void Initialize(string uri) {
parser = DAT.Configuration.Parser.GetParser(uri);
parser = Ai.Hgb.Dat.Configuration.Parser.GetParser(uri);
configuration = parser.Parse<T>(uri);
monitorIntervalMilliseconds = Configuration.MonitorIntervalMilliseconds;
cts = new CancellationTokenSource();
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/Parser/IParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public interface IParser {
IConfiguration Parse(string uri);

Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/Parser/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public static class Parser {

private static YamlParser yamlParser = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/Parser/SidlParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public class SidlParser : IParser {
public IConfiguration Parse(string uri) {
throw new NotImplementedException();
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/Parser/YamlParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;

namespace DAT.Configuration {
namespace Ai.Hgb.Dat.Configuration {
public class YamlParser : IParser {

private ISerializer ser;
Expand Down
2 changes: 1 addition & 1 deletion src/DemoApp/Configurations/ConsumerConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ PayloadType: json
DefaultSubscriptionOptions:
Topic: docs
QosLevel: ExactlyOnce
ContentTypeFullName: DAT.DemoApp.Document
ContentTypeFullName: Ai.Hgb.Dat.DemoApp.Document
2 changes: 1 addition & 1 deletion src/DemoApp/Configurations/ServerSocket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DefaultPublicationOptions:
DefaultSubscriptionOptions:
Topic: docs
QosLevel: ExactlyOnce
ContentTypeFullName: DAT.DemoApp.Document
ContentTypeFullName: Ai.Hgb.Dat.DemoApp.Document

DefaultRequestOptions:
Topic: docs
Expand Down
2 changes: 1 addition & 1 deletion src/DemoApp/Configurations/SocketConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DefaultPublicationOptions:
DefaultSubscriptionOptions:
Topic: docs
QosLevel: ExactlyOnce
ContentTypeFullName: DAT.DemoApp.Document
ContentTypeFullName: Ai.Hgb.Dat.DemoApp.Document

DefaultRequestOptions:
Topic: docs
Expand Down
2 changes: 1 addition & 1 deletion src/DemoApp/DataStructures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace DAT.DemoApp {
namespace Ai.Hgb.Dat.DemoApp {
public struct Document {

public string Id { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/DemoApp/DemoApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>DAT.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>DAT.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<AssemblyName>Ai.Hgb.Dat.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Ai.Hgb.Dat.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/DemoApp/PerformanceTestSuite.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using DAT.Communication;
using DAT.Communication.Sockets;
using DAT.Configuration;
using DAT.Utils;
using Ai.Hgb.Dat.Communication;
using Ai.Hgb.Dat.Communication.Sockets;
using Ai.Hgb.Dat.Configuration;
using Ai.Hgb.Dat.Utils;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAT.DemoApp {
namespace Ai.Hgb.Dat.DemoApp {
public class PerformanceTestSuite {

public static void RunSuite() {
Expand Down
Loading

0 comments on commit 21ba80a

Please sign in to comment.