protected void Init(ILoggerFactory loggerFactory, ISerializer serializer, IOrderingService orderingService,
                            CancellationToken cancellationToken, ISendIdempotencyService <Guid, Packet> sendIdempotencyService,
                            IReceiveIdempotencyService <string> receiveIdempotencyService, ISequenceGenerator delaySequenceGenerator,
                            int millisecondsIntervalForPacketResend, int keepAliveTimeOut,
                            int maximumNumberOfKeepAliveMisses, int keepAliveResponseTimeOut)
        {
            id            = Guid.NewGuid().ToString();
            LoggerFactory = loggerFactory;
            this.sendIdempotencyService    = sendIdempotencyService;
            this.receiveIdempotencyService = receiveIdempotencyService;
            CancellationToken = cancellationToken;
            this.millisecondsIntervalForPacketResend = millisecondsIntervalForPacketResend;
            this.serializer                     = serializer;
            this.orderingService                = orderingService;
            this.delaySequenceGenerator         = delaySequenceGenerator;
            this.keepAliveResponseTimeOut       = keepAliveResponseTimeOut;
            this.keepAliveTimeOut               = keepAliveTimeOut;
            this.maximumNumberOfKeepAliveMisses = maximumNumberOfKeepAliveMisses;


            CancellationToken.Register(() => Cancel());

            if (LoggerFactory != null)
            {
                logger = loggerFactory.CreateLogger(GetType());
            }
        }
Beispiel #2
0
        }                                             // I give up.

        public Provider(
            IAuthorizationService authorization,
            ILoggingService log,
            IControlService control,
            IDataService data,
            IBillingService billing,
            IInventoryService inventory,
            IOrderingService ordering,
            IStoreService store,
            IMailService mail,
            IPhysicalAccessService physicalAccess,
            ISchedulerService scheduler,
            IFeedbackService feedback,
            IReportingService reporting,
            IWorkerService worker,
            IProviderUtility utility,
            IDataAccessService dataAccess)
        {
            Authorization  = authorization;
            Log            = log;
            Control        = control;
            Data           = data;
            Billing        = billing;
            Inventory      = inventory;
            Ordering       = ordering;
            Store          = store;
            Mail           = mail;
            PhysicalAccess = physicalAccess;
            Scheduler      = scheduler;
            Feedback       = feedback;
            Reporting      = reporting;
            Worker         = worker;
            Utility        = utility;
            DataAccess     = dataAccess;
        }
 public OrdersController(
     IOrderingService orderingService,
     ICurrentUserService currentUserService)
 {
     this.orderingService    = orderingService;
     this.currentUserService = currentUserService;
 }
 public OrderController(IOrderingService orderSvc, IBasketService basketSvc, IIdentityParser <ApplicationUser> appUserParser, ICatalogService catalogSvc)
 {
     _appUserParser = appUserParser;
     _orderSvc      = orderSvc;
     _basketSvc     = basketSvc;
     _catalogSvc    = catalogSvc;
 }
Beispiel #5
0
 public OrdersController(IOrderingService orderingService, IDeliveryService deliveryService, IMapper mapper, IUnitOfWorkFactory unitOfWorkFactory)
 {
     _orderingService   = orderingService;
     _deliveryService   = deliveryService;
     _mapper            = mapper;
     _unitOfWorkFactory = unitOfWorkFactory;
 }
Beispiel #6
0
 public OrderDialog(IBasketService basketService, IOrderingService orderingService,
                    IIdentityService identityService, BotSettings botSettings)
 {
     this.basketService   = basketService;
     this.orderingService = orderingService;
     this.identityService = identityService;
     this.botSettings     = botSettings;
 }
 public OrderingCommandService(IOrderingService orderingService, IKeyGenerationReportService keyGenerationReportService, IUnitOfWork unitOfWork, ICommandExecutor executor)
 {
     _orderingService            = orderingService;
     _unitOfWork                 = unitOfWork;
     _executor                   = executor;
     _keyGenerationReportService = keyGenerationReportService;
     _userSession                = new UserSession();
 }
 public BasketAPIService(IBasketRepository repository
                         , IConfiguration configuration
                         , IOrderingService orderingServices)
 {
     _repository       = repository;
     _configuration    = configuration;
     _orderingServices = orderingServices;
 }
 public OrderingCommandService(IOrderingService orderingService, IKeyGenerationReportService keyGenerationReportService, IUnitOfWork unitOfWork, ICommandExecutor executor)
 {
   _orderingService = orderingService;
   _unitOfWork = unitOfWork;
   _executor = executor;
   _keyGenerationReportService = keyGenerationReportService;
   _userSession = new UserSession();
 }
