public RouteFinder(IRouteExplorer routeExplorer, IShortestRouteFinder shortestRouteFinder, IDatabaseReader databaseReader, IRouteValidator routeValidator) { this.routeExplorer = routeExplorer; this.shortestRouteFinder = shortestRouteFinder; this.databaseReader = databaseReader; this.routeValidator = routeValidator; }
public OfferSearchService(IDataRepository <Offer> repository, ITomtomApi tomtomApi, IRouteFinder routeFinder, IRouteValidator routeValidator) { _repository = repository; _tomtomApi = tomtomApi; _routeFinder = routeFinder; _routeValidator = routeValidator; }
public void AddValidator(IRouteValidator validator) { if (_validators == null) { _validators = new List <IRouteValidator>(); } _validators.Add(validator); }
public DynamicConfigBuilder( IBackendsRepo backendsRepo, IRoutesRepo routesRepo, IRouteValidator parsedRouteValidator) { Contracts.CheckValue(backendsRepo, nameof(backendsRepo)); Contracts.CheckValue(routesRepo, nameof(routesRepo)); Contracts.CheckValue(parsedRouteValidator, nameof(parsedRouteValidator)); _backendsRepo = backendsRepo; _routesRepo = routesRepo; _parsedRouteValidator = parsedRouteValidator; }
public DynamicConfigBuilder( IEnumerable <IProxyConfigFilter> filters, IClustersRepo clustersRepo, IRoutesRepo routesRepo, IRouteValidator parsedRouteValidator, IEnumerable <ISessionAffinityProvider> sessionAffinityProviders, IEnumerable <IAffinityFailurePolicy> affinityFailurePolicies) { _filters = filters ?? throw new ArgumentNullException(nameof(filters)); _clustersRepo = clustersRepo ?? throw new ArgumentNullException(nameof(clustersRepo)); _routesRepo = routesRepo ?? throw new ArgumentNullException(nameof(routesRepo)); _parsedRouteValidator = parsedRouteValidator ?? throw new ArgumentNullException(nameof(parsedRouteValidator)); _sessionAffinityProviders = sessionAffinityProviders?.ToProviderDictionary() ?? throw new ArgumentNullException(nameof(sessionAffinityProviders)); _affinityFailurePolicies = affinityFailurePolicies?.ToPolicyDictionary() ?? throw new ArgumentNullException(nameof(affinityFailurePolicies)); }
public DynamicConfigBuilder( IEnumerable <IProxyConfigFilter> filters, IBackendsRepo backendsRepo, IRoutesRepo routesRepo, IRouteValidator parsedRouteValidator) { Contracts.CheckValue(filters, nameof(filters)); Contracts.CheckValue(backendsRepo, nameof(backendsRepo)); Contracts.CheckValue(routesRepo, nameof(routesRepo)); Contracts.CheckValue(parsedRouteValidator, nameof(parsedRouteValidator)); _filters = filters; _backendsRepo = backendsRepo; _routesRepo = routesRepo; _parsedRouteValidator = parsedRouteValidator; }
/// <summary> /// Initializes a new instance of the <see cref="Route"/> class. /// </summary> /// <param name="routeSpecification">The path specification, which gives the pattern that paths will /// follow. For example, "/patients/{action}".</param> /// <param name="routeHandler">A delegate that will produce a route handler when needed for this /// route.</param> /// <param name="defaults">The default values of this route.</param> /// <param name="constraints">The constraints that will apply to this route.</param> /// <param name="parser">An object charged with parsing the route specification, producing a /// <see cref="ParsedRoute"/>.</param> /// <param name="validator">An object charged with validating the route configuration, ensuring the /// route doesn't violate any expectations around how a route can be declared.</param> public Route(string routeSpecification, Func <IRouteHandler> routeHandler, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteParser parser, IRouteValidator validator) { Guard.ArgumentNotNull(routeHandler, "routeHandler"); pathSpecification = routeSpecification ?? string.Empty; this.routeHandler = routeHandler; this.validator = validator ?? new RouteValidator(); this.defaults = defaults ?? new RouteValueDictionary(); this.constraints = constraints ?? new RouteValueDictionary(); this.parser = parser ?? new RouteParser( new ParameterSegmentRecognizer(), new LiteralSegmentRecognizer(), new CatchAllParameterSegmentRecognizer() ); }
/// <summary> /// Initializes a new instance of the <see cref="Route"/> class. /// </summary> /// <param name="routeSpecification">The path specification, which gives the pattern that paths will /// follow. For example, "/patients/{action}".</param> /// <param name="routeHandler">A delegate that will produce a route handler when needed for this /// route.</param> /// <param name="defaults">The default values of this route.</param> /// <param name="constraints">The constraints that will apply to this route.</param> /// <param name="parser">An object charged with parsing the route specification, producing a /// <see cref="ParsedRoute"/>.</param> /// <param name="validator">An object charged with validating the route configuration, ensuring the /// route doesn't violate any expectations around how a route can be declared.</param> public Route(string routeSpecification, Func<IRouteHandler> routeHandler, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteParser parser, IRouteValidator validator) { Guard.ArgumentNotNull(routeHandler, "routeHandler"); pathSpecification = routeSpecification ?? string.Empty; this.routeHandler = routeHandler; this.validator = validator ?? new RouteValidator(); this.defaults = defaults ?? new RouteValueDictionary(); this.constraints = constraints ?? new RouteValueDictionary(); this.parser = parser ?? new RouteParser( new ParameterSegmentRecognizer(), new LiteralSegmentRecognizer(), new CatchAllParameterSegmentRecognizer() ); }
public DynamicConfigBuilder( IEnumerable <IProxyConfigFilter> filters, IBackendsRepo backendsRepo, IRoutesRepo routesRepo, IRouteValidator parsedRouteValidator, IEnumerable <ISessionAffinityProvider> sessionAffinityProviders, IEnumerable <IAffinityFailurePolicy> affinityFailurePolicies) { Contracts.CheckValue(filters, nameof(filters)); Contracts.CheckValue(backendsRepo, nameof(backendsRepo)); Contracts.CheckValue(routesRepo, nameof(routesRepo)); Contracts.CheckValue(parsedRouteValidator, nameof(parsedRouteValidator)); Contracts.CheckValue(sessionAffinityProviders, nameof(sessionAffinityProviders)); Contracts.CheckValue(affinityFailurePolicies, nameof(affinityFailurePolicies)); _filters = filters; _backendsRepo = backendsRepo; _routesRepo = routesRepo; _parsedRouteValidator = parsedRouteValidator; _sessionAffinityProviders = sessionAffinityProviders.ToProviderDictionary(); _affinityFailurePolicies = affinityFailurePolicies.ToPolicyDictionary(); }
public void AddValidator(IRouteValidator validator) { if (_validators == null) _validators = new List<IRouteValidator>(); _validators.Add(validator); }
public RoutesConsoleReader() { routeInputParser = new RouteInputParser(); routeValidator = new RouteValidator(); }
/// <summary> /// Initializes a new instance of the <see cref="Route"/> class. /// </summary> /// <param name="routeSpecification">The path specification, which gives the pattern that paths will /// follow. For example, "/patients/{action}".</param> /// <param name="routeHandler">A delegate that will produce a route handler when needed for this /// route.</param> /// <param name="defaults">The default values of this route.</param> /// <param name="constraints">The constraints that will apply to this route.</param> /// <param name="validator">An object charged with validating the route configuration, ensuring the /// route doesn't violate any expectations around how a route can be declared.</param> public Route(string routeSpecification, Func <IRouteHandler> routeHandler, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteValidator validator) : this(routeSpecification, routeHandler, defaults, constraints, null, validator) { }
/// <summary> /// Initializes a new instance of the <see cref="Route"/> class. /// </summary> /// <param name="routeSpecification">The path specification, which gives the pattern that paths will /// follow. For example, "/patients/{action}".</param> /// <param name="routeHandler">A delegate that will produce a route handler when needed for this /// route.</param> /// <param name="defaults">The default values of this route.</param> /// <param name="constraints">The constraints that will apply to this route.</param> /// <param name="validator">An object charged with validating the route configuration, ensuring the /// route doesn't violate any expectations around how a route can be declared.</param> public Route(string routeSpecification, Func<IRouteHandler> routeHandler, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteValidator validator) : this(routeSpecification, routeHandler, defaults, constraints, null, validator) { }