public void Add(IEventTracker eventTracker, Node node)
        {
            var message = node.CreateStartJobMessage(eventTracker,
                Singleton<DIFactory>.Instance.Create<IChannel>("OutOfNodeInSameProcess"));

            var queue = new BlockingCollection<IMessage>(1);
            var callback = new QueueBasedMessageReceiver(queue);

            var obj = Singleton<DIFactory>.Instance.Create<IObject>(
                new Dictionary<string, object>() { 
                        { TypeBasedMessageReceiverRegistryInfoObjectPattern.Type.Name, "StartJobResponse" } 
                    }
            );

            MessageBus.Connect(obj, callback);
            MessageBus.Send(message);

            IMessage response;
            var failMessage = "Job " + eventTracker.GetType().Name + " could not start.";
            if (!queue.TryTake(out response, 2000))
            {
                throw new Exception(failMessage);
            }
            if (!ResponseMessageObjectPattern.Success[response])
            {
                throw new Exception(failMessage);
            }
            _trackers.Add(eventTracker);
        }
示例#2
0
 public ChartsController(IAuthorizationService authorizationService, IChartsService chartsService,
                         IEventTracker <ComponentsController> eventTracker)
 {
     _authorizationService = authorizationService;
     _chartsService        = chartsService;
     _eventTracker         = eventTracker;
 }
示例#3
0
 public RedditDataAcquirer(
     RedditContextProvider redditContextProvider,
     IEventTracker <RedditDataAcquirer> eventTracker)
 {
     _redditContextProvider = redditContextProvider;
     _eventTracker          = eventTracker;
 }
示例#4
0
        public JobManagementService(IEventTracker <JobManagementService> eventTracker,
                                    IOptions <DefaultAcquirersCredentialsOptions> defaultAcquirersCredentialsOptionsObject,
                                    IOptions <JMSOptions> jmsOptionsObject)
        {
            if (string.IsNullOrEmpty(jmsOptionsObject.Value.ServerAddress))
            {
                throw new ArgumentNullException(nameof(jmsOptionsObject.Value.ServerAddress));
            }

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

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

            _defaultAcquirersCredentials = defaultAcquirersCredentialsOptionsObject.Value;

            var host = jmsOptionsObject.Value.ServerAddress;

            _httpService = new HttpService <JobManagementService>(host, eventTracker);
        }
 public UniversalAnalyticsNemeStatsEventTracker(
     IEventTracker eventTracker,
     IUniversalAnalyticsEventFactory eventFactory)
 {
     this.eventTracker = eventTracker;
     this.eventFactory = eventFactory;
 }
 public TwitterContextProvider(
     IEventTracker <TwitterContextProvider> eventTracker,
     ILogger <TwitterContextProvider> logger)
 {
     _eventTracker = eventTracker;
     _logger       = logger;
 }
示例#7
0
 internal MixpanelService(IMixpanelOptions options, IPropertiesProvider defaultPropertiesProvider, ITimeProvider timeProvider, IEventTracker eventTracker)
 {
     _defaultPropertiesProvider = defaultPropertiesProvider;
     _tracker      = eventTracker;
     _options      = options;
     _timeProvider = timeProvider;
 }
        public void Add(IEventTracker eventTracker, Node node)
        {
            var message = node.CreateStartJobMessage(eventTracker,
                                                     Singleton <DIFactory> .Instance.Create <IChannel>("OutOfNodeInSameProcess"));

            var queue    = new BlockingCollection <IMessage>(1);
            var callback = new QueueBasedMessageReceiver(queue);

            var obj = Singleton <DIFactory> .Instance.Create <IObject>(
                new Dictionary <string, object>() {
                { TypeBasedMessageReceiverRegistryInfoObjectPattern.Type.Name, "StartJobResponse" }
            }
                );

            MessageBus.Connect(obj, callback);
            MessageBus.Send(message);

            IMessage response;
            var      failMessage = "Job " + eventTracker.GetType().Name + " could not start.";

            if (!queue.TryTake(out response, 2000))
            {
                throw new Exception(failMessage);
            }
            if (!ResponseMessageObjectPattern.Success[response])
            {
                throw new Exception(failMessage);
            }
            _trackers.Add(eventTracker);
        }
