public HttpServiceGatewayMiddleware(
            RequestDelegate next,
            ILoggerFactory loggerFactory,
            IHttpCommunicationClientFactory httpCommunicationClientFactory,
            IOptions<HttpServiceGatewayOptions> gatewayOptions)
        {
            if (next == null)
                throw new ArgumentNullException(nameof(next));

            if (loggerFactory == null)
                throw new ArgumentNullException(nameof(loggerFactory));

            if (httpCommunicationClientFactory == null)
                throw new ArgumentNullException(nameof(httpCommunicationClientFactory));

            if (gatewayOptions?.Value == null)
                throw new ArgumentNullException(nameof(gatewayOptions));

            if (gatewayOptions.Value.ServiceName == null)
                throw new ArgumentNullException($"{nameof(gatewayOptions)}.{nameof(gatewayOptions.Value.ServiceName)}");

            // "next" is not stored because this is a terminal middleware
            _logger = loggerFactory.CreateLogger(HttpServiceGatewayDefaults.LoggerName);
            _httpCommunicationClientFactory = httpCommunicationClientFactory;
            _gatewayOptions = gatewayOptions.Value;
        }
Esempio n. 2
0
 public ProductController(IRepository <Product, ProductContext> repository,
                          GatewayApiClient gatewayApiClient
                          , IEventBus eventBus
                          , IHttpCommunicationClientFactory clientFactory
                          )
 {
     _repository       = repository;
     _eventBus         = eventBus;
     _clientFactory    = clientFactory;
     _gatewayApiClient = gatewayApiClient;
     _gatewayApiClient.SetToken();
 }
Esempio n. 3
0
        public HttpServiceGatewayMiddleware(
            RequestDelegate next,
            ILoggerFactory loggerFactory,
            IHttpCommunicationClientFactory httpCommunicationClientFactory,
            IOptions <HttpServiceGatewayOptions> gatewayOptions)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            if (httpCommunicationClientFactory == null)
            {
                throw new ArgumentNullException(nameof(httpCommunicationClientFactory));
            }

            if (gatewayOptions?.Value == null)
            {
                throw new ArgumentNullException(nameof(gatewayOptions));
            }

            if (gatewayOptions.Value.ServiceName == null)
            {
                throw new ArgumentNullException($"{nameof(gatewayOptions)}.{nameof(gatewayOptions.Value.ServiceName)}");
            }

            // "next" is not stored because this is a terminal middleware
            _logger = loggerFactory.CreateLogger(HttpServiceGatewayDefaults.LoggerName);
            _httpCommunicationClientFactory = httpCommunicationClientFactory;
            _gatewayOptions = gatewayOptions.Value;
        }
 public DirectCommunicationMiddleware(RequestDelegate next,
                                      IHttpCommunicationClientFactory clientFactory)
 {
     _clientFactory = clientFactory;
 }
Esempio n. 5
0
 public MenuCardV2Controller(IHttpCommunicationClientFactory clientFactory)
 {
     _clientFactory = clientFactory;
 }
 public DirectCommunicationMiddleware(RequestDelegate next,
     IHttpCommunicationClientFactory clientFactory)
 {
     _clientFactory = clientFactory;
 }