Ejemplo n.º 1
0
        public void TestParseMessageForRoute()
        {
            IRoutingService <string> routingService = _erector.Container.Resolve <IRoutingService <string> >();
            IEnvelope envelope = _erector.Container.Resolve <IEnvelope>();

            string serviceRoute = "123.789";

            envelope.ServiceRoute = serviceRoute;
            IMarshaller marshaller  = _erector.Container.Resolve <IMarshaller>();
            string      jsonMessage = marshaller.MarshallPayloadJSON(envelope);
            string      parsedRoute;

            try
            {
                parsedRoute = routingService.ParseMessageForRoute(String.Empty);
            }
            catch (InvalidOperationException ex)
            {
                Assert.AreEqual(ex.Message, routingService.ExceptionMessage_MessageCannotBeNullOrEmpty);
            }

            try
            {
                parsedRoute = routingService.ParseMessageForRoute(jsonMessage);
            }
            catch (InvalidOperationException ex)
            {
                Assert.AreEqual(ex.Message, routingService.ExceptionMessage_MarshallerCannotBeNull);
            }
            parsedRoute = routingService.ParseMessageForRoute(jsonMessage);
            Assert.AreEqual(parsedRoute, serviceRoute);
        }
Ejemplo n.º 2
0
 public BookingApplicationService(
     ICommandBus commandBus,
     IRoutingService routingService)
 {
     _commandBus     = commandBus;
     _routingService = routingService;
 }
Ejemplo n.º 3
0
 public BookingService(ILocationRepository locationRepository, ICargoRepository cargoRepository, IRoutingService routingService, ICustomerRepository customerRepository)
 {
     _locationRepository = locationRepository;
     _customerRepository = customerRepository;
     _cargoRepository    = cargoRepository;
     _routingService     = routingService;
 }
Ejemplo n.º 4
0
 public HomeController(ILog logger, IConfigurationService configurationService, IUrlBuilder urlBuilder, ISetupService setupService, IRoutingService routingService)
     : base(logger, configurationService)
 {
     this.urlBuilder     = urlBuilder;
     this.setupService   = setupService;
     this.routingService = routingService;
 }
Ejemplo n.º 5
0
 public PageController(ILog logger, IConfigurationService configurationService, IPageService pageService, IUrlBuilder urlBuilder, IRoutingService routingService)
     : base(logger, configurationService)
 {
     this.pageService    = pageService;
     this.urlBuilder     = urlBuilder;
     this.routingService = routingService;
 }
Ejemplo n.º 6
0
        public void RoutingServiceCompositionRoute(IRoutingService <string> routingService, ISkyWatch skyWatch)
        {
            IMessageBus <string> messageBus = _erector.Container.Resolve <IMessageBus <string> >();

            messageBus.JsonSchema =
                (message) =>
            {
                IEnvelope envelope    = _marshaller.UnMarshall <IEnvelope>(message);
                string    serviceName = envelope.ServiceRoute.Split('.')[1];
                if (serviceName == ChatServiceNames.ModifyChatMessageService || serviceName == ChatServiceNames.GetNextChatMessageService)
                {
                    return(_erector.Container.Resolve <IChatMessageEnvelope>().GetMyJSONSchema());
                }
                else
                {
                    return(String.Empty);
                }
            };

            IMessageBusReaderBank <string> messageBusReaderBank = _erector.Container.Resolve <IMessageBusReaderBank <string> >();

            messageBusReaderBank.SpecifyTheMessageBus(messageBus);

            IRoutingTable <string> routingTable = _erector.Container.Resolve <IRoutingTable <string> >();

            routingTable.MessageBusBank = _messageBusBankRouters;

            routingService.RoutingTable         = routingTable;
            routingService.MessageBusReaderBank = messageBusReaderBank;
            //NOTE: Set up two readers
            routingService.InitializeReaders(2);

            _messageBusBankRouters.RegisterMessageBus(routingService.RoutingServiceGUID, messageBus);
            _serviceList.Add(routingService);
        }
Ejemplo n.º 7
0
 public BookingService(ILocationRepository locationRepository, ICargoRepository cargoRepository, IRoutingService routingService, CargoDataAccess cargoDataAccess)
 {
    _locationRepository = locationRepository;
    _cargoRepository = cargoRepository;
    _routingService = routingService;
    _cargoDataAccess = cargoDataAccess;
 }
