Ejemplo n.º 1
0
        public RulePredicateBatch(IEnumerable <RulePredicate> items)
        {
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            foreach (RulePredicate rulePredicate in items)
            {
                Guid identity = CombGuidGenerator.NewGuid();
                batchPropertyTable.AddPropertyValue(identity, RulePredicate.IDProperty, rulePredicate.ID);
                batchPropertyTable.AddPropertyValue(identity, RulePredicate.PredicateIDProperty, rulePredicate.PredicateID);
                batchPropertyTable.AddPropertyValue(identity, RulePredicate.PredicateTypeProperty, rulePredicate.PredicateType);
                if (rulePredicate.Sequence != null)
                {
                    batchPropertyTable.AddPropertyValue(identity, RulePredicate.SequenceProperty, rulePredicate.Sequence);
                }
                if (rulePredicate.ParentID != null)
                {
                    batchPropertyTable.AddPropertyValue(identity, RulePredicate.ParentIDProperty, rulePredicate.ParentID);
                }
                if (rulePredicate.ProcessorID != null)
                {
                    batchPropertyTable.AddPropertyValue(identity, RulePredicate.ProcessorIdProperty, rulePredicate.ProcessorID);
                }
            }
            base.Batch = batchPropertyTable;
        }
Ejemplo n.º 2
0
        public void Save(IEnumerable <AppConfigParameter> items)
        {
            if (items == null)
            {
                throw new ArgumentNullException("items");
            }
            int num = AppConfigSession.Inspect <AppConfigParameter>(items, AppConfigSession.AppConfigParameterEqualityComparer.Default);

            if (num == 0)
            {
                throw new ArgumentOutOfRangeException("items");
            }
            if (num < 0)
            {
                throw new ArgumentException("Duplicate parameters specified.", "items");
            }
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            foreach (AppConfigParameter appConfigParameter in items)
            {
                Guid identity = AppConfigSession.GenerateParameterIdentity();
                batchPropertyTable.AddPropertyValue(identity, AppConfigSchema.ParamVersionProp, appConfigParameter.Version.ToInt64());
                batchPropertyTable.AddPropertyValue(identity, AppConfigSchema.ParamNameProp, appConfigParameter.Name);
                batchPropertyTable.AddPropertyValue(identity, AppConfigSchema.ParamValueProp, appConfigParameter.Value);
                batchPropertyTable.AddPropertyValue(identity, AppConfigSchema.DescriptionProp, appConfigParameter.Description);
            }
            AppConfigSchema.AppConfigItems appConfigItems = new AppConfigSchema.AppConfigItems(batchPropertyTable);
            AuditHelper.ApplyAuditProperties(appConfigItems, default(Guid), null);
            this.DataProvider.Save(appConfigItems);
        }
Ejemplo n.º 3
0
        public RuleBaseBatch(IEnumerable <RuleBase> items)
        {
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            foreach (RuleBase ruleBase in items)
            {
                Guid identity = CombGuidGenerator.NewGuid();
                batchPropertyTable.AddPropertyValue(identity, RuleBase.IDProperty, ruleBase.ID);
                batchPropertyTable.AddPropertyValue(identity, RuleBase.RuleIDProperty, ruleBase.RuleID);
                batchPropertyTable.AddPropertyValue(identity, RuleBase.RuleTypeProperty, ruleBase.RuleType);
                batchPropertyTable.AddPropertyValue(identity, RuleBase.ScopeIDProperty, ruleBase.ScopeID);
                batchPropertyTable.AddPropertyValue(identity, RuleBase.GroupIDProperty, ruleBase.GroupID);
                batchPropertyTable.AddPropertyValue(identity, RuleBase.SequenceProperty, ruleBase.Sequence);
                batchPropertyTable.AddPropertyValue(identity, RuleBase.IsPersistentProperty, ruleBase.IsPersistent);
                batchPropertyTable.AddPropertyValue(identity, RuleBase.IsActiveProperty, ruleBase.IsActive);
                if (ruleBase.State != null)
                {
                    batchPropertyTable.AddPropertyValue(identity, RuleBase.StateProperty, ruleBase.State);
                }
                if (ruleBase.AddedVersion != null)
                {
                    batchPropertyTable.AddPropertyValue(identity, RuleBase.AddedVersionProperty, ruleBase.AddedVersion);
                }
                if (ruleBase.RemovedVersion != null)
                {
                    batchPropertyTable.AddPropertyValue(identity, RuleBase.RemovedVersionProperty, ruleBase.RemovedVersion);
                }
            }
            base.Batch = batchPropertyTable;
        }
