/// <summary>Process File Transfer Notification.</summary> /// <param name="taskId">task id.</param> /// <param name="taskState">task state.</param> /// <param name="taskPhase">task phase.</param> /// <param name="activeFileTransferCount">file transfer count.</param> /// <param name="errorCount">error count.</param> /// <param name="acquisitionCompletionPercent">acquisition complete percentage.</param> /// <param name="transferCompletionPercent">transfer complete percentage.</param> /// <param name="distributionCompletionPercent">distribute complete percentage.</param> public void OnFileTransferNotification( int taskId, taskStateEnum taskState, taskPhaseEnum taskPhase, ushort activeFileTransferCount, ushort errorCount, sbyte acquisitionCompletionPercent, sbyte transferCompletionPercent, sbyte distributionCompletionPercent) { if (_fileDistributionManager != null) { lock (_lock) { FileDistributionStatusArgs fdsArgs = new FileDistributionStatusArgs(); fdsArgs.TaskId = taskId; fdsArgs.RequestId = _fileDistributionManager.GetFileDistributionRequestIdByTaskId(taskId); fdsArgs.ActiveFileTransferCount = activeFileTransferCount; fdsArgs.AcquisitionCompletionPercent = acquisitionCompletionPercent; fdsArgs.TransferCompletionPercent = transferCompletionPercent; fdsArgs.ErrorCount = errorCount; fdsArgs.DistributionCompletionPercent = distributionCompletionPercent; fdsArgs.TaskStatus = T2GDataConverter.BuildTaskState(taskState); fdsArgs.CurrentTaskPhase = T2GDataConverter.BuildTaskPhase(taskPhase); if (LogManager.IsTraceActive(TraceType.INFO)) { StringBuilder msg = new StringBuilder(200); msg.Append("OnFileTransferNotification("); msg.Append("task=").Append(fdsArgs.TaskId); msg.Append(",request=").Append(fdsArgs.RequestId); msg.Append(",aftc=").Append(fdsArgs.ActiveFileTransferCount); msg.Append(",acp=").Append(fdsArgs.AcquisitionCompletionPercent); msg.Append(",dcp=").Append(fdsArgs.DistributionCompletionPercent); msg.Append(",tcp=").Append(fdsArgs.TransferCompletionPercent); msg.Append(",TaskStatus=").Append(fdsArgs.TaskStatus); msg.Append(",CurrentTaskPhase=").Append(fdsArgs.CurrentTaskPhase); msg.Append(")"); LogManager.WriteLog(TraceType.INFO, msg.ToString(), "PIS.Ground.Core.T2G.T2GNotificationProcessor.OnFileTransferNotification", null, EventIdEnum.GroundCore); } _notifierTarget.RaiseOnFileDistributeNotificationEvent(fdsArgs, taskId); } } }
/// <summary>Service onFileTransferNotification.</summary> /// <param name="taskId">task id.</param> /// <param name="taskState">task state.</param> /// <param name="taskPhase">task phase.</param> /// <param name="activeFileTransferCount">file transfer count.</param> /// <param name="errorCount">error count.</param> /// <param name="acquisitionCompletionPercent">acquisition complete percentage.</param> /// <param name="transferCompletionPercent">transfer complete percentage.</param> /// <param name="distributionCompletionPercent">distribute complete percentage.</param> /// <param name="priority">distribute complete percentage.</param> /// <param name="prioritySpecified">true if priority specified.</param> /// <param name="linkType">Type of the link.</param> /// <param name="linkTypeSpecified">true if link type specified.</param> /// <param name="automaticallyStop">true to automatically stop.</param> /// <param name="automaticallyStopSpecified">true if automatically stop specified.</param> /// <param name="startDate">The start date.</param> /// <param name="startDateSpecified">true if start date specified.</param> /// <param name="notificationURL">URL of the notification.</param> /// <param name="completionDate">Date of the completion.</param> /// <param name="completionDateSpecified">true if completion date specified.</param> /// <param name="waitingFileTransferCount">Number of waiting file transfers.</param> /// <param name="waitingFileTransferCountSpecified">true if waiting file transfer count specified.</param> /// <param name="completedFileTransferCount">Number of completed file transfers.</param> /// <param name="completedFileTransferCountSpecified">true if completed file transfer count /// specified.</param> /// <param name="taskSubState">State of the task sub.</param> /// <param name="taskSubStateSpecified">true if task sub state specified.</param> /// <param name="distributingFileTransferCount">Number of distributing file transfers.</param> /// <param name="distributingFileTransferCountSpecified">true if distributing file transfer count /// specified.</param> public void onFileTransferNotification( int taskId, taskStateEnum taskState, taskPhaseEnum taskPhase, ushort activeFileTransferCount, ushort errorCount, sbyte acquisitionCompletionPercent, sbyte transferCompletionPercent, sbyte distributionCompletionPercent, sbyte priority, bool prioritySpecified, linkTypeEnum linkType, bool linkTypeSpecified, bool automaticallyStop, bool automaticallyStopSpecified, System.DateTime startDate, bool startDateSpecified, string notificationURL, System.DateTime completionDate, bool completionDateSpecified, ushort waitingFileTransferCount, bool waitingFileTransferCountSpecified, ushort completedFileTransferCount, bool completedFileTransferCountSpecified, taskSubStateEnum taskSubState, bool taskSubStateSpecified, ushort distributingFileTransferCount, bool distributingFileTransferCountSpecified) { Action <onFileTransferNotificationArgs> invoker = onFileTransferNotificationAsync; string msg = Environment.NewLine + " task=" + taskId.ToString() + Environment.NewLine + " ts=" + taskState.ToString() + Environment.NewLine + " tp=" + taskPhase.ToString() + Environment.NewLine + " url=" + notificationURL.ToString() + Environment.NewLine + " aftc=" + activeFileTransferCount.ToString() + Environment.NewLine + " ec=" + errorCount.ToString() + Environment.NewLine + " acp=" + acquisitionCompletionPercent.ToString() + Environment.NewLine + " tcp=" + transferCompletionPercent.ToString() + Environment.NewLine + " dcp=" + distributionCompletionPercent.ToString() + Environment.NewLine + " p=" + priority.ToString() + Environment.NewLine + " ps=" + prioritySpecified.ToString() + Environment.NewLine + " lt=" + linkType.ToString() + Environment.NewLine + " lts=" + linkTypeSpecified.ToString() + Environment.NewLine; if (!test) { onFileTransferNotificationArgs args = new onFileTransferNotificationArgs { taskId = taskId, taskState = taskState, taskPhase = taskPhase, activeFileTransferCount = activeFileTransferCount, errorCount = errorCount, acquisitionCompletionPercent = acquisitionCompletionPercent, transferCompletionPercent = transferCompletionPercent, distributionCompletionPercent = distributionCompletionPercent }; if (test2) { onFileTransferNotificationAsync(args); } else { invoker.BeginInvoke( args, invoker.EndInvoke, null); } } }