示例#9
0
        public virtual void FixtureSetUp()
        {
            //create a stub for this only since we don't want the slowdown of all of the universal analytics event tracking
            eventTrackerStub = MockRepository.GenerateStub <IEventTracker>();
            eventTrackerStub.Expect(stub => stub.TrackEvent(Arg <IUniversalAnalyticsEvent> .Is.Anything))
            .Repeat.Any();

            playedGameTracker = new UniversalAnalyticsNemeStatsEventTracker(eventTrackerStub, eventFactory);

            using (NemeStatsDbContext nemeStatsDbContext = new NemeStatsDbContext())
            {
                CleanUpTestData();

                testUserWithDefaultGamingGroup = SaveApplicationUser(
                    nemeStatsDbContext,
                    testApplicationUserNameForUserWithDefaultGamingGroup,
                    "*****@*****.**");
                testUserWithDefaultGamingGroupAndNoInvites = SaveApplicationUser(
                    nemeStatsDbContext,
                    testApplicationUserNameForUserWithDefaultGamingGroupAndNoInvites,
                    "*****@*****.**");
                testUserWithOtherGamingGroup = SaveApplicationUser(
                    nemeStatsDbContext,
                    testApplicationUserNameForUserWithOtherGamingGroup,
                    "*****@*****.**");
                testUserWithThirdGamingGroup = SaveApplicationUser(
                    nemeStatsDbContext,
                    testApplicationUserNameForUserWithThirdGamingGroup,
                    "*****@*****.**");

                using (NemeStatsDataContext dataContext = new NemeStatsDataContext())
                {
                    testGamingGroup = SaveGamingGroup(dataContext, testGamingGroup1Name, testUserWithDefaultGamingGroup);
                    testUserWithDefaultGamingGroup = UpdateDatefaultGamingGroupOnUser(testUserWithDefaultGamingGroup, testGamingGroup, dataContext);
                    testOtherGamingGroup           = SaveGamingGroup(dataContext, testGamingGroup2Name, testUserWithOtherGamingGroup);
                    testUserWithOtherGamingGroup   = UpdateDatefaultGamingGroupOnUser(testUserWithOtherGamingGroup, testOtherGamingGroup, dataContext);
                    testThirdGamingGroup           = SaveGamingGroup(dataContext, testGamingGroup3Name, testUserWithThirdGamingGroup);
                    testUserWithThirdGamingGroup   = UpdateDatefaultGamingGroupOnUser(testUserWithThirdGamingGroup,
                                                                                      testThirdGamingGroup, dataContext);

                    testGameDefinition  = SaveGameDefinition(nemeStatsDbContext, testGamingGroup.Id, testGameName);
                    testGameDefinition2 = SaveGameDefinition(nemeStatsDbContext, testGamingGroup.Id, testGameName2);
                    testGameDefinitionWithOtherGamingGroupId = SaveGameDefinition(nemeStatsDbContext, testOtherGamingGroup.Id, testGameNameForGameWithOtherGamingGroupId);
                    gameDefinitionWithNoChampion             = SaveGameDefinition(nemeStatsDbContext, testThirdGamingGroup.Id,
                                                                                  gameDefinitionWithNoChampionName);
                    anotherTestGameDefinitionWithOtherGamingGroupId = SaveGameDefinition(nemeStatsDbContext,
                                                                                         testOtherGamingGroup.Id, testGameNameForAnotherGameWithOtherGamingGroupId);
                    SavePlayers(nemeStatsDbContext, testGamingGroup.Id, testOtherGamingGroup.Id);

                    SaveGamingGroupInvitations(nemeStatsDbContext, dataContext);
                }

                using (NemeStatsDataContext dataContext = new NemeStatsDataContext())
                {
                    CreatePlayedGames(dataContext);
                }
            }
        }