Ejemplo n.º 8
0
        public void TestForwardMessageToResolvedRoute()
        {
            IRoutingService <string> routingService = _erector.Container.Resolve <IRoutingService <string> >();
            bool            forwardSucceeded        = false;
            Action <string> resolvedRoute           =
                (message) =>
            {
                Assert.IsNotNull(message);    //NOTE: Assert on route destination.
            };
            string jsonMessage = "123 Love";

            try
            {
                forwardSucceeded = routingService.ForwardMessageToResolvedRoute(null, jsonMessage);
            }
            catch (InvalidOperationException ex)
            {
                Assert.AreEqual(ex.Message, routingService.ExceptionMessage_ResolvedRouteCannotBeNull);
            }
            try
            {
                forwardSucceeded = routingService.ForwardMessageToResolvedRoute(resolvedRoute, String.Empty);
            }
            catch (InvalidOperationException ex)
            {
                Assert.AreEqual(ex.Message, routingService.ExceptionMessage_MessageCannotBeNullOrEmpty);
            }
            forwardSucceeded = routingService.ForwardMessageToResolvedRoute(resolvedRoute, jsonMessage);
            Assert.IsTrue(forwardSucceeded);
        }
 public RegistrationViewModel(IRoutingService navigationService = null)
 {
     _navigationService  = navigationService ?? Locator.Current.GetService <IRoutingService>();
     ExecuteBack         = new Command(() => Back());
     ExecuteRegistration = new Command(() => Register());
     ExecuteLoginAgain   = new Command(() => LoginAgain());
 }
Ejemplo n.º 10
0
 public BookingService(ILocationRepository locationRepository, ICargoRepository cargoRepository, IRoutingService routingService, CargoDataAccess cargoDataAccess)
 {
     _locationRepository = locationRepository;
     _cargoRepository    = cargoRepository;
     _routingService     = routingService;
     _cargoDataAccess    = cargoDataAccess;
 }
Ejemplo n.º 11
0
 public PageController(ILog logger, IConfigurationService configurationService, IPageService pageService, IUrlBuilder urlBuilder, IRoutingService routingService)
     : base(logger, configurationService)
 {
     this.pageService = pageService;
     this.urlBuilder = urlBuilder;
     this.routingService = routingService;
 }
Ejemplo n.º 12
0
 public BookingService(ILocationRepository locationRepository, ICargoRepository cargoRepository, IRoutingService routingService, ICustomerRepository customerRepository)
 {
    _locationRepository = locationRepository;
    _customerRepository = customerRepository;
    _cargoRepository = cargoRepository;
    _routingService = routingService;
 }
Ejemplo n.º 13
0
 public CategoryService(ICategoryRepository categoryRepository, IRoutingService routingService,
                        IContentCategoryMapRepository contentCategoryMapRepository)
 {
     _categoryRepository           = categoryRepository;
     _routingService               = routingService;
     _contentCategoryMapRepository = contentCategoryMapRepository;
 }
Ejemplo n.º 14
0
 public TagService(ITagRepository tagRepository, IContentTagMapRepository contentTagMapRepository,
                   IRoutingService routingService)
 {
     _tagRepository           = tagRepository;
     _contentTagMapRepository = contentTagMapRepository;
     _routingService          = routingService;
 }
 public BookingApplicationService(
     ICommandBus commandBus,
     IRoutingService routingService)
 {
     _commandBus = commandBus;
     _routingService = routingService;
 }
Ejemplo n.º 16
0
        public DirectLinkHub(IServiceProvider provider)
        {
            _provider = provider;
            _authenticationService = provider.GetService <IAuthenticationService>();
            _authorizationService  = provider.GetService <IAuthorizationService>();
            _routingService        = provider.GetRequiredService <IRoutingService>();
            _componentsService     = provider.GetRequiredService <IComponentsService>();

            var options = provider.GetRequiredService <DirectLinkOptionsProvider>().Options;

            _requestsPerSecond = options.RequestsPerSecond;
            if (_requestsPerSecond > 0)
            {
                _queuedRequestCount = options.QueuedRequestCount;
                _maxLinkCount       = options.MaxLinkCount;
                _requestDelay       = 1000 / _requestsPerSecond;
                _requestDelayTicks  = _requestDelay * 10000;
            }

            _logger = provider.GetRequiredService <ILogger <DirectLinkHub> >();
            if (HubContext == null)
            {
                HubContext = provider.GetRequiredService <IHubContext <DirectLinkHub> >();
            }
        }
Ejemplo n.º 17
0
		public HomeController(ILog logger, IConfigurationService configurationService, IUrlBuilder urlBuilder, ISetupService setupService, IRoutingService routingService)
			: base(logger, configurationService)
		{
			this.urlBuilder = urlBuilder;
			this.setupService = setupService;
			this.routingService = routingService;
		}
