Пример #1
0
        public HealthRepository(IUriProvider clusterUri)
        {
            if (clusterUri == null || clusterUri.Uri == null)
                throw new ArgumentNullException("clusterUri", "Cluster uri is required for the Health Repository.");

            _ClusterUri = new Uri(clusterUri.Uri.GetLeftPart(UriPartial.Authority));
        }
Пример #2
0
 public LinkJsonConverter(IUriProvider uriProvider)
 {
     if (uriProvider == null)
     {
         throw new ArgumentNullException("uriProvider");
     }
     _uriProvider = uriProvider;
 }
Пример #3
0
        public AliasRepository(IUriProvider clusterUri, bool afterVersion_0_90_1 = true)
        {
            if (clusterUri == null || clusterUri.Uri == null)
                throw new ArgumentNullException("clusterUri", "Cluster Uri is required.");

            _ClusterUri = clusterUri.Uri;
            _AfterVersion_0_90_1 = afterVersion_0_90_1;
        }
Пример #4
0
        public StateRepository(IUriProvider clusterUri, IHttpLayer httpLayer)
        {
            if (clusterUri == null || clusterUri.Uri == null)
                throw new ArgumentNullException("clusterUri", "Cluster uri is required for the Cluster State Repository.");

            _clusterUri = clusterUri;
            _httpLayer = httpLayer;
        }
Пример #5
0
        public AnalyzeRepository(IUriProvider clusterUri, IHttpLayer httpLayer)
        {
            if (clusterUri == null || clusterUri.Uri == null)
                throw new ArgumentNullException("clusterUri", "The analyze repository requires a uri provider for the elastic cluster.");

            _ClusterUri = clusterUri.Uri;
            _httpLayer = httpLayer;
        }
Пример #6
0
        public SettingsRepository(IUriProvider clusterUri, IHttpLayer httpLayer)
        {
            if (clusterUri == null || clusterUri.Uri == null)
                throw new ArgumentNullException("clusterUri", "Cluster uri is required for the Settings Repository.");

            _ClusterUri = new Uri(clusterUri.Uri.GetLeftPart(UriPartial.Authority));
            _httpLayer = httpLayer;
        }
Пример #7
0
        public MappingRepository(IUriProvider clusterUri, ISettingsRepository settingsRepository, IHttpLayer httpLayer)
        {
            if (clusterUri == null || clusterUri.Uri == null)
                throw new ArgumentNullException("clusterUri", "The mapping repository requires a uri provider for the elastic cluster.");

            _ClusterUri = clusterUri.Uri;
            _httpLayer = httpLayer;
            _SettingsRepository = settingsRepository;
        }
Пример #8
0
 public DataSampleHeader()
 {
     Key = Guid.NewGuid().ToString();
     Created = DateTime.UtcNow;
     Modified = DateTime.UtcNow;
     Summary = new SampleSummary();
     Metadata = new DataSampleMetadata();
     _uriProvider = new UriProvider();
 }
 /// <summary>
 /// Enables services to be resolved a WCF service proxies.
 /// </summary>
 /// <param name="serviceRegistery">The target <see cref="IServiceRegistry"/>.</param>
 /// <param name="uriProvider">The <see cref="IUriProvider"/> that is responsible
 /// for providing an <see cref="Uri"/> that represents the service endpoint address.</param>
 internal static void EnableWcfClient(this IServiceRegistry serviceRegistery, IUriProvider uriProvider)
 {
     serviceRegistery.RegisterFallback(
         (serviceType, serviceName) => serviceType.IsDefined(typeof(ServiceContractAttribute), true),
         CreateWcfProxy);
     serviceRegistery.Register <IBindingProvider, BindingProvider>(new PerContainerLifetime());
     serviceRegistery.RegisterInstance(uriProvider);
     serviceRegistery.Register <IChannelProvider, ChannelProvider>(new PerContainerLifetime());
     serviceRegistery.Register <IChannelFactoryProvider, ChannelFactoryProvider>(new PerContainerLifetime());
     serviceRegistery.Register <IServiceProxyFactory, ServiceProxyFactory>(new PerContainerLifetime());
     serviceRegistery.Register <IServiceProxyTypeFactory, ServiceProxyTypeFactory>(new PerContainerLifetime());
     serviceRegistery.Register <IServiceClient, ServiceClient>();
     serviceRegistery.Decorate <IChannelFactoryProvider, ChannelFactoryProviderCacheDecorator>();
 }
Пример #10
0
 public DataItem(IUriProvider uriProvider = null)
 {
     _uriProvider = uriProvider ?? new UriProvider();
     Key = Guid.NewGuid().ToString();
     Item = new object();
 }
Пример #11
0
 public StructuredUrlTester(IUriProvider provider)
 {
     Uri uri = provider.Current;
     // Test the value of uri.Host and extract parts via regex
 }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BindingProvider"/> class.
 /// </summary>
 /// <param name="uriProvider">The <see cref="IUriProvider"/> that is responsible
 /// for providing the uri scheme.</param>
 public BindingProvider(IUriProvider uriProvider)
 {
     this.uriProvider = uriProvider;
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChannelFactoryProvider"/> class.
 /// </summary>
 /// <param name="bindingProvider">The <see cref="IBindingProvider"/> that is responsible
 /// for providing a <see cref="Binding"/> to the <see cref="ChannelFactory{TChannel}"/>.</param>
 /// <param name="uriProvider">The <see cref="IUriProvider"/> that is responsible for
 /// providing an <see cref="Uri"/> that represents the service endpoint address.</param>
 /// <param name="endpointBehaviors">A list of <see cref="IEndpointBehavior"/> instances.</param>
 public ChannelFactoryProvider(IBindingProvider bindingProvider, IUriProvider uriProvider, IEnumerable <IEndpointBehavior> endpointBehaviors)
 {
     this.bindingProvider   = bindingProvider;
     this.uriProvider       = uriProvider;
     this.endpointBehaviors = endpointBehaviors;
 }
Пример #14
0
 public HackernewsClientTest()
 {
     uriProvider       = Substitute.For <IUriProvider>();
     httpClientFactory = Substitute.For <IHttpClientFactory>();
     configuration     = Substitute.For <IConfiguration>();
 }
Пример #15
0
 public HackernewsClient(IHttpClientFactory httpClientFactory, IUriProvider uriProvider, IMapper mapper)
 {
     this.httpClientFactory = httpClientFactory;
     this.uriProvider       = uriProvider;
     this.mapper            = mapper;
 }
Пример #16
0
 public DiscoveryClient(IUriProvider urlProvider)
 {
     Provider = urlProvider;
 }