Beispiel #10
0
        public void Start()
        {
            loggingService.Info($"Start Trading service (Virtual: {Config.VirtualTrading})...");

            IsTradingSuspended = true;

            orderingService = Application.Resolve <IOrderingService>();
            rulesService    = Application.Resolve <IRulesService>();
            OnTradingRulesChanged();
            rulesService.RegisterRulesChangeCallback(OnTradingRulesChanged);
            Exchange.Start(Config.VirtualTrading);
            signalsService = Application.Resolve <ISignalsService>();

            if (!Config.VirtualTrading)
            {
                Account = new ExchangeAccount(loggingService, notificationService, healthCheckService, signalsService, this);
            }
            else
            {
                Account = new VirtualAccount(loggingService, notificationService, healthCheckService, signalsService, this);
            }

            accountRefreshTimedTask = tasksService.AddTask(
                name: nameof(AccountRefreshTimedTask),
                task: new AccountRefreshTimedTask(loggingService, healthCheckService, this),
                interval: Config.AccountRefreshInterval * 1000 / Application.Speed,
                startDelay: Constants.TaskDelays.ZeroDelay,
                startTask: false,
                runNow: true,
                skipIteration: 0);

            if (signalsService.Config.Enabled)
            {
                signalsService.Start();
            }

            tradingTimedTask = tasksService.AddTask(
                name: nameof(TradingTimedTask),
                task: new TradingTimedTask(loggingService, notificationService, healthCheckService, signalsService, orderingService, this),
                interval: Config.TradingCheckInterval * 1000 / Application.Speed,
                startDelay: Constants.TaskDelays.NormalDelay,
                startTask: false,
                runNow: false,
                skipIteration: 0);

            tradingRulesTimedTask = tasksService.AddTask(
                name: nameof(TradingRulesTimedTask),
                task: new TradingRulesTimedTask(loggingService, notificationService, healthCheckService, rulesService, signalsService, this),
                interval: RulesConfig.CheckInterval * 1000 / Application.Speed,
                startDelay: Constants.TaskDelays.MidDelay,
                startTask: false,
                runNow: false,
                skipIteration: 0);

            IsTradingSuspended = false;

            loggingService.Info("Trading service started");
        }
 public MyOrdersDialog(IDialogFactory dialogFactory, IOrderingService orderingService,
                       IIdentityService identityService,
                       BotSettings botSettings, bool latestOrder = false)
 {
     this.dialogFactory   = dialogFactory;
     this.orderingService = orderingService;
     this.identityService = identityService;
     this.botSettings     = botSettings;
     this.LatestOrder     = latestOrder;
 }
 public TradingTimedTask(ILoggingService loggingService, INotificationService notificationService,
                         IHealthCheckService healthCheckService, ISignalsService signalsService, IOrderingService orderingService, ITradingService tradingService)
 {
     this.loggingService      = loggingService;
     this.notificationService = notificationService;
     this.healthCheckService  = healthCheckService;
     this.signalsService      = signalsService;
     this.orderingService     = orderingService;
     this.tradingService      = tradingService;
 }
 public InsecureClient(ILoggerFactory loggerFactory, ISerializer serializer, IOrderingService orderingService,
                       CancellationToken cancellationToken, ISendIdempotencyService <Guid, Packet> sendIdempotencyService,
                       IReceiveIdempotencyService <string> receiveIdempotencyService, ISequenceGenerator delaySequenceGenerator,
                       int millisecondsIntervalForPacketResend, int keepAliveTimeOut,
                       int maximumNumberOfKeepAliveMisses, int keepAliveResponseTimeOut)
 {
     Init(loggerFactory, serializer, orderingService, cancellationToken,
          sendIdempotencyService, receiveIdempotencyService, delaySequenceGenerator,
          millisecondsIntervalForPacketResend, keepAliveTimeOut, maximumNumberOfKeepAliveMisses, keepAliveResponseTimeOut);
 }
 public OrderService(IMapper mapper,
                     IConfiguration configuration
                     , ISessionHelper sessionHelper
                     , IOrderingService orderingService)
 {
     this.mapper          = mapper;
     this.configuration   = configuration;
     this.sessionHelper   = sessionHelper;
     this.orderingService = orderingService;
 }