Ejemplo n.º 18
0
 public BookingService(ICargoRepository cargoRepository,
                       ILocationRepository locationRepository,
                       IRoutingService routingService)
 {
     this.cargoRepository    = cargoRepository;
     this.locationRepository = locationRepository;
     this.routingService     = routingService;
 }
        protected internal SelfBalancingOrgService(IRoutingService routingService) : base(null)
        {
            routingService.Require(nameof(routingService));
            RoutingService = routingService;

            RoutingService.Stats.OperationStatusChanged += (s, a) => InnerOperationStatusChanged?.Invoke(this, a);
            RoutingService.Stats.OperationFailed        += (s, a) => InnerOperationFailed?.Invoke(this, a);
        }
Ejemplo n.º 20
0
        public LoginViewModel(IRoutingService navigationService = null)
        {
            _navigationService  = navigationService ?? Locator.Current.GetService <IRoutingService>();
            ExecuteLogin        = new Command(() => Login());
            ExecuteRegistration = new Command(() => Register());

            this.identityService = identityService ?? Locator.Current.GetService <IIdentityService>();
        }
 public StupidFileMiddleware(RequestDelegate next,
     IRoutingService routingService,
     IMimeTypeResolver mimeTypeResolver)
 {
     _next = next;
     _routingService = routingService;
     _mimeTypeResolver = mimeTypeResolver;
 }
 public BookingService(ICargoRepository cargoRepository,
                       ILocationRepository locationRepository,
                       IRoutingService routingService)
 {
     this.cargoRepository = cargoRepository;
     this.locationRepository = locationRepository;
     this.routingService = routingService;
 }
 public ListCategoryViewComponent(ICategoryService categoryService, IMapper mapper, IContentService contentService,
                                  IRoutingService routingService)
 {
     _categoryService = categoryService;
     _mapper          = mapper;
     _contentService  = contentService;
     _routingService  = routingService;
 }
 public PlayerMovementService(
     IHubContext <GameHub> hubContext,
     IClusterClient clusterClient,
     IRoutingService routingService)
 {
     _hubContext     = hubContext;
     _clusterClient  = clusterClient;
     _routingService = routingService;
 }
        public LoginPageViewModel(IRoutingService navigationService = null)
        {
            // Variables
            _navigationService = navigationService ?? Locator.Current.GetService <IRoutingService>();

            // Commands
            LoginCommand = new Command(OnLoginCommand);
            BackCommand  = new Command(OnBackCommand);
        }
 public MetaWeblogHandler()
 {
     this.categoryService      = DexterContainer.Resolve <ICategoryService>();
     this.configurationService = DexterContainer.Resolve <IConfigurationService>();
     this.pageService          = DexterContainer.Resolve <IPageService>();
     this.postService          = DexterContainer.Resolve <IPostService>();
     this.routingService       = DexterContainer.Resolve <IRoutingService>();
     this.urlBuilder           = DexterContainer.Resolve <IUrlBuilder>();
 }
 public MetaWeblogHandler()
 {
     this.categoryService = DexterContainer.Resolve<ICategoryService>();
     this.configurationService = DexterContainer.Resolve<IConfigurationService>();
     this.pageService = DexterContainer.Resolve<IPageService>();
     this.postService = DexterContainer.Resolve<IPostService>();
     this.routingService = DexterContainer.Resolve<IRoutingService>();
     this.urlBuilder = DexterContainer.Resolve<IUrlBuilder>();
 }
Ejemplo n.º 28
0
        public void TestRoutingServiceGUID()
        {
            IRoutingService <string> routingService = _erector.Container.Resolve <IRoutingService <string> >();

            routingService.RoutingTable = GetMockedRoutingTable <string>();
            string routingServiceGUID = routingService.RoutingServiceGUID;

            Assert.IsFalse(String.IsNullOrEmpty(routingServiceGUID));
        }
 public PlayerController(
     IClusterClient client,
     IRoutingService routingService,
     PlayerMovementService movementService)
 {
     _client          = client;
     _routingService  = routingService;
     _movementService = movementService;
 }
Ejemplo n.º 30
0
 public CategoryController(IContentService contentService, IMapper mapper, ICategoryService categoryService,
                           IRoutingService routingService, UserManager <ApplicationUser> userManager)
 {
     _categoryService = categoryService;
     _contentService  = contentService;
     _mapper          = mapper;
     _routingService  = routingService;
     _userManager     = userManager;
 }
