public CopyRastersToStorageAction(IActionProcessor parameters)
     : base(parameters)
 {
     files             = parameters.GetParameterWithValidition <IEnumerable <string> >(ActionParameters.Files, null).Value;
     replaceFiles      = parameters.GetParameter(ActionParameters.ReplaceOnExists, true).Value;
     resterStorageType = parameters.GetParameter(ActionParameters.ResterStorageType, ResterStorageTypesEnum.Srtm).Value;
 }
Exemple #2
0
 public BuildStackVisibilityAction(IActionProcessor parameters)
     : base(parameters)
 {
     featureClass  = parameters.GetParameterWithValidition <string>(ActionParameters.FeatureClass, null).Value;
     profileSource = parameters.GetParameterWithValidition <string>(ActionParameters.ProfileSource, null).Value;
     outGraphName  = parameters.GetParameterWithValidition <string>(ActionParameters.OutputSourceName, null).Value;
 }
Exemple #3
0
 public CommandLineAction(IActionProcessor parameters)
     : base(parameters)
 {
     executableFile = parameters.GetParameter(ActionParamNamesCore.PathToFile, string.Empty).Value;
     commandArgs    = parameters.GetParameters <string>(ActionParamNamesCore.DataValue, string.Empty).Select(p => p.Value);
     onOutput       = parameters.GetParameter <ActionProcessCommandLineDelegate>(ActionParamNamesCore.OutputDataReceivedDelegate, null).Value;
     onError        = parameters.GetParameter <ActionProcessCommandLineDelegate>(ActionParamNamesCore.ErrorDataReceivedDelegate, null).Value;
 }
Exemple #4
0
 public BuildStackProfileAction(IActionProcessor parameters)
     : base(parameters)
 {
     featureClass  = parameters.GetParameterWithValidition <string>(ActionParameters.FeatureClass, null).Value;
     profileSource = parameters.GetParameterWithValidition <string>(ActionParameters.ProfileSource, null).Value;
     outGraphName  = parameters.GetParameterWithValidition <string>(ActionParameters.OutGraphName, null).Value;
     tableName     = parameters.GetParameterWithValidition <string>(ActionParameters.DataWorkSpace, null).Value;
 }