Beispiel #15
0
 protected void Init(ILoggerFactory loggerFactory, ISerializer serializer, IOrderingService orderingService,
                     CancellationToken cancellationToken, ISendIdempotencyService <Guid, Packet> sendIdempotencyService,
                     IReceiveIdempotencyService <string> receiveIdempotencyService, ISequenceGenerator delaySequenceGenerator,
                     int millisecondsIntervalForPacketResend, NetworkTransport networkTransport, int keepAliveTimeOut,
                     int maximumNumberOfKeepAliveMisses, int keepAliveResponseTimeOut)
 {
     Init(loggerFactory, serializer, orderingService, cancellationToken,
          sendIdempotencyService, receiveIdempotencyService, delaySequenceGenerator,
          millisecondsIntervalForPacketResend, keepAliveTimeOut, maximumNumberOfKeepAliveMisses,
          keepAliveResponseTimeOut);
     InitNetworkTransport(networkTransport, false);
 }
Beispiel #16
0
 public ShoppingCartController(
     ICatalogService catalogService,
     IOrderingService orderingService,
     IShoppingCartService shoppingCartService,
     ICurrentUserService currentUserService,
     IMapper mapper)
 {
     this.catalogService      = catalogService;
     this.orderingService     = orderingService;
     this.shoppingCartService = shoppingCartService;
     this.currentUserService  = currentUserService;
     this.mapper = mapper;
 }
Beispiel #17
0
 public DialogFactory(ICatalogService catalogService, IBasketService basketService,
                      ICatalogAIService catalogAIService, IProductSearchImageService productSearchImageService,
                      IOrderingService orderingService, IOIDCClient oidcClient,
                      IIdentityService identityService, BotSettings botSettings)
 {
     this.catalogService            = catalogService;
     this.basketService             = basketService;
     this.catalogAIService          = catalogAIService;
     this.productSearchImageService = productSearchImageService;
     this.orderingService           = orderingService;
     this.oidcClient      = oidcClient;
     this.identityService = identityService;
     this.botSettings     = botSettings;
 }
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = "orders")] HttpRequest req,
            [Inject] IOrderingService orderingService,
            ExecutionContext context,
            ILogger log)
        {
            log.LogInformation("GetOrders function processed a request.");

            await orderingService.Init(context);

            var orders = await orderingService.GetOrderAsync();

            return(new OkObjectResult(orders));
        }
        public SecureClient(ILoggerFactory loggerFactory, ISerializer serializer, IOrderingService orderingService,
                            CancellationToken cancellationToken, ISendIdempotencyService <Guid, Packet> sendIdempotencyService,
                            IReceiveIdempotencyService <string> receiveIdempotencyService, ISequenceGenerator delaySequenceGenerator,
                            int millisecondsIntervalForPacketResend, ServerCertificateValidationCallback serverCertificateValidationCallback, SslProtocols sslProtocols,
                            X509CertificateCollection clientCertificateCollection, int keepAliveTimeOut,
                            int maximumNumberOfKeepAliveMisses, int keepAliveResponseTimeOut)
        {
            this.serverCertificateValidationCallback = serverCertificateValidationCallback;
            this.sslProtocols = sslProtocols;
            this.clientCertificateCollection = clientCertificateCollection;

            Init(loggerFactory, serializer, orderingService, cancellationToken,
                 sendIdempotencyService, receiveIdempotencyService, delaySequenceGenerator,
                 millisecondsIntervalForPacketResend, keepAliveTimeOut, maximumNumberOfKeepAliveMisses, keepAliveResponseTimeOut);
        }
        public SecureServer(ILoggerFactory loggerFactory, ISerializer serializer, IOrderingService orderingService,
                            CancellationToken cancellationToken, ISendIdempotencyService <Guid, Packet> sendIdempotencyService,
                            IReceiveIdempotencyService <string> receiveIdempotencyService, ISequenceGenerator delaySequenceGenerator,
                            int millisecondsIntervalForPacketResend, X509Certificate serverCertificate, bool clientCertificateRequired,
                            SslProtocols sslProtocols, ClientCertificateValidationCallback clientCertificateValidationCallback, int keepAliveTimeOut,
                            int maximumNumberOfKeepAliveMisses, int keepAliveResponseTimeOut)
        {
            Init(loggerFactory, serializer, orderingService,
                 sendIdempotencyService, receiveIdempotencyService,
                 delaySequenceGenerator, millisecondsIntervalForPacketResend, cancellationToken, keepAliveTimeOut,
                 maximumNumberOfKeepAliveMisses, keepAliveResponseTimeOut);
            this.serverCertificate         = serverCertificate;
            this.clientCertificateRequired = clientCertificateRequired;
            this.sslProtocols = sslProtocols;
            this.clientCertificateValidationCallback = clientCertificateValidationCallback;

            if (this.loggerFactory != null)
            {
                logger = this.loggerFactory.CreateLogger <SecureServer>();
            }
        }