Ejemplo n.º 4
0
 private static void AddDataFilterRow(BatchPropertyTable table, ComparisonFilter filter)
 {
     if (filter != null)
     {
         Guid identity = CombGuidGenerator.NewGuid();
         table.AddPropertyValue(identity, TransportQueueSchema.FilterNameProperty, filter.Property.Name);
         table.AddPropertyValue(identity, TransportQueueSchema.OperatorProperty, filter.ComparisonOperator.ToString());
         table.AddPropertyValue(identity, TransportQueueSchema.FilterValueProperty, filter.PropertyValue.ToString());
     }
 }
Ejemplo n.º 5
0
        public void PrepareForSerialization()
        {
            Guid scheduleId = this.ScheduleId;
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            foreach (long num in this.dataCenterIdCollection)
            {
                batchPropertyTable.AddPropertyValue(Guid.NewGuid(), DataCenterDefinition.DataCenterIdProperty, num);
            }
            this[ScheduleItem.SchedIdToDCIdMappingProperty] = batchPropertyTable;
        }
Ejemplo n.º 6
0
        private static DataTable GetDataFilter(MultiValuedProperty <ComparisonFilter> dataFilterList)
        {
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            if (dataFilterList != null)
            {
                foreach (ComparisonFilter filter in dataFilterList)
                {
                    TransportQueueSession.AddDataFilterRow(batchPropertyTable, filter);
                }
            }
            return(batchPropertyTable);
        }
        public SpamRuleProcessorBlobBatch(IEnumerable <SpamRuleProcessorBlob> items)
        {
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            foreach (SpamRuleProcessorBlob spamRuleProcessorBlob in items)
            {
                Guid identity = CombGuidGenerator.NewGuid();
                batchPropertyTable.AddPropertyValue(identity, SpamRuleProcessorBlobSchema.IdProperty, spamRuleProcessorBlob.Id);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleProcessorBlobSchema.ProcessorIdProperty, spamRuleProcessorBlob.ProcessorId);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleProcessorBlobSchema.DataProperty, spamRuleProcessorBlob.Data);
            }
            base.Batch = batchPropertyTable;
        }
Ejemplo n.º 8
0
        public SyncWatermarkBatch(IEnumerable <SyncWatermark> items)
        {
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            foreach (SyncWatermark syncWatermark in items)
            {
                Guid identity = CombGuidGenerator.NewGuid();
                batchPropertyTable.AddPropertyValue(identity, SyncWatermark.IdProperty, syncWatermark.Id);
                batchPropertyTable.AddPropertyValue(identity, SyncWatermark.SyncContextProperty, syncWatermark.SyncContext);
                batchPropertyTable.AddPropertyValue(identity, SyncWatermark.DataProperty, syncWatermark.Data);
                batchPropertyTable.AddPropertyValue(identity, SyncWatermark.OwnerProperty, syncWatermark.Owner);
            }
            base.Batch = batchPropertyTable;
        }
        public PredicateExtendedPropertyBatch(IEnumerable <PredicateExtendedProperty> items)
        {
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            foreach (PredicateExtendedProperty predicateExtendedProperty in items)
            {
                Guid identity = CombGuidGenerator.NewGuid();
                batchPropertyTable.AddPropertyValue(identity, PredicateExtendedProperty.IDProperty, predicateExtendedProperty.ID);
                batchPropertyTable.AddPropertyValue(identity, PredicateExtendedProperty.PredicateIDProperty, predicateExtendedProperty.PredicateID);
                if (predicateExtendedProperty.PropertyName != null)
                {
                    batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.NameProperty, predicateExtendedProperty.PropertyName);
                    if (predicateExtendedProperty.IntValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.IntValueProperty, predicateExtendedProperty.IntValue);
                    }
                    if (predicateExtendedProperty.LongValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.LongValueProperty, predicateExtendedProperty.LongValue);
                    }
                    if (predicateExtendedProperty.StringValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.StringValueProperty, predicateExtendedProperty.StringValue);
                    }
                    if (predicateExtendedProperty.BlobValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.BlobValueProperty, predicateExtendedProperty.BlobValue);
                    }
                    if (predicateExtendedProperty.DatetimeValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.DatetimeValueProperty, predicateExtendedProperty.DatetimeValue);
                    }
                    if (predicateExtendedProperty.DecimalValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.DecimalValueProperty, predicateExtendedProperty.DecimalValue);
                    }
                    if (predicateExtendedProperty.BoolValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.BoolValueProperty, predicateExtendedProperty.BoolValue);
                    }
                    if (predicateExtendedProperty.GuidValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.GuidValueProperty, predicateExtendedProperty.GuidValue);
                    }
                }
            }
            base.Batch = batchPropertyTable;
        }
