Пример #1
0
        public EndpointController(IEndpointRepository repository, Func<HttpRequestMessage, string> mapUsernameDelegate)
        {
            if (repository == null)
                throw new ArgumentNullException("repository");

            this.Repository = repository;
            this.mapUsernameDelegate = mapUsernameDelegate;
        }
Пример #2
0
        public ConfigurationService(
            ISiteRepository siteRepository,
            IOptionRepository optionRepository,
            IEndpointRepository endpointRepository,
            ISiteHealthUnitOfWork uow)
        {
            _siteRepository     = siteRepository;
            _optionRepository   = optionRepository;
            _endpointRepository = endpointRepository;
            _uow = uow;

            _simpleMapper = CreateSimpleMapper();
            _deepMapper   = CreateMapperWithChilds();
        }
Пример #3
0
 public EndpointController(IEndpointRepository EndpointRepository, IInatorRepository InatorRepository, IUserCurrentService UserCurrentService)
 {
     if (EndpointRepository == null) {
         throw new ArgumentNullException(nameof(EndpointRepository));
     }
     if (InatorRepository == null) {
         throw new ArgumentNullException(nameof(InatorRepository));
     }
     if (UserCurrentService == null) {
         throw new ArgumentNullException(nameof(UserCurrentService));
     }
     this.endpointRepository = EndpointRepository;
     this.inatorRepository = InatorRepository;
     this.userCurrentService = UserCurrentService;
 }
Пример #4
0
 public HandleApiController(IEndpointRepository EndpointRepository, ICsharpCompileHelper CsharpCompileHelper, IJavaScriptCompileHelper JavaScriptCompileHelper, IHostingEnvironment Env) {
     if (EndpointRepository == null) {
         throw new ArgumentNullException(nameof(EndpointRepository));
     }
     if (CsharpCompileHelper == null) {
         throw new ArgumentNullException(nameof(CsharpCompileHelper));
     }
     if (JavaScriptCompileHelper == null) {
         throw new ArgumentNullException(nameof(JavaScriptCompileHelper));
     }
     if (Env == null) {
         throw new ArgumentNullException(nameof(Env));
     }
     this.endpointRepository = EndpointRepository;
     this.csharpCompileHelper = CsharpCompileHelper;
     this.javaScriptCompileHelper = JavaScriptCompileHelper;
     this.env = Env;
 }
Пример #5
0
        public IndexViewModel Create(string orderBy, string direction, int skip, int take, string filter)
        {
            IEndpointRepository endpointRepository = this.RequestHandler.Storage.GetRepository <IEndpointRepository>();

            return(new IndexViewModel()
            {
                Grid = new GridViewModelFactory(this.RequestHandler).Create(
                    orderBy, direction, skip, take, endpointRepository.Count(filter),
                    new[] {
                    new GridColumnViewModelFactory(this.RequestHandler).Create("Name", "Name"),
                    new GridColumnViewModelFactory(this.RequestHandler).Create("URL template", "UrlTemplate"),
                    new GridColumnViewModelFactory(this.RequestHandler).Create("Position", "Position"),
                    new GridColumnViewModelFactory(this.RequestHandler).Create("Data sources"),
                    new GridColumnViewModelFactory(this.RequestHandler).CreateEmpty()
                },
                    endpointRepository.Range(orderBy, direction, skip, take, filter).ToList().Select(m => new EndpointViewModelFactory(this.RequestHandler).Create(m)),
                    "_Endpoint"
                    )
            });
        }
        public PushNotificationsController(IEndpointRepository endpointRepository, CloudBlobClient cloudBlobClient, string tileImagesContainerName)
        {
            if (cloudBlobClient == null)
            {
                throw new ArgumentNullException("cloudBlobClient", "The Cloud Blob Client cannot be null");
            }

            if (endpointRepository == null)
            {
                throw new ArgumentNullException("endpointRepository", "The Endpoints repository cannot be null");
            }

            if (string.IsNullOrWhiteSpace(tileImagesContainerName))
            {
                throw new ArgumentException("The container name for the tile images cannot be null, empty or white space", "tileImagesContainerName");
            }

            this.cloudBlobClient = cloudBlobClient;
            this.endpointRepository = endpointRepository;
            this.tileImagesContainerName = tileImagesContainerName;
        }
