Skip to content

Commit

Permalink
Merge branch 'release/4.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-hardy committed Nov 25, 2024
2 parents 0f43f63 + beacac4 commit acecaec
Show file tree
Hide file tree
Showing 16 changed files with 833 additions and 27 deletions.
18 changes: 16 additions & 2 deletions CluedIn.Connector.AzureEventHub.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.452
# Visual Studio Version 17
VisualStudioVersion = 17.7.34202.233
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B2A52533-7FBF-41FE-A0AF-874FC54300B2}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -54,6 +54,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connector.AzureEventHub.Uni
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connector.AzureEventHub.Integration.Tests", "test\integration\Connector.AzureEventHub.Integration.Tests\Connector.AzureEventHub.Integration.Tests.csproj", "{2C2CB6A0-AEDD-45D4-8C9F-493760949978}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector.DataActivator", "src\Connector.DataActivator\Connector.DataActivator.csproj", "{28A28F1A-92D4-4AAC-AFD9-529EEFA5CEE3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector.RealTimeIntelligence", "src\Connector.RealTimeIntelligence\Connector.RealTimeIntelligence.csproj", "{364F3946-E08A-4FAA-A887-DE2E0451C058}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -72,6 +76,14 @@ Global
{2C2CB6A0-AEDD-45D4-8C9F-493760949978}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C2CB6A0-AEDD-45D4-8C9F-493760949978}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C2CB6A0-AEDD-45D4-8C9F-493760949978}.Release|Any CPU.Build.0 = Release|Any CPU
{28A28F1A-92D4-4AAC-AFD9-529EEFA5CEE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28A28F1A-92D4-4AAC-AFD9-529EEFA5CEE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28A28F1A-92D4-4AAC-AFD9-529EEFA5CEE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28A28F1A-92D4-4AAC-AFD9-529EEFA5CEE3}.Release|Any CPU.Build.0 = Release|Any CPU
{364F3946-E08A-4FAA-A887-DE2E0451C058}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{364F3946-E08A-4FAA-A887-DE2E0451C058}.Debug|Any CPU.Build.0 = Debug|Any CPU
{364F3946-E08A-4FAA-A887-DE2E0451C058}.Release|Any CPU.ActiveCfg = Release|Any CPU
{364F3946-E08A-4FAA-A887-DE2E0451C058}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -87,6 +99,8 @@ Global
{ED656EF9-9D15-45CA-B505-AF48AD8D0145} = {B2A52533-7FBF-41FE-A0AF-874FC54300B2}
{8B1A895D-5108-4494-914E-F8FEEC53076A} = {A32B6852-82C7-4107-8C68-AE9232289E09}
{2C2CB6A0-AEDD-45D4-8C9F-493760949978} = {DBD1964B-DBD9-4C70-96CA-391C34B3D75F}
{28A28F1A-92D4-4AAC-AFD9-529EEFA5CEE3} = {B2A52533-7FBF-41FE-A0AF-874FC54300B2}
{364F3946-E08A-4FAA-A887-DE2E0451C058} = {B2A52533-7FBF-41FE-A0AF-874FC54300B2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6A61CB42-80C5-4A83-AC3E-DA41FC875525}
Expand Down
6 changes: 6 additions & 0 deletions CluedIn.Connector.AzureEventHub.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
12 changes: 12 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,20 @@
<PackageProjectUrl>http://cluedin.com</PackageProjectUrl>
<PackageIcon>nugetlogo.png</PackageIcon>
</PropertyGroup>

<PropertyGroup Label="FixBuildDefault">
<IncludeProjectsNotInAssetsFileInDepsFile>false</IncludeProjectsNotInAssetsFileInDepsFile>
</PropertyGroup>

<ItemGroup Label="Package Includes">
<None Include="$(MSBuildThisFileDirectory)build\assets\nugetlogo.png" Pack="true" PackagePath="\" />
</ItemGroup>