Ejemplo n.º 31
0
 public SessionStateGetTests()
 {
     logger = A.Fake <ILogger <EnterYourDetailsController> >();
     fakeSessionStateService = A.Fake <ISessionStateService <SessionDataModel> >();
     fakeMapper               = A.Fake <AutoMapper.IMapper>();
     fakeRoutingService       = A.Fake <IRoutingService>();
     fakeNotifyEmailService   = A.Fake <INotifyEmailService <ContactUsEmailRequestModel> >();
     fakeFamApiRoutingOptions = A.Fake <FamApiRoutingOptions>();
 }
Ejemplo n.º 32
0
 public ContentCategoriesViewComponent(IContentService contentService, IMapper mapper, IAuthorService authorService,
                                       ICategoryService categoryService, IRoutingService routingService, ITagService tagService)
 {
     _contentService  = contentService;
     _authorService   = authorService;
     _categoryService = categoryService;
     _routingService  = routingService;
     _tagService      = tagService;
     _mapper          = mapper;
 }
Ejemplo n.º 33
0
 public CategoryController(IContentService contentService, IMapper mapper, IAuthorService authorService,
                           ICategoryService categoryService, IRoutingService routingService, ITagService tagService)
 {
     _contentService  = contentService;
     _authorService   = authorService;
     _categoryService = categoryService;
     _routingService  = routingService;
     _tagService      = tagService;
     _mapper          = mapper;
 }
Ejemplo n.º 34
0
        public UsersPageViewModel(IRoutingService navigationService = null)
        {
            // Variables
            _navigationService = navigationService ?? Locator.Current.GetService <IRoutingService>();
            this.Users         = new ObservableCollection <HomeModel>(GlobalSetting.GetInstance().Users);

            // Commands
            SelectUserCommand = new Command <HomeModel>(OnSelectUserCommand);
            BackCommand       = new Command(OnBackCommand);
        }
Ejemplo n.º 35
0
 public ManualConvertData(IContentService contentService, IMapper mapper, IAuthorService authorService,
                          ICategoryService categoryService, IRoutingService routingService, ITagService tagService)
 {
     _contentService  = contentService;
     _authorService   = authorService;
     _categoryService = categoryService;
     _routingService  = routingService;
     _tagService      = tagService;
     _mapper          = mapper;
 }
Ejemplo n.º 36
0
 public ContentService(IContentRepository contentRepository, IContentCategoryMapRepository contentCategoryMapRepository,
                       IRoutingService routingService, ICategoryService groupService, IContentTagMapRepository contentTagMapRepository,
                       ITagService tagService)
 {
     _contentCategoryMapRepository = contentCategoryMapRepository;
     _categoryService         = groupService;
     _routingService          = routingService;
     _contentRepository       = contentRepository;
     _contentTagMapRepository = contentTagMapRepository;
     _tagService = tagService;
 }
        public DetailsViewModel(IDialogService dialogService, IRoutingService navigationService, IWeatherApi api)
            : base(dialogService, navigationService)
        {
            this._api = api;

            WeatherIconBasePath = ApiConstants.iconPath;

            DailyWeatherList  = new ObservableCollection <DailyWeatherData>();
            HourlyWeatherList = new ObservableCollection <HourlyWeatherData>();

            LoadDataCommand = new RelayCommand(async() => await LoadData());
        }
 public UserController(IMapper mapper, IRoutingService routingService, IUriService uriService, IConfiguration configuration, ICountryService countryService, IEnterpriseService enterpriseService, IRolesService rolesService, IUserService userService, IPasswordService passwordService)
 {
     _mapper            = mapper;
     _routingService    = routingService;
     _uriService        = uriService;
     _userService       = userService;
     _countryService    = countryService;
     _enterpriseService = enterpriseService;
     _rolesService      = rolesService;
     _configuration     = configuration;
     _passwordService   = passwordService;
 }
Ejemplo n.º 39
0
 /// <summary>
 /// Returns a collection of routes which comply to this cargo's route specification.
 /// </summary>
 /// <param name="routingService">Routing service to use for searching for possible routes.</param>
 /// <returns></returns>
 public virtual IList<Itinerary> RequestPossibleRoutes(IRoutingService routingService)
 {
    return routingService.FetchRoutesForSpecification(_routeSpecification);
 }
Ejemplo n.º 40
0
 public TripsViewModel(INavigationService navigationService, IDataService ds, IRoutingService routingService)
 {
     _dataService = ds;
     _routingService = routingService;
     _navigationService = navigationService;
 }