Exemple #5
0
 public TaskerService(ILogger log, IMqttClient mqttClient,
                      ISensorStateUpdater sensorStateUpdater, IActionProcessor actionProcessor, MessageProcessor messageProcessor)
 {
     _mqttClient         = mqttClient ?? throw new ArgumentNullException(nameof(mqttClient));
     _log                = log ?? throw new ArgumentNullException(nameof(log));
     _sensorStateUpdater = sensorStateUpdater ?? throw new ArgumentNullException(nameof(sensorStateUpdater));
     _actionProcessor    = actionProcessor ?? throw new ArgumentNullException(nameof(actionProcessor));
     _messageProcessor   = messageProcessor ?? throw new ArgumentNullException(nameof(messageProcessor));
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ListenerService"/> class.
 /// </summary>
 /// <param name="serviceProvider">The service provider.</param>
 /// <param name="actionProcessor">The action processor.</param>
 /// <param name="loggerFactory">The logger factory.</param>
 /// <param name="awsSettings">The AWS settings.</param>
 /// <param name="applicationSettings">The application settings.</param>
 public ListenerService(IServiceProvider serviceProvider,
                        IActionProcessor actionProcessor,
                        ILoggerFactory loggerFactory,
                        AwsSettings awsSettings,
                        ApplicationSettings applicationSettings)
 {
     ServiceProvider     = serviceProvider;
     Logger              = loggerFactory.CreateLogger <ListenerService>();
     AwsSettings         = awsSettings;
     ApplicationSettings = applicationSettings;
     ActionProcessor     = actionProcessor;
 }
Exemple #7
0
        public RunPythonAction(IActionProcessor parameters)
            : base(parameters)
        {
            logger.InfoEx("Initiating \"Launch Python script\" action.");

            pytonParameters = parameters.GetParameters <string>(ActionParamNamesCore.DataValue, string.Empty).Select(p => p.Value);

            if (pytonParameters.Count() == 1 && string.IsNullOrEmpty(pytonParameters.First()))
            {
                pytonParameters = new string[0];
            }

            this.returnResult.Result = string.Empty;
        }
Exemple #8
0
 public BuildStackVisibilityAction(IActionProcessor parameters)
     : base(parameters)
 {
     observPointsfeatureClass   = parameters.GetParameterWithValidition <IFeatureClass>(ActionParameters.FeatureClass, null).Value;
     observStationsfeatureClass = parameters.GetParameter <IFeatureClass>(ActionParameters.FeatureClassX, null).Value;
     rasterSource         = parameters.GetParameterWithValidition <string>(ActionParameters.ProfileSource, null).Value;
     pointsFilteringIds   = parameters.GetParameterWithValidition <int[]>(ActionParameters.FilteringPointsIds, null).Value;
     stationsFilteringIds = parameters.GetParameterWithValidition <int[]>(ActionParameters.FilteringStationsIds, null).Value;
     calcResults          = parameters.GetParameterWithValidition <VisibilityCalculationResultsEnum>(ActionParameters.Calculationresults, VisibilityCalculationResultsEnum.None).Value;
     outputSourceName     = parameters.GetParameterWithValidition <string>(ActionParameters.OutputSourceName, string.Empty).Value;
     session           = parameters.GetParameterWithValidition <VisibilityTask>(ActionParameters.Session, null).Value;
     visibilityPercent = parameters.GetParameterWithValidition <short>(ActionParameters.VisibilityPercent, -1).Value;
     showAllResults    = parameters.GetParameterWithValidition <bool>(ActionParameters.ShowAllResults, false).Value;
 }
Exemple #9
0
 public SiteHub(
     IOptions <AppSettings> settings = null
     , IDataManager d        = null
     , ICredentialsService c = null
     , IActionProcessor a    = null
     , ITokenService t       = null
     )
 {
     this.Settings           = settings.Value;
     this.DataManager        = d;
     this.CredentialsManager = c;
     this.ActionProcessor    = a;
     this.TokenManager       = t;
 }
Exemple #10
0
        public MatchMeServer()
        {
            startTime     = DateTime.Now;
            totalBytesOut = 0;
            totalRequests = 0;
            total550s     = 0;
            total500s     = 0;
            total200s     = 0;

            actionProcessor = new ActionProcessor();
            dataProcessor   = new DatabaseReader();

            listener = new HttpListener();
            listener.Prefixes.Add("http://+:86/action/");
            listener.Prefixes.Add("http://+:86/test/");
            listener.Prefixes.Add("http://+:86/db/");

            runningTasks = new HashSet <Task>();
            stopping     = false;
        }
Exemple #11
0
        public Action(IActionProcessor parameters)
            : this()
        {
            logger = Logger.GetLoggerEx(this.ActionId + BitConverter.ToInt64(parameters.ProcessId.ToByteArray(), 8));

            Logger.Info(string.Format("Action \"{0}\" activating", this.ActionId));

            if (this.usedActionParams == null)
            {
                throw new ArgumentNullException("The list of used action parameters is not defined.");
            }

            this.Parameters = parameters;

            //Create instance of result
            ConstructorInfo ctor = typeof(R).GetConstructors().First(c => c.GetParameters().Count() == 0);

            LoadedActions.ObjectActivator <R> createdActivator = LoadedActions.GetActivator <R>(ctor);
            this.returnResult = createdActivator();

            Logger.Info(string.Format("Action \"{0}\" activated", this.ActionId));
        }
Exemple #12
0
 public ExecuteInputAction(IActionProcessor p, InputActionExecutionContainer c)
 {
     actionContainer = c;
     processor       = p;
     p.Container     = actionContainer;
 }
Exemple #13
0
 public void Process(IActionProcessor processor)
 {
     processor.Accept(this);
 }
Exemple #14
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(
            IApplicationBuilder app,
            IHostingEnvironment env,
            IApplicationLifetime applicationLifetime,
            IOptions <AppSettings> settings,
            ILogManager logger,
            IDataManager data,
            IActionProcessor actions
            )
        {
            Console.WriteLine($"Environment: {settings.Value.Environment}");

            ServicePointManager.DefaultConnectionLimit = 10;
            ServicePointManager.UseNagleAlgorithm      = false;

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }

            app.UseStaticFiles();
            app.UseSpaStaticFiles();
            app.UseAuthentication();
            app.UseResponseCompression();

            app.Use(async(context, next) =>
            {
                await next();
                if (context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value))
                {
                    context.Request.Path        = "/index.html";
                    context.Response.StatusCode = 200;
                    await next();
                }
            })
            .UseCookiePolicy()
            .UseCors("CorsPolicy")
            .UseDefaultFiles(new DefaultFilesOptions {
                DefaultFileNames = new System.Collections.Generic.List <string> {
                    "index.html"
                }
            })
            .UseMySignalR(settings)
            .UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action=Index}/{id?}");
            });

            //app.UseSpa( spa =>
            // {
            //	 spa.Options.SourcePath = "ClientApp";

            //	 if( env.IsDevelopment() )
            //	 {
            //		 spa.UseReactDevelopmentServer( npmScript: "start" );
            //	 }
            // } );

            var rs = data.LoadSystemDataAsync().GetAwaiter().GetResult();

            if (rs.Code == ResponseCode.Ok)
            {
                Console.WriteLine("Metadata loaded!");
            }
            else
            {
                EmailProvider ep = new EmailProvider(settings, data);
                ep.SendEmergencyEmail("TinyFeett App Startup Error - Failure to load data", rs.Message);
            }
        }
 public void Setup()
 {
     actionProcessorMock = new Mock <IActionProcessor>();
     actionProcessor     = actionProcessorMock.Object;
 }
Exemple #16
0
 public void Run(string[] commandLineArgs)
 {
     _arguments = new UtilArguments(commandLineArgs);
     _processor = ServiceLocator.Instance.GetService <IActionProcessor>(_arguments.ActionName);
     ProcessFiles(_arguments.BaseFolerPath);
 }
Exemple #17
0
 public ExecuteInputAction(InputActionExecutionContainer c)
 {
     actionContainer = c;
     processor       = new ActionProcessor(actionContainer);
 }
 public void Setup()
 {
     actionProcessorMock = new Mock<IActionProcessor>();
     actionProcessor = actionProcessorMock.Object;
 }