/// <summary> /// Create a dataDelivery delivery component, corresponding to the given sourceSourceId and account /// </summary> /// <param name="sourceSourceId"></param> /// <param name="account"></param> /// <returns></returns> protected ISourceDataDelivery CreateDataDelivery(ComponentId sourceId) { if (sourceId == _dataStoreSourceInfo.ComponentId) { List <PlatformComponent> components = Platform.GetComponentsByType(typeof(DataStoreManagementComponent)); if (components.Count == 0) { SystemMonitor.Error("Failed to find data store management component."); return(null); } DataStoreDataDelivery delivery = new DataStoreDataDelivery(_dataStoreSourceInfo.ComponentId); if (delivery.Initialize() == false) { SystemMonitor.OperationError("Failed to initialize data store data delivery."); return(null); } return(delivery); } SourceInfo?sourceInfo = GetSourceInfo(sourceId, SourceTypeEnum.DataProvider); if (sourceInfo.HasValue == false) { SystemMonitor.OperationError("Source info not found for source [" + sourceId.Print() + "].", TracerItem.PriorityEnum.High); return(null); } if ((sourceInfo.Value.SourceType & SourceTypeEnum.DataProvider) == 0) { SystemMonitor.OperationError("Can not create data delivery to source that does not implement data provider [" + sourceId.Print() + "].", TracerItem.PriorityEnum.Critical); return(null); } TransportInfo info = GetSourceTransportInfoToMe(sourceId); if (info == null) { return(null); } // This is a remote dataDelivery source, create a corresponding delivery. DataSourceClientStub stubDelivery = new DataSourceClientStub(); Arbiter.AddClient(stubDelivery); stubDelivery.SetInitialParameters(sourceId, info); return(stubDelivery); }
/// <summary> /// Create a dataDelivery delivery component, corresponding to the given sourceSourceId and account /// </summary> /// <param name="sourceSourceId"></param> /// <param name="account"></param> /// <returns></returns> protected ISourceDataDelivery CreateDataDelivery(ComponentId sourceId) { if (sourceId == _dataStoreSourceInfo.ComponentId) { List<PlatformComponent> components = Platform.GetComponentsByType(typeof(DataStoreManagementComponent)); if (components.Count == 0) { SystemMonitor.Error("Failed to find data store management component."); return null; } DataStoreDataDelivery delivery = new DataStoreDataDelivery(_dataStoreSourceInfo.ComponentId); if (delivery.Initialize() == false) { SystemMonitor.OperationError("Failed to initialize data store data delivery."); return null; } return delivery; } SourceInfo? sourceInfo = GetSourceInfo(sourceId, SourceTypeEnum.DataProvider); if (sourceInfo.HasValue == false) { SystemMonitor.OperationError("Source info not found for source [" + sourceId.Print() + "].", TracerItem.PriorityEnum.High); return null; } if ((sourceInfo.Value.SourceType & SourceTypeEnum.DataProvider) == 0) { SystemMonitor.OperationError("Can not create data delivery to source that does not implement data provider [" + sourceId.Print() + "].", TracerItem.PriorityEnum.Critical); return null; } TransportInfo info = GetSourceTransportInfoToMe(sourceId); if (info == null) { return null; } // This is a remote dataDelivery source, create a corresponding delivery. DataSourceClientStub stubDelivery = new DataSourceClientStub(); Arbiter.AddClient(stubDelivery); stubDelivery.SetInitialParameters(sourceId, info); return stubDelivery; }