Beispiel #1
0
 public Service(IEventCollector eventCollector, ITweetConnector tweetConnector, IFootballGameRepository gameRepository, ITweetRepository tweetRepository)
 {
     _eventCollector  = eventCollector;
     _tweetConnector  = tweetConnector;
     _gameRepository  = gameRepository;
     _tweetRepository = tweetRepository;
 }
Beispiel #2
0
 /// <summary>
 /// Add Event related scripts to the DataManager Gameobject
 /// </summary>
 static void AddEventScripts(GameObject gameobject)
 {
     if (gameobject != null)
     {
         for (int i = 0; i < ConfigurationManager.eventCollectors.Count; i++)
         {
             if (ConfigurationManager.eventCollectors[i].enable)
             {
                 Type            type      = ConfigurationManager.eventCollectors[i].collector;
                 IEventCollector collector = gameobject.GetComponent(type) as IEventCollector;
                 if (collector == null)
                 {
                     gameobject.AddComponent(type);
                 }
                 collector = gameobject.GetComponent(type) as IEventCollector;
                 collector.setTimeInterval(ConfigurationManager.eventCollectors[i].timeInterval);
             }
             else
             {
                 Type type = ConfigurationManager.eventCollectors[i].collector;
                 UnityEngine.Object collector = gameobject.GetComponent(type) as UnityEngine.Object;
                 if (collector != null)
                 {
                     DestroyImmediate(collector);
                 }
             }
         }
         EditorUtility.SetDirty(gameobject);
     }
 }
Beispiel #3
0
 public CollectorEventsProducer(IEventCollector collector, IHealthStore healthStore, EventHubsConfiguration conf) :
     base(collector, healthStore)
 {
     this.Id        = new Guid();
     this.collector = collector;
     this.conf      = conf;
     this.StartEventProcessor();
 }
Beispiel #4
0
        public async Task ReadAsync(IEventCollector collector)
        {
            Subscriber subscriber = new Subscriber(collector);

            using (this.eventStream.Subscribe(subscriber))
            {
                await subscriber.WaitAsync();
            }
        }
Beispiel #5
0
        public ISource CreateSource(IEventCollector collector, IHealthStore healthStore)
        {
            if (this.testEventSource == null)
            {
                this.testEventSource = new TestEventSource(collector, healthStore, partitionId);
            }

            return(this.testEventSource);
        }
Beispiel #6
0
 internal ServiceFabricSource(IEventCollector collector, string sourceName,
                              IReliableStateManager stateManager, Guid partitionId, IMessageConverter messageConverter)
     : base(collector, sourceName)
 {
     this.changeCollector = new ChangeCollector();
     // Here we registered with the event collector.
     this.partitionId  = partitionId;
     this.StateManager = stateManager;
     this.StateManager.TransactionChanged  += this.OnTransactionChangedHandler;
     this.StateManager.StateManagerChanged += this.OnStateManagerChangedHandler;
     this.messageConverter = messageConverter;
 }
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        bool periodicSendFlag             = true;
        bool pauseSendFlag                = true;
        bool pauseOnHeadsetRemoval        = true;
        DataCollectionManager dataManager = (DataCollectionManager)target;

        if (GUILayout.Button("Configure Manager"))
        {
            List <Type> typeList = ConfigurationManager.GetAllEventCollectors();
            List <VadrEventCollector> eventCollectors = new List <VadrEventCollector>();
            for (int i = 0; i < typeList.Count; i++)
            {
                eventCollectors.Add(new VadrEventCollector(typeList[i], false, -1.0f));
            }
            pauseSendFlag         = dataManager.pauseSendFlag;
            periodicSendFlag      = dataManager.periodicSendFlag;
            pauseOnHeadsetRemoval = dataManager.pauseOnHeadsetRemoval;
            GameObject gameobject = dataManager.gameObject;
            if (gameobject != null)
            {
                for (int i = 0; i < eventCollectors.Count; i++)
                {
                    IEventCollector collector = gameobject.GetComponent(eventCollectors[i].collector) as IEventCollector;
                    if (collector != null)
                    {
                        eventCollectors[i].enable = true;
                        if ((collector.getTimeInterval() < eventCollectors[i].timeInterval) || (eventCollectors[i].timeInterval < 0))
                        {
                            eventCollectors[i].timeInterval = collector.getTimeInterval();
                        }
                    }
                }
            }
            for (int i = 0; i < eventCollectors.Count; i++)
            {
                if (eventCollectors[i].timeInterval < 0)
                {
                    eventCollectors[i].timeInterval = 0.2f;
                }
            }
            ConfigurationManager.Init(ref dataManager, eventCollectors,
                                      dataManager.appId, dataManager.appToken, dataManager.testMode, periodicSendFlag, pauseSendFlag, pauseOnHeadsetRemoval);
            ConfigurationManager.ShowWindow();
        }
    }
Beispiel #8
0
 public Subscriber(IEventCollector collector)
 {
     this.tcs       = new TaskCompletionSource <bool>();
     this.collector = collector;
 }
Beispiel #9
0
 public EventProcessorFactory(IEventCollector collector, Guid Id)
 {
     this.collector = collector;
     this.id        = Id;
 }
