Beispiel #1
0
        private IStitchAdaptor GetOrCreateStitchAdaptor(PackageFile packageFile, StitchInstance stitchInstance)
        {
            var adaptor = _adaptors.Get(stitchInstance.Id);

            if (adaptor != null)
            {
                return(adaptor);
            }

            adaptor = _adaptorFactory.Create(packageFile, stitchInstance);

            _adaptors.Add(stitchInstance.Id, adaptor);
            return(adaptor);
        }
        private IStitchAdaptor GetOrCreateStitchAdaptor(PackageFile packageFile, StitchInstance stitchInstance)
        {
            var adaptor = _adaptors.Get(stitchInstance.Id);

            if (adaptor != null)
            {
                return(adaptor);
            }

            adaptor = _adaptorFactory.Create(packageFile, stitchInstance);
            adaptor.StitchContext.DataDirectory            = _fileSystem.GetInstanceDataDirectoryPath(stitchInstance.Id);
            adaptor.StitchContext.StitchStateChange       += OnStitchStateChange;
            adaptor.StitchContext.HeartbeatReceived       += OnStitchHeartbeatSyncReceived;
            adaptor.StitchContext.LogsReceived            += OnStitchLogsReceived;
            adaptor.StitchContext.RequestResponseReceived += OnStitchResponseReceived;
            adaptor.StitchContext.DataMessageReceived     += OnDataMessageReceived;

            _adaptors.Add(stitchInstance.Id, adaptor);
            return(adaptor);
        }