示例#10
0
 public TwitterBatchLoaderFactory(
     IOptions <TwitterBatchLoaderOptions> batchLoaderOptions,
     IEventTracker <TwitterBatchLoader> childEventTracker,
     IDataAcquirerMetadataContextProvider dataAcquirerMetadataContextProvider)
 {
     _batchLoaderOptions = batchLoaderOptions;
     _childEventTracker  = childEventTracker;
     _dataAcquirerMetadataContextProvider = dataAcquirerMetadataContextProvider;
 }
示例#11
0
 public TwitterDataAcquirer(
     TwitterBatchLoaderFactory twitterBatchLoaderFactory,
     ITwitterContextProvider twitterContextProvider,
     IEventTracker <TwitterDataAcquirer> logger)
 {
     _twitterBatchLoaderFactory = twitterBatchLoaderFactory;
     _twitterContextProvider    = twitterContextProvider;
     _logger = logger;
 }
        public BookingViewModel()
        {
            Debug.WriteLine($"BookingViewModel - Ctor()");
            _eventTracker = new AppCenterEventTracker();

            Title = Strings.Strings.BookingPageTitle;

            _eventTracker.Display(EventPage.BookingPage);
        }
示例#13
0
 public void AttachTracker(IEventTracker tracker)
 {
     if (this._trackers == null)
     {
         this._trackers = new List <IEventTracker>();
     }
     Debug.ErrorIf(this._trackers.Contains(tracker), "Tried to attach a tracker to a GameEvent that is already attached to it");
     this._trackers.Add(tracker);
 }
示例#14
0
        private static void SubscribeAsyncReactiveCommand <T>(object property, IEventTracker eventTracker, Type type, PropertyInfo propertyInfo)
        {
            var reactiveProperty = (AsyncReactiveCommand <T>)property;

            reactiveProperty.Subscribe(x =>
            {
                eventTracker.TrackCommand(type, propertyInfo, x);
                return(Task.CompletedTask);
            });
        }
示例#15
0
 public BaseControllerServices(ILogger <BaseController> logger, IAuthTokenService <long> authService,
                               IMapper mapper, IEventTracker tracker, RateLimitConfig rateConfig, IDbServicesFactory factory)
 {
     this.logger      = logger;
     this.authService = authService;
     this.mapper      = mapper;
     this.tracker     = tracker;
     this.rateConfig  = rateConfig;
     this.dbFactory   = factory;
 }
示例#16
0
 public ManagementController(
     IJobManagementService jobManagementService,
     IStorageService storageService,
     ILogger <KafkaResultProducer> kafkaLogger,
     IEventTracker <ManagementController> logger)
 {
     _jobManagementService = jobManagementService;
     _storageService       = storageService;
     _kafkaLogger          = kafkaLogger;
     _eventTracker         = logger;
 }
示例#17
0
        public StorageService(IEventTracker <StorageService> eventTracker, IOptions <StorageOptions> storageOptionsObject)
        {
            if (string.IsNullOrEmpty(storageOptionsObject.Value.ServerAddress))
            {
                throw new ArgumentNullException(nameof(storageOptionsObject.Value.ServerAddress));
            }

            var host = storageOptionsObject.Value.ServerAddress;

            _httpService = new HttpService <StorageService>(host, eventTracker);
        }
示例#18
0
 public JobController(IAuthorizationService authorizationService, IJobService jobService,
                      IJobManagementService jobManagementService, IGetAnalysisService getAnalysisService,
                      ICsvService csvService, IEventTracker <JobController> eventTracker)
 {
     _authorizationService = authorizationService;
     _jobService           = jobService;
     _jobManagementService = jobManagementService;
     _getAnalysisService   = getAnalysisService;
     _csvService           = csvService;
     _eventTracker         = eventTracker;
 }