<!--
We need this to stop build from producing .deps.json files that contains "ReferencedProject.Reference".
It will cause exceptions in CluedIn Server, saying that the item has already been added (ReferencedProject.dll)
-->
<PropertyGroup Label="FixBuildDefault">
<IncludeProjectsNotInAssetsFileInDepsFile>false</IncludeProjectsNotInAssetsFileInDepsFile>
</PropertyGroup>
</Project>
4 changes: 4 additions & 0 deletions docs/4.0.1-release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Features
- ReQueuing on all errors
- Added Data Activator Export Target
- Added Real Time Intelligence Export Target
21 changes: 21 additions & 0 deletions src/Connector.DataActivator/Connector.DataActivator.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<None Remove="Resources\data_activator.svg" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\data_activator.svg" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Connector.SqlServer\Connector.AzureEventHub.csproj" />
</ItemGroup>

</Project>
54 changes: 54 additions & 0 deletions src/Connector.DataActivator/DataActivatorConnectorComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System.Reflection;
using Castle.MicroKernel.Registration;
using CluedIn.Connector.AzureEventHub;
using CluedIn.Core;
using CluedIn.Core.Providers;
using CluedIn.Core.Server;
using ComponentHost;
using Microsoft.Extensions.Logging;

namespace CluedIn.Connector.DataActivator;

[Component(DataActivatorConstants.ProviderName, "Providers", ComponentType.Service, ServerComponents.ProviderWebApi, Components.Server, Components.DataStores, Isolation = ComponentIsolation.NotIsolated)]
public sealed class DataActivatorConnectorComponent : ServiceApplicationComponent<IServer>
{
/**********************************************************************************************************
* CONSTRUCTOR
**********************************************************************************************************/

/// <summary>
/// Initializes a new instance of the <see cref="AzureEventHubConnectorComponent" /> class.
/// </summary>
/// <param name="componentInfo">The component information.</param>
public DataActivatorConnectorComponent(ComponentInfo componentInfo) : base(componentInfo)
{
// Dev. Note: Potential for compiler warning here ... CA2214: Do not call overridable methods in constructors
// this class has been sealed to prevent the CA2214 waring being raised by the compiler
Container.Register(Component.For<DataActivatorConnectorComponent>().Instance(this));
}

/**********************************************************************************************************
* METHODS
**********************************************************************************************************/

/// <summary>Starts this instance.</summary>
public override void Start()
{
var asm = Assembly.GetExecutingAssembly();
Container.Register(Types.FromAssembly(asm).BasedOn<IProvider>().WithServiceFromInterface().If(t => !t.IsAbstract).LifestyleSingleton());

Log.LogInformation("[DataActivator] Data Activator Registered");
State = ServiceState.Started;
}

/// <summary>Stops this instance.</summary>
public override void Stop()
{
if (State == ServiceState.Stopped)
{
return;
}

State = ServiceState.Stopped;
}
}
193 changes: 193 additions & 0 deletions src/Connector.DataActivator/DataActivatorConnectorProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
using CluedIn.Connector.AzureEventHub;
using CluedIn.Core;
using CluedIn.Core.Crawling;
using CluedIn.Core.Data.Relational;
using CluedIn.Core.Providers;
using CluedIn.Core.Webhooks;
using CluedIn.Providers.Models;
using Newtonsoft.Json;
using ExecutionContext = CluedIn.Core.ExecutionContext;

namespace CluedIn.Connector.DataActivator;

