47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using System;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using StellaOps.Concelier.Core.Jobs;
|
|
|
|
namespace StellaOps.Concelier.Connector.CertFr;
|
|
|
|
internal static class CertFrJobKinds
|
|
{
|
|
public const string Fetch = "source:cert-fr:fetch";
|
|
public const string Parse = "source:cert-fr:parse";
|
|
public const string Map = "source:cert-fr:map";
|
|
}
|
|
|
|
internal sealed class CertFrFetchJob : IJob
|
|
{
|
|
private readonly CertFrConnector _connector;
|
|
|
|
public CertFrFetchJob(CertFrConnector connector)
|
|
=> _connector = connector ?? throw new ArgumentNullException(nameof(connector));
|
|
|
|
public Task ExecuteAsync(JobExecutionContext context, CancellationToken cancellationToken)
|
|
=> _connector.FetchAsync(context.Services, cancellationToken);
|
|
}
|
|
|
|
internal sealed class CertFrParseJob : IJob
|
|
{
|
|
private readonly CertFrConnector _connector;
|
|
|
|
public CertFrParseJob(CertFrConnector connector)
|
|
=> _connector = connector ?? throw new ArgumentNullException(nameof(connector));
|
|
|
|
public Task ExecuteAsync(JobExecutionContext context, CancellationToken cancellationToken)
|
|
=> _connector.ParseAsync(context.Services, cancellationToken);
|
|
}
|
|
|
|
internal sealed class CertFrMapJob : IJob
|
|
{
|
|
private readonly CertFrConnector _connector;
|
|
|
|
public CertFrMapJob(CertFrConnector connector)
|
|
=> _connector = connector ?? throw new ArgumentNullException(nameof(connector));
|
|
|
|
public Task ExecuteAsync(JobExecutionContext context, CancellationToken cancellationToken)
|
|
=> _connector.MapAsync(context.Services, cancellationToken);
|
|
}
|