Пример #7
0
        public PushNotificationsController(IEndpointRepository endpointRepository, CloudBlobClient cloudBlobClient, string tileImagesContainerName)
        {
            if (cloudBlobClient == null)
            {
                throw new ArgumentNullException("cloudBlobClient", "The Cloud Blob Client cannot be null");
            }

            if (endpointRepository == null)
            {
                throw new ArgumentNullException("endpointRepository", "The Endpoints repository cannot be null");
            }

            if (string.IsNullOrWhiteSpace(tileImagesContainerName))
            {
                throw new ArgumentException("The container name for the tile images cannot be null, empty or white space", "tileImagesContainerName");
            }

            this.cloudBlobClient         = cloudBlobClient;
            this.endpointRepository      = endpointRepository;
            this.tileImagesContainerName = tileImagesContainerName;
        }
Пример #8
0
 public WnsEndpointRepository()
 {
     this.endpointRepository = NotificationServiceContext.Current.Configuration.StorageProvider;
 }
Пример #9
0
 public EndpointController(IEndpointRepository repository)
     : this(repository, NotificationServiceContext.Current.Configuration.MapUsername)
 {
 }
 public WnsEndpointRepository()
 {
     this.endpointRepository = NotificationServiceContext.Current.Configuration.StorageProvider;
 }
 public IEnumerable <Endpoint> Get([FromServices] IEndpointRepository repository)
 {
     return(repository.GetAll());
 }
 public RegisterEndpointHanlderTests()
 {
     _endpointRepository      = new EndpointFakeRepository();
     _endpointHandler         = new EndpointHandler(_endpointRepository);
     _registerEndpointCommand = new RegisterEndpointCommand("2", 1, 1, "v 0.0.1", EEndpointState.Connected);
 }
Пример #13
0
 public EndpointHandler(IEndpointRepository repository)
 {
     _repository = repository;
 }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IEndpointRepository repository)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

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

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            var timerPeriod = Int32.Parse(Configuration.GetSection("AppSettings").GetSection("TimerPeriod").Value);

            _timer = new Timer(new TimerCallback(s =>
            {
                var heartbeats = repository.GetAll();

                var httpClient = new HttpClient();
                foreach (var heartbeat in heartbeats)
                {
                    try
                    {
                        httpClient.GetAsync(heartbeat.Url);
                    }
                    catch (Exception) { }
                }
            }),
                               null,
                               1000,
                               timerPeriod);
        }
Пример #15
0
 protected EndpointDeliveryService(IEndpointRepository <TEndpoint> endpointRepository)
 {
     _endpointRepository = endpointRepository;
 }
Пример #16
0
 public EndpointService(
     IEndpointRepository endpointRepository)
 {
     _endpointRepository = endpointRepository;
 }
Пример #17
0
 public InatorConstraint(IEndpointRepository EndpointRepository, IHostingEnvironment Env) {
     if (EndpointRepository == null) {
         throw new ArgumentNullException(nameof(EndpointRepository));
     }
     if (Env == null) {
         throw new ArgumentNullException(nameof(Env));
     }
     this.endpointRepository = EndpointRepository;
     this.env = Env;
 }
 public Endpoint GetBySeriaNumber(string serialNumber, [FromServices] IEndpointRepository repository)
 {
     return(repository.GetBySerialNumber(serialNumber));
 }
 public DeleteEndpointHanlderTests()
 {
     _endpointRepository    = new EndpointFakeRepository();
     _endpointHandler       = new EndpointHandler(_endpointRepository);
     _deleteEndpointCommand = new DeleteEndpointCommand("1");
 }
Пример #20
0
 public UpdateEndpointHanlderTests()
 {
     _endpointRepository    = new EndpointFakeRepository();
     _endpointHandler       = new EndpointHandler(_endpointRepository);
     _updateEndpointCommand = new UpdateEndpointCommand("1", EEndpointState.Connected);
 }
 public EndpointsController(IEndpointRepository endpointRepository)
 {
     _endpointRepository = endpointRepository;
 }