示例#19
0
 public TwitterBatchLoader(
     Guid jobId,
     IDataAcquirerMetadataContext metadataContext,
     IOptions <TwitterBatchLoaderOptions> optionsAccessor,
     IEventTracker <TwitterBatchLoader> logger)
 {
     _jobId           = jobId;
     _metadataContext = metadataContext;
     _logger          = logger;
     _options         = optionsAccessor.Value;
     _foundPosts      = 0;
 }
示例#20
0
        public void SetUp()
        {
            eventTrackerMock = MockRepository.GenerateMock <IEventTracker>();
            eventFactoryMock = MockRepository.GenerateMock <IUniversalAnalyticsEventFactory>();
            analyticsEvent   = MockRepository.GenerateMock <IUniversalAnalyticsEvent>();

            tracker     = new UniversalAnalyticsNemeStatsEventTracker(eventTrackerMock, eventFactoryMock);
            currentUser = new ApplicationUser()
            {
                AnonymousClientId = "anonymous id"
            };
        }
        public void SetUp()
        {
            eventTrackerMock = MockRepository.GenerateMock<IEventTracker>();
            eventFactoryMock = MockRepository.GenerateMock<IUniversalAnalyticsEventFactory>();
            analyticsEvent = MockRepository.GenerateMock<IUniversalAnalyticsEvent>();

            tracker = new UniversalAnalyticsNemeStatsEventTracker(eventTrackerMock, eventFactoryMock);
            currentUser = new ApplicationUser()
            {
                AnonymousClientId = "anonymous id"
            };
        }
示例#22
0
        public AboutViewModel()
        {
            _eventTracker        = new AppCenterEventTracker();
            _contact             = new Contact();
            _browser             = new Infrastructure.Browser();
            _deepLinkingLauncher = new DeepLinkingLauncher();

            Title           = Strings.Strings.AboutPageTitle;
            AvilaAppVersion = AppInfo.VersionString;

            _eventTracker.Display(EventPage.AboutPage);
        }
        public JobConfigurationUpdateListener(
            IMessageBrokerConsumer messageBrokerConsumer,
            IJobManager jobManager,
            IOptions <ComponentOptions> componentOptionsAccessor,
            IEventTracker <JobConfigurationUpdateListener> logger)
        {
            _messageBrokerConsumer = messageBrokerConsumer;
            _jobManager            = jobManager;
            _logger = logger;

            _updateChannelName = componentOptionsAccessor.Value.UpdateChannelName;
        }
示例#24
0
        /// <summary>
        /// Interface for PIE (Post-Install Events)
        /// </summary>
        public static IEventTracker GetEventTracker()
        {
            IEventTracker ret = null;

            if (SharedGameObject != null)
            {
                ret = SharedGameObject._eventTracker;
            }
            if (ret == null)
            {
                Debug.LogError("Platform-specific implemenation not set");
            }
            return(ret);
        }
        /// <summary>
        /// Interface for PIE (Post-Install Events)
        /// </summary>
        public static IEventTracker GetEventTracker()
        {
            IEventTracker ret = null;

            if (SharedGameObject != null)
            {
                ret = SharedGameObject._eventTracker;
            }
            if (ret == null)
            {
                Debug.LogError(Constants.AdsMessageErrorInvalidImplementation);
            }
            return(ret);
        }
示例#26
0
 public JobManager(
     IDataAcquirerJobStorage dataAcquirerJobStorage,
     IDataAcquirer acquirer,
     ITranslationService translationService,
     IMessageBrokerProducer producer,
     IEventTracker <JobManager> logger)
 {
     _dataAcquirerJobStorage = dataAcquirerJobStorage;
     //   _jobMetadataStorage = jobMetadataStorage;
     _acquirer           = acquirer;
     _translationService = translationService;
     _producer           = producer;
     _logger             = logger;
 }
