Esempio n. 1
0
        private static DataTable GetServerProperties(TransportQueueLogBatch batch)
        {
            PropertyTable propertyTable = new PropertyTable();

            foreach (PropertyDefinition propertyDefinition in batch.GetPropertyDefinitions(false))
            {
                if (string.Compare(propertyDefinition.Name, TransportQueueLogSaveDataSetSchema.QueueLogPropertiesTableProperty.Name, StringComparison.OrdinalIgnoreCase) != 0)
                {
                    propertyTable.AddPropertyValue(propertyDefinition, batch[propertyDefinition]);
                }
            }
            return(propertyTable);
        }
Esempio n. 2
0
        public IPagedReader <TaskItem> FindTasks(Guid roleId, Guid?ownerId, IEnumerable <TaskExecutionStateType> taskExecutionStates, IEnumerable <TaskExecutionStateType> taskExecutionExclusionStates, SchedulingType?schedulingType, int?regionSelectionSet, Guid?scheduleId, Guid?taskId, TaskCompletionStatusType?taskCompletionStatus, IEnumerable <long> dataCenterIdCollection, int pageSize, Guid?jobId = null, Guid?activeJobId = null)
        {
            int num = 5;

            if (jobId != null)
            {
                num++;
            }
            if (activeJobId != null)
            {
                num++;
            }
            if (ownerId != null)
            {
                num++;
            }
            if (schedulingType != null)
            {
                num++;
            }
            if (regionSelectionSet != null)
            {
                num++;
            }
            if (scheduleId != null)
            {
                num++;
            }
            if (taskId != null)
            {
                num++;
            }
            if (taskCompletionStatus != null)
            {
                num++;
            }
            QueryFilter[] array = new QueryFilter[num];
            num          = 0;
            array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.RoleIdQueryProperty, roleId);
            if (jobId != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.JobIdQueryProperty, jobId);
            }
            if (activeJobId != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.ActiveJobIdQueryProperty, activeJobId);
            }
            if (ownerId != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.OwnerIdQueryProperty, ownerId);
            }
            if (schedulingType != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.SchedulingTypeQueryProperty, (byte)schedulingType.Value);
            }
            if (regionSelectionSet != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.RegionSelectionSetQueryProperty, regionSelectionSet);
            }
            if (scheduleId != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.ScheduleIdQueryProperty, scheduleId);
            }
            if (taskId != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.TaskIdQueryProperty, taskId);
            }
            if (taskCompletionStatus != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.TaskCompletionStatusQueryProperty, taskCompletionStatus);
            }
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            if (dataCenterIdCollection != null)
            {
                foreach (long num2 in dataCenterIdCollection)
                {
                    batchPropertyTable.AddPropertyValue(Guid.NewGuid(), BackgroundJobBackendSession.DCSelectionSetProperty2, num2);
                }
            }
            array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.TvpDCIdList, batchPropertyTable);
            PropertyTable             propertyTable       = new PropertyTable();
            MultiValuedProperty <int> multiValuedProperty = new MultiValuedProperty <int>();

            if (taskExecutionStates != null)
            {
                foreach (TaskExecutionStateType item in taskExecutionStates)
                {
                    multiValuedProperty.Add((int)item);
                }
                propertyTable.AddPropertyValue(BackgroundJobBackendSession.TaskExecutionStateQueryMvpProperty, multiValuedProperty);
            }
            array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.TvpTaskExecutionStates, propertyTable);
            PropertyTable             propertyTable2       = new PropertyTable();
            MultiValuedProperty <int> multiValuedProperty2 = new MultiValuedProperty <int>();

            if (taskExecutionExclusionStates != null)
            {
                foreach (TaskExecutionStateType item2 in taskExecutionExclusionStates)
                {
                    multiValuedProperty2.Add((int)item2);
                }
                propertyTable2.AddPropertyValue(BackgroundJobBackendSession.TaskExecutionStateQueryMvpProperty, multiValuedProperty2);
            }
            array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.TvpTaskExecutionExclusionStates, propertyTable2);
            array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.PageSizeQueryProperty, pageSize);
            QueryFilter queryFilter = new OrFilter(array);

            return(this.GetPagedReader <TaskItem>(queryFilter, pageSize, jobId == null));
        }