Ejemplo n.º 10
0
        public ProcessorBatch(IEnumerable <Processor> items)
        {
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            foreach (Processor processor in items)
            {
                Guid identity = CombGuidGenerator.NewGuid();
                batchPropertyTable.AddPropertyValue(identity, Processor.ProcessorIDProperty, processor.ProcessorID);
                if (processor.PropertyName != null)
                {
                    batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.NameProperty, processor.PropertyName);
                    if (processor.IntValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.IntValueProperty, processor.IntValue);
                    }
                    if (processor.LongValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.LongValueProperty, processor.LongValue);
                    }
                    if (processor.StringValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.StringValueProperty, processor.StringValue);
                    }
                    if (processor.BlobValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.BlobValueProperty, processor.BlobValue);
                    }
                    if (processor.DatetimeValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.DatetimeValueProperty, processor.DatetimeValue);
                    }
                    if (processor.DecimalValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.DecimalValueProperty, processor.DecimalValue);
                    }
                    if (processor.BoolValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.BoolValueProperty, processor.BoolValue);
                    }
                    if (processor.GuidValue != null)
                    {
                        batchPropertyTable.AddPropertyValue(identity, ConfigurablePropertyTable.GuidValueProperty, processor.GuidValue);
                    }
                }
            }
            base.Batch = batchPropertyTable;
        }
Ejemplo n.º 11
0
        private static DataTable GetQueueLogProperties(TransportQueueLogBatch batch)
        {
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            if (batch.QueueLogs != null)
            {
                foreach (TransportQueueLog transportQueueLog in batch.QueueLogs)
                {
                    foreach (PropertyDefinition propertyDefinition in DalHelper.GetPropertyDefinitions(transportQueueLog, true))
                    {
                        if (!propertyDefinition.Type.Equals(typeof(DataTable)))
                        {
                            batchPropertyTable.AddPropertyValue(transportQueueLog.QueueId, propertyDefinition, transportQueueLog[propertyDefinition]);
                        }
                    }
                }
            }
            return(batchPropertyTable);
        }
Ejemplo n.º 12
0
        public SpamRuleBlobBatch(IEnumerable <SpamRuleBlob> items)
        {
            BatchPropertyTable batchPropertyTable = new BatchPropertyTable();

            foreach (SpamRuleBlob spamRuleBlob in items)
            {
                Guid identity = CombGuidGenerator.NewGuid();
                batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.IdProperty, spamRuleBlob.Id);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.RuleIdProperty, spamRuleBlob.RuleId);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.GroupIdProperty, spamRuleBlob.GroupId);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.ScopeIdProperty, spamRuleBlob.ScopeId);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.RuleDataProperty, spamRuleBlob.RuleData);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.RuleMetaDataProperty, spamRuleBlob.RuleMetaData);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.PriorityProperty, spamRuleBlob.Priority);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.PublishingStateProperty, spamRuleBlob.PublishingState);
                batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.ProcessorDataProperty, spamRuleBlob.ProcessorData);
                if (spamRuleBlob.DeletedDatetime != null)
                {
                    batchPropertyTable.AddPropertyValue(identity, SpamRuleBlobSchema.DeletedDatetimeProperty, spamRuleBlob.DeletedDatetime);
                }
            }
            base.Batch = batchPropertyTable;
        }
Ejemplo n.º 13
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));
        }
Ejemplo n.º 14
0
        public ScheduleItem[] FindScheduleItems(Guid roleId, Guid?scheduleId = null, bool?active = null, int?regionSelectionSet = null, IEnumerable <long> dataCenterIdCollection = null, Guid?jobId = null)
        {
            int num = 2;

            if (scheduleId != null)
            {
                num++;
            }
            if (active != null)
            {
                num++;
            }
            if (regionSelectionSet != null)
            {
                num++;
            }
            if (jobId != null)
            {
                num++;
            }
            QueryFilter[] array = new QueryFilter[num];
            num          = 0;
            array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.RoleIdQueryProperty, roleId);
            if (scheduleId != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.ScheduleIdQueryProperty, scheduleId);
            }
            if (active != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.ActiveQueryProperty, active);
            }
            if (regionSelectionSet != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.RegionSelectionSetQueryProperty, regionSelectionSet);
            }
            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);
            if (jobId != null)
            {
                array[num++] = new ComparisonFilter(ComparisonOperator.Equal, BackgroundJobBackendSession.JobIdQueryProperty, jobId);
            }
            QueryFilter filter;

            if (num > 1)
            {
                filter = new OrFilter(array);
            }
            else
            {
                filter = array[0];
            }
            IConfigurable[] array2 = this.dataProvider.Find <ScheduleItem>(filter, null, false, null);
            if (array2 == null)
            {
                return(null);
            }
            return(BackgroundJobBackendSession.IConfigurableArrayTo <ScheduleItem>(array2));
        }