示例#1
0
 private static IServiceCollection CreateServices(DatabaseConnectionProperties databaseProperties, SyrinxProperties syrinxProperties, Assembly assembly) => new ServiceCollection()
 .AddSingleton <ILoggerStore>(factory => new LoggerStore(databaseProperties.LogStoreConnectionString, Scope))
 .AddSingleton(factory => new CamundaDeploymentParameters
 {
     Assembly = assembly
 })
 .AddScoped <IOperationService>(factory =>
 {
     var loggerStore = factory.GetService <ILoggerStore>();
     var dataStoreConnectionString = databaseProperties.DataStoreConnectionString;
     return(new OperationService(loggerStore, dataStoreConnectionString, Scope));
 })
 .AddScoped <ISyrinxCamundaClientService>(factory => new SyrinxCamundaClientService(syrinxProperties))
 .AddScoped <ICamundaDeploymentService, CamundaDeploymentService>();
示例#2
0
        public static void Perform(string[] args, DatabaseConnectionProperties databaseProperties, SyrinxProperties syrinxProperties, Assembly assembly,
                                   Action <IServiceCollection> serviceHandler = null)
        {
            var parser = new Parser(settings => settings.CaseInsensitiveEnumValues = true);

            parser.ParseArguments <CamundaDeploymentToolOptions>(args)
            .WithParsed(options =>
            {
                var serviceCollection = CreateServices(databaseProperties, syrinxProperties, assembly);
                serviceHandler?.Invoke(serviceCollection);
                using var scope = serviceCollection.BuildServiceProvider(false).CreateScope();
                var service     = scope.ServiceProvider.GetRequiredService <ICamundaDeploymentService>();

                switch (options.Action)
                {
                case MigrationAction.Upgrade:
                    service.Upgrade();
                    break;

                case MigrationAction.Rollback:
                    service.DowngradeToPrevious();
                    break;

                case MigrationAction.Downgrade:
                    service.Downgrade();
                    break;

                default:
                    throw CommonExceptions.CamundaCouldNotBeDeployed();
                }
            })
            .WithNotParsed(_ => throw CommonExceptions.CamundaCouldNotBeDeployed());
        }
示例#3
0
 public LookupController(IOperationService operationService, PortalProperties properties) : base(operationService)
 {
     syrinxProperties = properties.SyrinxProperties;
 }
示例#4
0
 public SyrinxAuthenticationClientService(SyrinxProperties properties, bool skipCertificateValidation = false)
 {
     this.properties = properties;
     this.skipCertificateValidation = skipCertificateValidation;
 }
 internal InternalSyrinxClientService(SyrinxProperties properties, Func <HttpClient> httpClientGetter)
 {
     this.properties       = properties;
     this.httpClientGetter = httpClientGetter;
 }
 public SyrinxCamundaClientService(SyrinxProperties properties)
 {
     this.properties = properties;
 }