public class DataActivatorConnectorProvider : ProviderBase, IExtendedProviderMetadata
{
/**********************************************************************************************************
* CONSTRUCTORS
**********************************************************************************************************/

public DataActivatorConnectorProvider([NotNull] ApplicationContext appContext)
: base(appContext, DataActivatorConstants.CreateProviderMetadata())
{
}

public string ServiceType { get; } = JsonConvert.SerializeObject(DataActivatorConstants.ServiceType);
public string Aliases { get; } = JsonConvert.SerializeObject(DataActivatorConstants.Aliases);

public string Details { get; set; } = DataActivatorConstants.Details;
public string Category { get; set; } = DataActivatorConstants.Category;

public string Icon => DataActivatorConstants.IconResourceName;
public string Domain { get; } = DataActivatorConstants.Uri;
public string About { get; } = DataActivatorConstants.ConnectorDescription;
public AuthMethods AuthMethods => DataActivatorConstants.AuthMethods;
public IEnumerable<Control> Properties { get; } = DataActivatorConstants.Properties;

public Guide Guide { get; set; } = new() { Instructions = DataActivatorConstants.Instructions, Value = new List<string> { DataActivatorConstants.ConnectorDescription }, Details = DataActivatorConstants.Details };

public new IntegrationType Type { get; set; } = DataActivatorConstants.Type;

/**********************************************************************************************************
* METHODS
**********************************************************************************************************/

public override async Task<CrawlJobData> GetCrawlJobData(
ProviderUpdateContext context,
IDictionary<string, object> configuration,
Guid organizationId,
Guid userId,
Guid providerDefinitionId)
{
if (configuration == null)
{
throw new ArgumentNullException(nameof(configuration));
}

var result = new AzureEventHubConnectorJobData(configuration);

return await Task.FromResult(result);
}

public override Task<bool> TestAuthentication(
ProviderUpdateContext context,
IDictionary<string, object> configuration,
Guid organizationId,
Guid userId,
Guid providerDefinitionId)
{
throw new NotImplementedException();
}

public override Task<ExpectedStatistics> FetchUnSyncedEntityStatistics(ExecutionContext context, IDictionary<string, object> configuration, Guid organizationId, Guid userId, Guid providerDefinitionId)
{
throw new NotImplementedException();
}

public override Task<IDictionary<string, object>> GetHelperConfiguration(
ProviderUpdateContext context,
[NotNull] CrawlJobData jobData,
Guid organizationId,
Guid userId,
Guid providerDefinitionId)
{
if (jobData == null)
{
throw new ArgumentNullException(nameof(jobData));
}

if (jobData is AzureEventHubConnectorJobData result)
{
return Task.FromResult(result.ToDictionary());
}

throw new InvalidOperationException($"Unexpected data type for AzureEventConnectorJobData, {jobData.GetType()}");
}

public override Task<IDictionary<string, object>> GetHelperConfiguration(
ProviderUpdateContext context,
CrawlJobData jobData,
Guid organizationId,
Guid userId,
Guid providerDefinitionId,
string folderId)
{
return GetHelperConfiguration(context, jobData, organizationId, userId, providerDefinitionId);
}

public override Task<AccountInformation> GetAccountInformation(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
{
if (jobData == null)
{
throw new ArgumentNullException(nameof(jobData));
}

if (!(jobData is AzureEventHubConnectorJobData result))
{
throw new ArgumentException(
"Wrong CrawlJobData type", nameof(jobData));
}

var accountId = $"{result.Name}.{result.ConnectionString}";

return Task.FromResult(new AccountInformation(accountId, $"{accountId}"));
}

public override string Schedule(DateTimeOffset relativeDateTime, bool webHooksEnabled)
{
return $"{relativeDateTime.Minute} 0/23 * * *";
}

public override Task<IEnumerable<WebHookSignature>> CreateWebHook(ExecutionContext context, [NotNull] CrawlJobData jobData, [NotNull] IWebhookDefinition webhookDefinition, [NotNull] IDictionary<string, object> config)
{
if (jobData == null)
{
throw new ArgumentNullException(nameof(jobData));
}

if (webhookDefinition == null)
{
throw new ArgumentNullException(nameof(webhookDefinition));
}

if (config == null)
{
throw new ArgumentNullException(nameof(config));
}

throw new NotImplementedException();
}

public override Task<IEnumerable<WebhookDefinition>> GetWebHooks(ExecutionContext context)
{
throw new NotImplementedException();
}

public override Task DeleteWebHook(ExecutionContext context, [NotNull] CrawlJobData jobData, [NotNull] IWebhookDefinition webhookDefinition)
{
if (jobData == null)
{
throw new ArgumentNullException(nameof(jobData));
}

if (webhookDefinition == null)
{
throw new ArgumentNullException(nameof(webhookDefinition));
}

throw new NotImplementedException();
}

public override IEnumerable<string> WebhookManagementEndpoints([NotNull] IEnumerable<string> ids)
{
if (ids == null)
{
throw new ArgumentNullException(nameof(ids));
}

// TODO should ids also be checked for being empty ?

throw new NotImplementedException();
}

public override Task<CrawlLimit> GetRemainingApiAllowance(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
{
if (jobData == null)
{
throw new ArgumentNullException(nameof(jobData));
}

//TODO what the hell is this?
//There is no limit set, so you can pull as often and as much as you want.
return Task.FromResult(new CrawlLimit(-1, TimeSpan.Zero));
}
}
Loading

0 comments on commit acecaec

Please sign in to comment.