Beispiel #10
0
 public Source(IEventCollector eventCollector, IHealthStore healthStore)
 {
     this.eventCollector = eventCollector;
     this.healthStore    = healthStore;
 }
    /// <summary>
    /// Setting the configuration window from current parameters
    /// </summary>
    static void ShowConfigurationWindow()
    {
        string                    appId                 = "";
        string                    appToken              = "";
        bool                      testMode              = true;
        bool                      pauseSendFlag         = true;
        bool                      periodicSendFlag      = true;
        bool                      pauseOnHeadsetRemoval = true;
        List <VadrScene>          vadrScenes            = new List <VadrScene>();
        List <Type>               typeList              = ConfigurationManager.GetAllEventCollectors();
        List <VadrEventCollector> eventCollectors       = new List <VadrEventCollector>();

        for (int i = 0; i < typeList.Count; i++)
        {
            eventCollectors.Add(new VadrEventCollector(typeList[i], false, -1.0f));
        }
        UnityEngine.SceneManagement.Scene currentScene = EditorSceneManager.GetActiveScene();
        string currentPath = currentScene.path;

        if (currentPath.Length > 0 || EditorUtility.DisplayDialog("", "You can lose unsaved changes", "Continue", "Cancel"))
        {
            float totalScenes     = EditorBuildSettings.scenes.Length;
            float completedScenes = 0;
            foreach (EditorBuildSettingsScene S in EditorBuildSettings.scenes)
            {
                EditorUtility.DisplayProgressBar("Initializing", "Initializing Configuration Manager",
                                                 completedScenes / totalScenes);
                completedScenes++;
                if (S.enabled)
                {
                    string sceneId = "";
                    EditorSceneManager.OpenScene(S.path);
                    DataCollectionManager dataManager = UnityEngine.Object.FindObjectOfType <DataCollectionManager>();
                    if (dataManager != null)
                    {
                        // Prefill App Id and App Token of already present.
                        if (dataManager.sceneId != null)
                        {
                            sceneId = dataManager.sceneId;
                        }
                        if (appId.Length == 0 && dataManager.appId != null)
                        {
                            appId = dataManager.appId;
                        }
                        if (appToken.Length == 0 && dataManager.appToken != null)
                        {
                            appToken = dataManager.appToken;
                        }
                        if (testMode)
                        {
                            testMode = dataManager.testMode;
                        }
                        if (!dataManager.periodicSendFlag)
                        {
                            periodicSendFlag = dataManager.periodicSendFlag;
                        }
                        if (!dataManager.pauseSendFlag)
                        {
                            pauseSendFlag = dataManager.pauseSendFlag;
                        }
                        if (!dataManager.pauseOnHeadsetRemoval)
                        {
                            pauseOnHeadsetRemoval = dataManager.pauseOnHeadsetRemoval;
                        }
                        // Getting already attached event scripts data.
                        GameObject gameobject = dataManager.gameObject;
                        if (gameobject != null)
                        {
                            for (int i = 0; i < eventCollectors.Count; i++)
                            {
                                IEventCollector collector = gameobject.GetComponent(eventCollectors[i].collector) as IEventCollector;
                                if (collector != null)
                                {
                                    eventCollectors[i].enable = true;
                                    if ((collector.getTimeInterval() < eventCollectors[i].timeInterval) || (eventCollectors[i].timeInterval < 0))
                                    {
                                        eventCollectors[i].timeInterval = collector.getTimeInterval();
                                    }
                                }
                            }
                        }
                    }
                    vadrScenes.Add(new VadrScene(S.path, sceneId));
                }
            }
            for (int i = 0; i < eventCollectors.Count; i++)
            {
                if (eventCollectors[i].timeInterval < 0)
                {
                    eventCollectors[i].timeInterval = 0.2f;
                }
            }
            if (currentPath.Length > 0)
            {
                EditorSceneManager.OpenScene(currentPath);
            }
            EditorUtility.ClearProgressBar();
            ConfigurationManager.Init(vadrScenes, eventCollectors, appId, appToken, testMode,
                                      periodicSendFlag, pauseSendFlag, pauseOnHeadsetRemoval);
            ConfigurationManager.ShowWindow();
        }
    }
 public TestEventSource(IEventCollector collector, IHealthStore healthStore, Guid id = new Guid()) :
     base(collector, healthStore)
 {
     this.Id        = id;
     this.collector = collector;
 }
Beispiel #13
0
 internal Source(IEventCollector eventCollector, string sourceName)
 {
     this.EventCollector = eventCollector;
     this.ServiceId      = new Guid();
     this.SourceName     = sourceName;
 }
 public GroupCommandHandler(IEventCollector eventCollector,
                            IEventDispatcher eventDispatcher)
 {
     this.eventCollector  = eventCollector;
     this.eventDispatcher = eventDispatcher;
 }
 public ISource CreateSource(IEventCollector collector, IHealthStore healthStore)
 {
     return(new ServiceFabricSource(collector, this.sourceName, this.stateManager,
                                    this.partitionId, this.messageConverter));
 }
 public SimpleEventProcessor(PartitionContext context, IEventCollector collector, Guid Id)
 {
     this.collector = collector;
     this.id        = Id;
 }
 public void SetCollector(IEventCollector eventCollector)
 {
     Collector = eventCollector;
 }
 public PublishDomainEventsOnSaveChangesInterceptor(IEventCollector eventCollector, IEventSerializer eventSerializer)
 {
     _eventCollector  = eventCollector;
     _eventSerializer = eventSerializer;
 }