Beispiel #21
0
        protected void Init(ILoggerFactory loggerFactory, ISerializer serializer,
                            IOrderingService orderingService, ISendIdempotencyService <Guid, Packet> sendIdempotencyService,
                            IReceiveIdempotencyService <string> receiveIdempotencyService, ISequenceGenerator delaySequenceGenerator,
                            int millisecondsIntervalForPacketResend, CancellationToken cancellationToken, int keepAliveTimeOut,
                            int maximumNumberOfKeepAliveMisses, int keepAliveResponseTimeOut)
        {
            Id = Guid.NewGuid().ToString();
            this.loggerFactory                       = loggerFactory;
            this.serializer                          = serializer;
            this.orderingService                     = orderingService;
            this.cancellationToken                   = cancellationToken;
            this.sendIdempotencyService              = sendIdempotencyService;
            this.receiveIdempotencyService           = receiveIdempotencyService;
            this.delaySequenceGenerator              = delaySequenceGenerator;
            this.millisecondsIntervalForPacketResend = millisecondsIntervalForPacketResend;
            this.keepAliveTimeOut                    = keepAliveTimeOut;
            this.maximumNumberOfKeepAliveMisses      = maximumNumberOfKeepAliveMisses;
            this.keepAliveResponseTimeOut            = keepAliveResponseTimeOut;

            clients = new ConcurrentDictionary <string, IClient>();
        }
 public OrdersController(IOrderingService ordersService)
 {
     _ordersService = ordersService;
 }
Beispiel #23
0
 public OrdersController(IOrderingService orderList)
 {
     _orderList = orderList;
 }
Beispiel #24
0
 private void MakeOrder(IOrderingService orderingService, string itemName = "testitem")
 {
     orderingService.MakeOrder(itemName, userId);
 }
Beispiel #25
0
 public OrderController(IBasketService basketService, IOrderingService orderingService)
 {
     _basketService   = basketService;
     _orderingService = orderingService;
 }
Beispiel #26
0
 public OrderingController(IOrderingService orderService, IMapper mapper)
 {
     _orderService = orderService;
     _mapper       = mapper;
 }
Beispiel #27
0
 public OrdersController(IOrderingService serviceOrdering)
 {
     this._serviceOrdering = serviceOrdering;
 }
Beispiel #28
0
 public HomeController(IOrderingService orderService)
 {
     _orderService = orderService;
 }
 public OrderManagementController(IOrderingService orderSvc, IIdentityParser <ApplicationUser> appUserParser)
 {
     _appUserParser = appUserParser;
     _orderSvc      = orderSvc;
 }
Beispiel #30
0
 public OrderingUnitOfWork(IOrderingService orderService)
 {
     _orderService = orderService;
 }
 public OrderingReportService(ICommandExecutor executor, IOrderingService orderingService)
 {
   _executor = executor;
   _orderingService = orderingService;
   _userSession = new UserSession();
 }
Beispiel #32
0
 public CancelNewOrderHandler(IOrderingService service) : base(service)
 {
 }