Skip to content

Commit

Permalink
Merge pull request #2 from jobbrIO/develop
Browse files Browse the repository at this point in the history
Update master
  • Loading branch information
eXpl0it3r authored Nov 2, 2022
2 parents d951449 + f779a14 commit f50c759
Show file tree
Hide file tree
Showing 24 changed files with 201 additions and 179 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ bld/
# Roslyn cache directories
*.ide/

# Rider directories
.idea/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
Expand Down
2 changes: 1 addition & 1 deletion Demo.Client/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
</configuration>
21 changes: 10 additions & 11 deletions Demo.Client/Demo.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Demo.Client</RootNamespace>
<AssemblyName>Demo.Client</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -33,9 +33,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Jobbr.Client, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.Client.1.0.0\lib\net45\Jobbr.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -50,14 +47,16 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Jobbr.Client" Version="1.6.1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
16 changes: 8 additions & 8 deletions Demo.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ public class Program
{
public static void Main(string[] args)
{
var jobbrClient = new JobbrClient("http://localhost:1337");
var jobbrClient = new JobbrClient("http://localhost:1338");

var allJobs = jobbrClient.GetAllJobs();
var allJobs = jobbrClient.QueryJobs();

if (allJobs.Count == 0)
if (allJobs.TotalItems == 0)
{
Console.WriteLine("At least one job is required to run this demo. Press enter to quit...");
Console.ReadLine();
return;
}

var jobId = allJobs.First().Id;
var jobId = allJobs.Items.First().Id;

var trigger = jobbrClient.AddTrigger(jobId, new InstantTriggerDto { IsActive = true, UserDisplayName = "userName" });
Console.WriteLine("Got Trigger with Id:" + trigger.Id);

var jobRuns = jobbrClient.GetJobRunsByTriggerId(jobId, trigger.Id);
Console.WriteLine("There are {0} jobruns assigned to this trigger id.", jobRuns.Count);
Console.WriteLine("There are {0} jobruns assigned to this trigger id.", jobRuns.TotalItems);

var jobRun = jobbrClient.GetJobRunById(jobRuns[0].JobRunId);
var jobRun = jobbrClient.GetJobRunById(jobRuns.Items[0].JobRunId);
Console.WriteLine("Current State: " + jobRun.State);
Console.WriteLine("------------------------------------------------------------------------------");
Console.ReadLine();
Expand All @@ -40,9 +40,9 @@ public static void Main(string[] args)
Console.WriteLine("Got FutureTrigger by Id:" + trigger.Id + ", IsActive: " + createdTrigger.IsActive);

var disableTriggerInfo = new ScheduledTriggerDto() { Id = futureTrigger.Id, IsActive = false };
var dectivatedTrigger = jobbrClient.UpdateTrigger(jobId, disableTriggerInfo);
var deactivatedTrigger = jobbrClient.UpdateTrigger(jobId, disableTriggerInfo);

Console.WriteLine("Disabled FutureTrigger width Id:" + trigger.Id + ", IsActive: " + dectivatedTrigger.IsActive);
Console.WriteLine("Disabled FutureTrigger width Id:" + trigger.Id + ", IsActive: " + deactivatedTrigger.IsActive);

Console.WriteLine("Press enter to quit...");
Console.ReadLine();
Expand Down
3 changes: 1 addition & 2 deletions Demo.Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand All @@ -10,7 +9,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Zuehlke Technology Group")]
[assembly: AssemblyProduct("Demo.Client")]
[assembly: AssemblyCopyright("Copyright © Zuehlke Technology Group 2015")]
[assembly: AssemblyCopyright("Copyright © Zuehlke Technology Group 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
4 changes: 0 additions & 4 deletions Demo.Client/packages.config

This file was deleted.

2 changes: 1 addition & 1 deletion Demo.JobRunner/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
</configuration>
21 changes: 10 additions & 11 deletions Demo.JobRunner/Demo.JobRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Demo.JobRunner</RootNamespace>
<AssemblyName>Demo.JobRunner</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -33,9 +33,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Jobbr.Runtime.ForkedExecution, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.Runtime.ForkedExecution.1.0.0\lib\net45\Jobbr.Runtime.ForkedExecution.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -50,20 +47,22 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Demo.MyJobs\Demo.MyJobs.csproj">
<Project>{f1c2e1e1-815d-4d07-91a2-fd8bee8c4240}</Project>
<Name>Demo.MyJobs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Jobbr.Runtime.ForkedExecution" Version="1.1.1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
2 changes: 1 addition & 1 deletion Demo.JobRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static void Main(string[] args)
var jobAssemblyToQueryJobs = typeof(ProgressJob).Assembly;

// Set the default assembly to query for jobtypes
var runtime = new ForkedRuntime(new RuntimeConfiguration { JobTypeSearchAssembly = jobAssemblyToQueryJobs });
var runtime = new ForkedRuntime(new RuntimeConfiguration { JobTypeSearchAssemblies = new[] { jobAssemblyToQueryJobs } });

// Pass the arguments of the forked execution to the runtime
runtime.Run(args);
Expand Down
3 changes: 1 addition & 2 deletions Demo.JobRunner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand All @@ -10,7 +9,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Zuehlke Technology Group")]
[assembly: AssemblyProduct("Demo.JobRunner")]
[assembly: AssemblyCopyright("Copyright © Zuehlke Technology Group 2015")]
[assembly: AssemblyCopyright("Copyright © Zuehlke Technology Group 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
4 changes: 0 additions & 4 deletions Demo.JobRunner/packages.config

This file was deleted.

8 changes: 6 additions & 2 deletions Demo.JobServer/App.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Raven.Client.Lightweight" publicKeyToken="37f41c7f99471593" culture="neutral" />
Expand All @@ -17,6 +17,10 @@
<assemblyIdentity name="Raven.Abstractions" publicKeyToken="37f41c7f99471593" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.4.0" newVersion="3.5.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
86 changes: 36 additions & 50 deletions Demo.JobServer/Demo.JobServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Demo.JobServer</RootNamespace>
<AssemblyName>Demo.JobServer</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -36,71 +41,52 @@
<StartupObject>Demo.JobServer.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Jobbr.Client, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.Client.1.0.0\lib\net45\Jobbr.Client.dll</HintPath>
</Reference>
<Reference Include="Jobbr.ComponentModel.ArtefactStorage, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.ComponentModel.ArtefactStorage.1.0.1\lib\net462\Jobbr.ComponentModel.ArtefactStorage.dll</HintPath>
</Reference>
<Reference Include="Jobbr.ComponentModel.Execution, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.ComponentModel.Execution.1.0.1\lib\net462\Jobbr.ComponentModel.Execution.dll</HintPath>
</Reference>
<Reference Include="Jobbr.ComponentModel.JobStorage, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.ComponentModel.JobStorage.1.0.1\lib\net462\Jobbr.ComponentModel.JobStorage.dll</HintPath>
</Reference>
<Reference Include="Jobbr.ComponentModel.Management, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.ComponentModel.Management.1.0.1\lib\net462\Jobbr.ComponentModel.Management.dll</HintPath>
</Reference>
<Reference Include="Jobbr.ComponentModel.Registration, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.ComponentModel.Registration.1.0.1\lib\net462\Jobbr.ComponentModel.Registration.dll</HintPath>
</Reference>
<Reference Include="Jobbr.Server, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.Server.1.0.0\lib\net462\Jobbr.Server.dll</HintPath>
</Reference>
<Reference Include="Jobbr.Server.ForkedExecution, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.Execution.Forked.1.0.0\lib\net462\Jobbr.Server.ForkedExecution.dll</HintPath>
</Reference>
<Reference Include="Jobbr.Server.WebAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.Server.WebAPI.1.0.0\lib\net45\Jobbr.Server.WebAPI.dll</HintPath>
</Reference>
<Reference Include="Jobbr.Storage.MsSql, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.Storage.MsSql.1.0.0\lib\net462\Jobbr.Storage.MsSql.dll</HintPath>
</Reference>
<Reference Include="Jobbr.Storage.RavenDB, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Jobbr.Storage.RavenDB.1.0.0\lib\net462\Jobbr.Storage.RavenDB.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.HttpListener, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Host.HttpListener.3.1.0\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath>
</Reference>
<Reference Include="Raven.Abstractions, Version=3.5.4.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<HintPath>..\packages\RavenDB.Client.3.5.4\lib\net45\Raven.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Raven.Client.Lightweight, Version=3.5.4.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<HintPath>..\packages\RavenDB.Client.3.5.4\lib\net45\Raven.Client.Lightweight.dll</HintPath>
<Reference Include="Jobbr.Server">
<HintPath>C:\Users\lukas\.nuget\packages\jobbr.server\1.4.0\lib\net462\Jobbr.Server.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MyExtension.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Jobbr.ArtefactStorage.FileSystem" Version="1.0.1" />
<PackageReference Include="Jobbr.ComponentModel.ArtefactStorage" Version="1.0.1" />
<PackageReference Include="Jobbr.ComponentModel.Execution" Version="1.0.1" />
<PackageReference Include="Jobbr.ComponentModel.JobStorage" Version="1.4.0" />
<PackageReference Include="Jobbr.ComponentModel.Management" Version="1.6.0" />
<PackageReference Include="Jobbr.ComponentModel.Registration" Version="1.0.1" />
<PackageReference Include="Jobbr.Dashboard" Version="1.2.0" />
<PackageReference Include="Jobbr.Execution.Forked" Version="1.1.1" />
<PackageReference Include="Jobbr.Server" Version="1.6.0" />
<PackageReference Include="Jobbr.Server.WebAPI" Version="1.6.1" />
<PackageReference Include="Jobbr.Storage.MsSql" Version="3.0.0-rc.1" />
<PackageReference Include="Microsoft.Owin.Host.HttpListener" Version="3.1.0" />
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="ServiceStack.Common" Version="5.2.0" />
<PackageReference Include="ServiceStack.Interfaces" Version="5.2.0" />
<PackageReference Include="ServiceStack.OrmLite" Version="5.2.0" />
<PackageReference Include="ServiceStack.OrmLite.SqlServer" Version="5.2.0" />
<PackageReference Include="ServiceStack.Text" Version="5.2.0" />
<PackageReference Include="System.Buffers" Version="4.4.0" />
<PackageReference Include="System.Memory" Version="4.5.1" />
<PackageReference Include="System.Numerics.Vectors" Version="4.4.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.5.0" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
33 changes: 33 additions & 0 deletions Demo.JobServer/MyExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Jobbr.ComponentModel.Management;
using Jobbr.ComponentModel.Registration;

namespace Demo.JobServer
{
public class MyExtension : IJobbrComponent
{
public static MyExtension Instance;

private readonly IJobbrServiceProvider _serviceProvider;
private readonly IJobManagementService _jobManagementService;
private readonly IQueryService _queryService;

public IJobManagementService JobManagementService => _jobManagementService;

public MyExtension(IJobbrServiceProvider serviceProvider, IJobManagementService jobManagementService, IQueryService queryService)
{
Instance = this;

// you can request basically anything that is available in the JobbrDI. The list of available types are
// defined in the corresponding component models available on http://github.com/jobbrIO
this._serviceProvider = serviceProvider;
this._jobManagementService = jobManagementService;
this._queryService = queryService;
}

public void Dispose() { }

public void Start() { }

public void Stop() { }
}
}
Loading

0 comments on commit f50c759

Please sign in to comment.