Пример #1
0
        // Token: 0x06000033 RID: 51 RVA: 0x00002AB8 File Offset: 0x00000CB8
        public override ComplianceMessage Process(ComplianceMessage input)
        {
            IPayloadRetriever  payloadRetriever;
            FaultDefinition    faultDefinition;
            WorkPayload        workPayload;
            IApplicationPlugin applicationPlugin;

            if (Registry.Instance.TryGetInstance <IPayloadRetriever>(RegistryComponent.TaskDistribution, TaskDistributionComponent.PayloadRetriever, out payloadRetriever, out faultDefinition, "Process", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\TaskDistributionFabric\\Blocks\\WorkBlock.cs", 40) && payloadRetriever.TryGetPayload <WorkPayload>(WorkPayload.Description, input.Payload, out workPayload, out faultDefinition) && Registry.Instance.TryGetInstance <IApplicationPlugin>(RegistryComponent.Application, workPayload.WorkDefinitionType, out applicationPlugin, out faultDefinition, "Process", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\TaskDistributionFabric\\Blocks\\WorkBlock.cs", 44))
            {
                ComplianceMessage complianceMessage = input.Clone();
                complianceMessage.MessageId             = string.Format("{0}-WORKRESULT", input.MessageId);
                complianceMessage.MessageSourceId       = input.MessageId;
                complianceMessage.MessageSource         = input.MessageTarget;
                complianceMessage.ComplianceMessageType = ComplianceMessageType.RecordResult;
                WorkPayload inputObject = null;
                if (ApplicationHelper.TryDoWork(complianceMessage, workPayload, out inputObject, out faultDefinition, "Process", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\TaskDistributionFabric\\Blocks\\WorkBlock.cs", 54))
                {
                    complianceMessage.Payload = ComplianceSerializer.Serialize <WorkPayload>(WorkPayload.Description, inputObject);
                }
                if (faultDefinition != null)
                {
                    ExceptionHandler.FaultMessage(complianceMessage, faultDefinition, true);
                }
                return(complianceMessage);
            }
            if (faultDefinition != null)
            {
                ExceptionHandler.FaultMessage(input, faultDefinition, true);
            }
            return(null);
        }
Пример #2
0
        // Token: 0x0600011B RID: 283 RVA: 0x00006E0C File Offset: 0x0000500C
        private void UpdateFailureResults(WorkPayload workPayload)
        {
            FaultDefinition results;
            FaultDefinition faultDefinition;

            if (ComplianceSerializer.TryDeserialize <FaultDefinition>(FaultDefinition.Description, workPayload.WorkDefinition, out results, out faultDefinition, "UpdateFailureResults", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\TaskDistributionCommon\\ObjectModel\\ComplianceSearch.cs", 429))
            {
                this.UpdateErrors(results);
            }
        }
Пример #3
0
        /// <summary>
        ///     Serializes the specified command.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public Task <byte[]> SerializeAsync(IQuidjiboCommand command, CancellationToken cancellationToken)
        {
            var workPayload = new WorkPayload
            {
                Type    = command.GetQualifiedName(),
                Content = GetContent(command)
            };
            var json    = JsonConvert.SerializeObject(workPayload);
            var payload = Encoding.UTF8.GetBytes(json);

            return(Task.FromResult(payload));
        }
Пример #4
0
        // Token: 0x06000118 RID: 280 RVA: 0x00006BC0 File Offset: 0x00004DC0
        internal byte[] GetExchangeWorkDefinition()
        {
            SearchWorkDefinition searchWorkDefinition = new SearchWorkDefinition();

            searchWorkDefinition.Parser      = SearchWorkDefinition.QueryParser.KQL;
            searchWorkDefinition.DetailCount = 500;
            searchWorkDefinition.Query       = this.ToKqlQuery();
            WorkPayload workPayload = new WorkPayload();

            workPayload.WorkDefinition     = ComplianceSerializer.Serialize <SearchWorkDefinition>(SearchWorkDefinition.Description, searchWorkDefinition);
            workPayload.WorkDefinitionType = WorkDefinitionType.EDiscovery;
            return(ComplianceSerializer.Serialize <WorkPayload>(WorkPayload.Description, workPayload));
        }
Пример #5
0
        public static bool TryDoWork(ComplianceMessage target, WorkPayload workPayload, out WorkPayload resultPayload, out FaultDefinition faultDefinition, [CallerMemberName] string callerMember = null, [CallerFilePath] string callerFilePath = null, [CallerLineNumber] int callerLineNumber = 0)
        {
            resultPayload = null;
            WorkPayload        newPayload = null;
            IApplicationPlugin plugin;

            if (Registry.Instance.TryGetInstance <IApplicationPlugin>(RegistryComponent.Application, target.WorkDefinitionType, out plugin, out faultDefinition, "TryDoWork", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\TaskDistributionFabric\\Utility\\ApplicationHelper.cs", 104))
            {
                ExceptionHandler.Gray.TryRun(delegate
                {
                    newPayload = plugin.DoWork(target, workPayload);
                }, TaskDistributionSettings.ApplicationExecutionTime, out faultDefinition, target, null, default(CancellationToken), null, callerMember, callerFilePath, callerLineNumber);
                if (ExceptionHandler.IsFaulted(target))
                {
                    faultDefinition = ExceptionHandler.GetFaultDefinition(target);
                }
            }
            resultPayload = newPayload;
            return(resultPayload != null && faultDefinition == null);
        }
        public ResultBase RecordResult(ResultBase existing, WorkPayload addition)
        {
            SearchResult searchResult  = new SearchResult();
            SearchResult searchResult2 = existing as SearchResult;

            if (addition != null)
            {
                FaultDefinition faultDefinition;
                if (addition.WorkDefinitionType == WorkDefinitionType.Fault)
                {
                    FaultDefinition faultDefinition2;
                    if (!ComplianceSerializer.TryDeserialize <FaultDefinition>(FaultDefinition.Description, addition.WorkDefinition, out faultDefinition, out faultDefinition2, "RecordResult", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\ApplicationPlugins\\EDiscovery\\SearchApplicationPlugin.cs", 82))
                    {
                        faultDefinition = faultDefinition2;
                    }
                }
                else if (ComplianceSerializer.TryDeserialize <SearchResult>(SearchResult.Description, addition.WorkDefinition, out searchResult, out faultDefinition, "RecordResult", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\ApplicationPlugins\\EDiscovery\\SearchApplicationPlugin.cs", 87))
                {
                    if (searchResult2 == null)
                    {
                        searchResult2 = searchResult;
                    }
                    else
                    {
                        searchResult2.UpdateTotalSize(searchResult.TotalSize);
                        searchResult2.UpdateTotalCount(searchResult.TotalCount);
                        searchResult2.MergeFaults(searchResult);
                    }
                }
                if (faultDefinition != null)
                {
                    if (searchResult2 == null)
                    {
                        searchResult2 = new SearchResult();
                    }
                    searchResult2.MergeFaults(faultDefinition);
                }
            }
            return(searchResult2);
        }
        public WorkPayload Preprocess(ComplianceMessage target, WorkPayload payload)
        {
            SearchWorkDefinition   searchWorkDefinition;
            FaultDefinition        faultDefinition;
            ISearchResultsProvider searchResultsProvider;

            if (ComplianceSerializer.TryDeserialize <SearchWorkDefinition>(SearchWorkDefinition.Description, payload.WorkDefinition, out searchWorkDefinition, out faultDefinition, "Preprocess", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\ApplicationPlugins\\EDiscovery\\SearchApplicationPlugin.cs", 128) && Registry.Instance.TryGetInstance <ISearchResultsProvider>(RegistryComponent.EDiscovery, EDiscoveryComponent.SearchResultProvider, out searchResultsProvider, out faultDefinition, "Preprocess", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\ApplicationPlugins\\EDiscovery\\SearchApplicationPlugin.cs", 130))
            {
                searchWorkDefinition = searchResultsProvider.ParseSearch(target, searchWorkDefinition);
                return(new WorkPayload
                {
                    PayloadId = payload.PayloadId,
                    WorkDefinitionType = WorkDefinitionType.EDiscovery,
                    WorkDefinition = ComplianceSerializer.Serialize <SearchWorkDefinition>(SearchWorkDefinition.Description, searchWorkDefinition)
                });
            }
            if (faultDefinition != null)
            {
                ExceptionHandler.FaultMessage(target, faultDefinition, true);
            }
            return(null);
        }
 public WorkPayload Preprocess(ComplianceMessage target, WorkPayload payload)
 {
     return(payload);
 }
 public ResultBase RecordResult(ResultBase existing, WorkPayload addition)
 {
     return(existing);
 }
 public WorkPayload DoWork(ComplianceMessage target, WorkPayload payload)
 {
     return(payload);
 }
Пример #11
0
        public static bool TryRecordResult(ComplianceMessage target, ResultBase existingResult, WorkPayload workPayload, out ResultBase processedResult, out FaultDefinition faultDefinition, [CallerMemberName] string callerMember = null, [CallerFilePath] string callerFilePath = null, [CallerLineNumber] int callerLineNumber = 0)
        {
            processedResult = null;
            ResultBase         newResult = null;
            IApplicationPlugin plugin;

            if (Registry.Instance.TryGetInstance <IApplicationPlugin>(RegistryComponent.Application, target.WorkDefinitionType, out plugin, out faultDefinition, "TryRecordResult", "f:\\15.00.1497\\sources\\dev\\EDiscovery\\src\\TaskDistributionSystem\\TaskDistributionFabric\\Utility\\ApplicationHelper.cs", 159))
            {
                ExceptionHandler.Gray.TryRun(delegate
                {
                    newResult = plugin.RecordResult(existingResult, workPayload);
                }, TaskDistributionSettings.ApplicationExecutionTime, out faultDefinition, target, null, default(CancellationToken), null, callerMember, callerFilePath, callerLineNumber);
            }
            processedResult = newResult;
            return(processedResult != null && faultDefinition == null);
        }