示例#27
0
        public NewsViewModel()
        {
            Debug.WriteLine("NewsViewModel - Ctor()");

            _dataService         = new DataService();
            _eventTracker        = new AppCenterEventTracker();
            _deepLinkingLauncher = new DeepLinkingLauncher();

            Title = Strings.Strings.NewsPageTitle;

            News = new ObservableCollection <News>();
            Task.Run(async() => await GetNewsAsync());

            _eventTracker.Display(EventPage.NewsPage);
        }
示例#28
0
        public SubscribedComponentManager(
            IComponentRegistry componentRegistry,
            IComponentConfigUpdateNotifier componentConfigUpdateNotifier,

            IJobStorage jobStorage,
            IOptions <ComponentIdentifiers> options,
            IEventTracker <SubscribedComponentManager> logger)
        {
            _identifiers                   = options.Value;
            _componentRegistry             = componentRegistry;
            _componentConfigUpdateNotifier = componentConfigUpdateNotifier;
            _jobStorage = jobStorage;

            _logger = logger;
        }
示例#29
0
        public SessionViewModel(
            INavigationService navigationService,
            IConferenceRepository conferenceRepository,
            IReminderService reminderService,
            IContentDialogService contentDialogService,
            IEventTracker eventTrackerService)
            : base("SessionView", navigationService)
        {
            this.conferenceRepository = conferenceRepository;

            this.reminderService = reminderService;

            this.contentDialogService = contentDialogService;

            this.eventTrackerService = eventTrackerService;
        }
示例#30
0
        public CustomStaticDataAcquirer(
            CustomStreamReaderFactory customStreamReaderFactory,
            IOptions <AttributeElementNames> attributeElementNamesAcessor,
            IOptions <MinioOptions> customAcquirerOptionsAccessor,
            IEventTracker <CustomStaticDataAcquirer> logger)
        {
            var minioOptions = customAcquirerOptionsAccessor.Value;

            _endpoint  = minioOptions.Endpoint;
            _accessKey = minioOptions.AccessKey;
            _secret    = minioOptions.SecretKey;

            var attributeNames = attributeElementNamesAcessor.Value;

            _bucketElementName         = attributeNames.BucketElementName;
            _objectElementName         = attributeNames.ObjectElementName;
            _mappingElementName        = attributeNames.MappingElementName;
            _customStreamReaderFactory = customStreamReaderFactory;
            _logger = logger;
        }
示例#31
0
        public MainViewModel(IEventTracker tracker = null)
        {
            Contacts = new ObservableCollection <Contact>();

            Add = new RelayCommand(p =>
            {
                if (string.IsNullOrWhiteSpace(Name) ||
                    string.IsNullOrWhiteSpace(Email))
                {
                    return;
                }

                Contacts.Add(new Contact(Name, Email));

                Name  = string.Empty;
                Email = string.Empty;

                tracker?.TrackEvent("ContactAdded");
            });
        }
        public HomeViewModel()
        {
            _eventTracker = new AppCenterEventTracker();
            _contact      = new Contact();
            _map          = new Map();

            this.Title            = Strings.Strings.HomePageTitle;
            this.AvilaPhoneNumber = Strings.Strings.HomePageAvilaPhoneNumber;
            this.AvilaAddress     = new Address
            {
                Name    = Strings.Strings.HomePageAvilaAddressName,
                Street  = Strings.Strings.HomePageAvilaAddressStreet,
                ZipCode = Strings.Strings.HomePageAvilaAddressZipCode,
                City    = Strings.Strings.HomePageAvilaAddressCity,
                Country = Strings.Strings.HomePageAvilaAddressCountry
            };
            this.AvilaEmail = Strings.Strings.HomePageAvilaEmail;

            _eventTracker.Display(EventPage.HomePage);
        }
示例#33
0
 public Tracker(Logger log, IEventTracker tracker)
 {
     _log = log;
     _tracker = tracker;
 }
 public void Delete(IEventTracker eventTracker)
 {
     _trackers.Remove(eventTracker);
 }
示例#35
0
        public virtual void FixtureSetUp()
        {
            //create a stub for this only since we don't want the slowdown of all of the universal analytics event tracking
            eventTrackerStub = MockRepository.GenerateStub<IEventTracker>();
            eventTrackerStub.Expect(stub => stub.TrackEvent(Arg<IUniversalAnalyticsEvent>.Is.Anything))
                .Repeat.Any();
             
            playedGameTracker = new UniversalAnalyticsNemeStatsEventTracker(eventTrackerStub, eventFactory);

            using (NemeStatsDbContext nemeStatsDbContext = new NemeStatsDbContext())
            {
                CleanUpTestData();

                testUserWithDefaultGamingGroup = SaveApplicationUser(
                    nemeStatsDbContext,
                    testApplicationUserNameForUserWithDefaultGamingGroup,
                    "*****@*****.**");
                testUserWithDefaultGamingGroupAndNoInvites = SaveApplicationUser(
                    nemeStatsDbContext,
                    testApplicationUserNameForUserWithDefaultGamingGroupAndNoInvites,
                    "*****@*****.**");
                testUserWithOtherGamingGroup = SaveApplicationUser(
                    nemeStatsDbContext,
                    testApplicationUserNameForUserWithOtherGamingGroup,
                    "*****@*****.**");
                testUserWithThirdGamingGroup = SaveApplicationUser(
                    nemeStatsDbContext,
                    testApplicationUserNameForUserWithThirdGamingGroup, 
                    "*****@*****.**");

                using (NemeStatsDataContext dataContext = new NemeStatsDataContext())
                {
                    testGamingGroup = SaveGamingGroup(dataContext, testGamingGroup1Name, testUserWithDefaultGamingGroup);
                    testUserWithDefaultGamingGroup = UpdateDatefaultGamingGroupOnUser(testUserWithDefaultGamingGroup, testGamingGroup, dataContext);
                    testOtherGamingGroup = SaveGamingGroup(dataContext, testGamingGroup2Name, testUserWithOtherGamingGroup);
                    testUserWithOtherGamingGroup = UpdateDatefaultGamingGroupOnUser(testUserWithOtherGamingGroup, testOtherGamingGroup, dataContext);
                    testThirdGamingGroup = SaveGamingGroup(dataContext, testGamingGroup3Name, testUserWithThirdGamingGroup);
                    testUserWithThirdGamingGroup = UpdateDatefaultGamingGroupOnUser(testUserWithThirdGamingGroup,
                        testThirdGamingGroup, dataContext);

                    testBoardGameGeekGameDefinition = SaveBoardGameGeekGameDefinition(dataContext);

                    testGameDefinition = SaveGameDefinition(nemeStatsDbContext, testGamingGroup.Id, testGameName, testBoardGameGeekGameDefinition.Id);
                    testGameDefinition2 = SaveGameDefinition(nemeStatsDbContext, testGamingGroup.Id, testGameName2);
                    testGameDefinitionWithOtherGamingGroupId = SaveGameDefinition(nemeStatsDbContext, testOtherGamingGroup.Id, testGameNameForGameWithOtherGamingGroupId);
                    gameDefinitionWithNoChampion = SaveGameDefinition(nemeStatsDbContext, testThirdGamingGroup.Id,
                        gameDefinitionWithNoChampionName);
                    anotherTestGameDefinitionWithOtherGamingGroupId = SaveGameDefinition(nemeStatsDbContext,
                        testOtherGamingGroup.Id, testGameNameForAnotherGameWithOtherGamingGroupId);
                    SavePlayers(nemeStatsDbContext, testGamingGroup.Id, testOtherGamingGroup.Id);
                }

                using(NemeStatsDataContext dataContext = new NemeStatsDataContext())
                {
                    CreatePlayedGames(dataContext);
                }
            }
        }